Skip to content

Commit

Permalink
version 7.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
klaviyo-sdk committed May 15, 2024
1 parent b118e22 commit f03cd45
Show file tree
Hide file tree
Showing 384 changed files with 7,675 additions and 1,496 deletions.
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,28 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [7.0.0] - revision 2024-05-15

### Added

- Bulk Create Events API with
- We have added support for creating events in bulk via the `KlaviyoAPI::Event.bulk_create_events` method
- Create multiple events for new and existing profiles and/or update profile properties in a single API call. For more information, see our [Events API overview](https://developers.klaviyo.com/en/reference/events_api_overview).

### Changed

- Accounts Api
- `KlaviyoAPI::Accounts.get_accounts` and `KlaviyoAPI::Accounts.get_account` have been updated to return the account's locale, e.g. `en-US`.

- **Breaking** Subscribe API Synchronous Validation Improved
- To provide better feedback for handling SMS subscriptions, we’ve added improved validation behavior to `KlaviyoAPI::Profiles.subscribe_profiles` method. In prior revisions, such requests may appear as 202s but will fail to update SMS consent. To handle this issue, 400 validation errors are returned for the following cases
1. If a profile is subscribed to SMS marketing and [age-gating is enabled](https://help.klaviyo.com/hc/en-us/articles/4408311712667) but age_gated_date_of_birth is not provided, or the DOB does not meet the region's requirements.
2. If the account does not have a sending number in the phone number’s region.
3. If the phone number is in a region not supported by Klaviyo.
4. If consented_at is set and the list or global setting is double opt-in.
- Use `KLAVIYO_API_REVISION` as the env var for controlling which Klaviyo API to call, instead of `API_REVISION`. However, `API_REVISION` is a fallback, to avoid making this a breaking change


## [6.0.0] - revision 2024-02-15

### Added:
Expand Down
436 changes: 223 additions & 213 deletions README.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions klaviyo-api-sdk.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details.
The version of the OpenAPI document: 2024-02-15
The version of the OpenAPI document: 2024-05-15
Contact: [email protected]
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.2.1
Expand All @@ -17,7 +17,7 @@ require "klaviyo-api-sdk/version"

Gem::Specification.new do |s|
s.name = "klaviyo-api-sdk"
s.version = "6.0.0"
s.version = "7.0.0"
s.authors = ['Klaviyo Team']
s.email = ['[email protected]']
s.summary = 'You heard us, a Ruby wrapper for the Klaviyo API'
Expand Down
28 changes: 27 additions & 1 deletion lib/klaviyo-api-sdk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details.
The version of the OpenAPI document: 2024-02-15
The version of the OpenAPI document: 2024-05-15
Contact: [email protected]
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.2.1
Expand All @@ -19,6 +19,8 @@
# Models
require 'klaviyo-api-sdk/models/audiences_sub_object'
require 'klaviyo-api-sdk/models/back_in_stock_subscription_enum'
require 'klaviyo-api-sdk/models/base_event_create_query_resource_object'
require 'klaviyo-api-sdk/models/base_event_create_query_resource_object_attributes'
require 'klaviyo-api-sdk/models/campaign_clone_query'
require 'klaviyo-api-sdk/models/campaign_clone_query_resource_object'
require 'klaviyo-api-sdk/models/campaign_clone_query_resource_object_attributes'
Expand Down Expand Up @@ -173,12 +175,24 @@
require 'klaviyo-api-sdk/models/email_send_options_sub_object'
require 'klaviyo-api-sdk/models/email_subscription_parameters'
require 'klaviyo-api-sdk/models/email_tracking_options_sub_object'
require 'klaviyo-api-sdk/models/event_bulk_create_enum'
require 'klaviyo-api-sdk/models/event_bulk_create_job_enum'
require 'klaviyo-api-sdk/models/event_create_query_v2'
require 'klaviyo-api-sdk/models/event_create_query_v2_resource_object'
require 'klaviyo-api-sdk/models/event_create_query_v2_resource_object_attributes'
require 'klaviyo-api-sdk/models/event_create_query_v2_resource_object_attributes_metric'
require 'klaviyo-api-sdk/models/event_create_query_v2_resource_object_attributes_profile'
require 'klaviyo-api-sdk/models/event_enum'
require 'klaviyo-api-sdk/models/event_profile_create_query_resource_object'
require 'klaviyo-api-sdk/models/event_profile_create_query_resource_object_attributes'
require 'klaviyo-api-sdk/models/events_bulk_create_job'
require 'klaviyo-api-sdk/models/events_bulk_create_job_resource_object'
require 'klaviyo-api-sdk/models/events_bulk_create_job_resource_object_attributes'
require 'klaviyo-api-sdk/models/events_bulk_create_job_resource_object_attributes_events_bulk_create'
require 'klaviyo-api-sdk/models/events_bulk_create_query_resource_object'
require 'klaviyo-api-sdk/models/events_bulk_create_query_resource_object_attributes'
require 'klaviyo-api-sdk/models/events_bulk_create_query_resource_object_attributes_events'
require 'klaviyo-api-sdk/models/events_bulk_create_query_resource_object_attributes_profile'
require 'klaviyo-api-sdk/models/flow_enum'
require 'klaviyo-api-sdk/models/flow_series_report_enum'
require 'klaviyo-api-sdk/models/flow_series_request_dto'
Expand Down Expand Up @@ -265,6 +279,8 @@
require 'klaviyo-api-sdk/models/profile_upsert_query'
require 'klaviyo-api-sdk/models/profile_upsert_query_resource_object'
require 'klaviyo-api-sdk/models/profile_upsert_query_resource_object_attributes'
require 'klaviyo-api-sdk/models/push_profile_upsert_query_resource_object'
require 'klaviyo-api-sdk/models/push_profile_upsert_query_resource_object_attributes'
require 'klaviyo-api-sdk/models/push_token_create_query'
require 'klaviyo-api-sdk/models/push_token_create_query_resource_object'
require 'klaviyo-api-sdk/models/push_token_create_query_resource_object_attributes'
Expand Down Expand Up @@ -308,10 +324,20 @@
require 'klaviyo-api-sdk/models/suppression_create_job_create_query_resource_object'
require 'klaviyo-api-sdk/models/suppression_create_job_create_query_resource_object_attributes'
require 'klaviyo-api-sdk/models/suppression_create_job_create_query_resource_object_attributes_profiles'
require 'klaviyo-api-sdk/models/suppression_create_job_create_query_resource_object_relationships'
require 'klaviyo-api-sdk/models/suppression_create_job_create_query_resource_object_relationships_list'
require 'klaviyo-api-sdk/models/suppression_create_job_create_query_resource_object_relationships_list_data'
require 'klaviyo-api-sdk/models/suppression_create_job_create_query_resource_object_relationships_segment'
require 'klaviyo-api-sdk/models/suppression_create_job_create_query_resource_object_relationships_segment_data'
require 'klaviyo-api-sdk/models/suppression_delete_job_create_query'
require 'klaviyo-api-sdk/models/suppression_delete_job_create_query_resource_object'
require 'klaviyo-api-sdk/models/suppression_delete_job_create_query_resource_object_attributes'
require 'klaviyo-api-sdk/models/suppression_delete_job_create_query_resource_object_attributes_profiles'
require 'klaviyo-api-sdk/models/suppression_delete_job_create_query_resource_object_relationships'
require 'klaviyo-api-sdk/models/suppression_delete_job_create_query_resource_object_relationships_list'
require 'klaviyo-api-sdk/models/suppression_delete_job_create_query_resource_object_relationships_list_data'
require 'klaviyo-api-sdk/models/suppression_delete_job_create_query_resource_object_relationships_segment'
require 'klaviyo-api-sdk/models/suppression_delete_job_create_query_resource_object_relationships_segment_data'
require 'klaviyo-api-sdk/models/tag_campaign_op'
require 'klaviyo-api-sdk/models/tag_campaign_op_data_inner'
require 'klaviyo-api-sdk/models/tag_create_query'
Expand Down
18 changes: 9 additions & 9 deletions lib/klaviyo-api-sdk/api/accounts_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details.
The version of the OpenAPI document: 2024-02-15
The version of the OpenAPI document: 2024-05-15
Contact: [email protected]
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.2.1
Expand All @@ -23,7 +23,7 @@ def initialize(api_client = ApiClient.default)
# Retrieve a single account object by its account ID. You can only request the account by which the private API key was generated.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m` **Scopes:** `accounts:read`
# @param id [String] The ID of the account
# @param [Hash] opts the optional parameters
# @option opts [Array<String>] :fields_account For more information please visit https://developers.klaviyo.com/en/v2024-02-15/reference/api-overview#sparse-fieldsets
# @option opts [Array<String>] :fields_account For more information please visit https://developers.klaviyo.com/en/v2024-05-15/reference/api-overview#sparse-fieldsets
# @return [Hash<String, Object>]
def get_account(id, opts = {})
data, _status_code, _headers = get_account_with_http_info(id, opts)
Expand All @@ -34,7 +34,7 @@ def get_account(id, opts = {})
# Retrieve a single account object by its account ID. You can only request the account by which the private API key was generated.&lt;br&gt;&lt;br&gt;*Rate limits*:&lt;br&gt;Burst: &#x60;1/s&#x60;&lt;br&gt;Steady: &#x60;15/m&#x60; **Scopes:** &#x60;accounts:read&#x60;
# @param id [String] The ID of the account
# @param [Hash] opts the optional parameters
# @option opts [Array<String>] :fields_account For more information please visit https://developers.klaviyo.com/en/v2024-02-15/reference/api-overview#sparse-fieldsets
# @option opts [Array<String>] :fields_account For more information please visit https://developers.klaviyo.com/en/v2024-05-15/reference/api-overview#sparse-fieldsets
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
def get_account_with_http_info(id, opts = {})
if @api_client.config.debugging
Expand All @@ -44,7 +44,7 @@ def get_account_with_http_info(id, opts = {})
if @api_client.config.client_side_validation && id.nil?
fail ArgumentError, "Missing the required parameter 'id' when calling AccountsApi.get_account"
end
allowable_values = ["contact_information", "contact_information.default_sender_name", "contact_information.default_sender_email", "contact_information.website_url", "contact_information.organization_name", "contact_information.street_address", "contact_information.street_address.address1", "contact_information.street_address.address2", "contact_information.street_address.city", "contact_information.street_address.region", "contact_information.street_address.country", "contact_information.street_address.zip", "industry", "timezone", "preferred_currency", "public_api_key"]
allowable_values = ["test_account", "contact_information", "contact_information.default_sender_name", "contact_information.default_sender_email", "contact_information.website_url", "contact_information.organization_name", "contact_information.street_address", "contact_information.street_address.address1", "contact_information.street_address.address2", "contact_information.street_address.city", "contact_information.street_address.region", "contact_information.street_address.country", "contact_information.street_address.zip", "industry", "timezone", "preferred_currency", "public_api_key", "locale"]
if @api_client.config.client_side_validation && opts[:'fields_account'] && !opts[:'fields_account'].all? { |item| allowable_values.include?(item) }
fail ArgumentError, "invalid value for \"fields_account\", must include one of #{allowable_values}"
end
Expand All @@ -58,7 +58,7 @@ def get_account_with_http_info(id, opts = {})
# header parameters
header_params = opts[:header_params] || {}
# klaviyo api revision
header_params['revision'] = ENV['API_REVISION'] || "2024-02-15"
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-05-15"
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json'])

Expand Down Expand Up @@ -94,7 +94,7 @@ def get_account_with_http_info(id, opts = {})
# Get Accounts
# Retrieve the account(s) associated with a given private API key. This will return 1 account object within the array. You can use this to retrieve account-specific data (contact information, timezone, currency, Public API key, etc.) or test if a Private API Key belongs to the correct account prior to performing subsequent actions with the API.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m` **Scopes:** `accounts:read`
# @param [Hash] opts the optional parameters
# @option opts [Array<String>] :fields_account For more information please visit https://developers.klaviyo.com/en/v2024-02-15/reference/api-overview#sparse-fieldsets
# @option opts [Array<String>] :fields_account For more information please visit https://developers.klaviyo.com/en/v2024-05-15/reference/api-overview#sparse-fieldsets
# @return [Hash<String, Object>]
def get_accounts(opts = {})
data, _status_code, _headers = get_accounts_with_http_info(opts)
Expand All @@ -104,13 +104,13 @@ def get_accounts(opts = {})
# Get Accounts
# Retrieve the account(s) associated with a given private API key. This will return 1 account object within the array. You can use this to retrieve account-specific data (contact information, timezone, currency, Public API key, etc.) or test if a Private API Key belongs to the correct account prior to performing subsequent actions with the API.&lt;br&gt;&lt;br&gt;*Rate limits*:&lt;br&gt;Burst: &#x60;1/s&#x60;&lt;br&gt;Steady: &#x60;15/m&#x60; **Scopes:** &#x60;accounts:read&#x60;
# @param [Hash] opts the optional parameters
# @option opts [Array<String>] :fields_account For more information please visit https://developers.klaviyo.com/en/v2024-02-15/reference/api-overview#sparse-fieldsets
# @option opts [Array<String>] :fields_account For more information please visit https://developers.klaviyo.com/en/v2024-05-15/reference/api-overview#sparse-fieldsets
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
def get_accounts_with_http_info(opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: AccountsApi.get_accounts ...'
end
allowable_values = ["contact_information", "contact_information.default_sender_name", "contact_information.default_sender_email", "contact_information.website_url", "contact_information.organization_name", "contact_information.street_address", "contact_information.street_address.address1", "contact_information.street_address.address2", "contact_information.street_address.city", "contact_information.street_address.region", "contact_information.street_address.country", "contact_information.street_address.zip", "industry", "timezone", "preferred_currency", "public_api_key"]
allowable_values = ["test_account", "contact_information", "contact_information.default_sender_name", "contact_information.default_sender_email", "contact_information.website_url", "contact_information.organization_name", "contact_information.street_address", "contact_information.street_address.address1", "contact_information.street_address.address2", "contact_information.street_address.city", "contact_information.street_address.region", "contact_information.street_address.country", "contact_information.street_address.zip", "industry", "timezone", "preferred_currency", "public_api_key", "locale"]
if @api_client.config.client_side_validation && opts[:'fields_account'] && !opts[:'fields_account'].all? { |item| allowable_values.include?(item) }
fail ArgumentError, "invalid value for \"fields_account\", must include one of #{allowable_values}"
end
Expand All @@ -124,7 +124,7 @@ def get_accounts_with_http_info(opts = {})
# header parameters
header_params = opts[:header_params] || {}
# klaviyo api revision
header_params['revision'] = ENV['API_REVISION'] || "2024-02-15"
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-05-15"
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json'])

Expand Down
Loading

0 comments on commit f03cd45

Please sign in to comment.