docs/EventsApi.md in klaviyo-api-sdk-1.2.0 vs docs/EventsApi.md in klaviyo-api-sdk-2.0.0

- old
+ new

@@ -6,11 +6,12 @@ | ------ | ------------ | ----------- | | [**create_event**](EventsApi.md#create_event) | **POST** /api/events/ | Create Event | | [**get_event**](EventsApi.md#get_event) | **GET** /api/events/{id}/ | Get Event | | [**get_event_metrics**](EventsApi.md#get_event_metrics) | **GET** /api/events/{id}/metrics/ | Get Event Metrics | | [**get_event_profiles**](EventsApi.md#get_event_profiles) | **GET** /api/events/{id}/profiles/ | Get Event Profiles | -| [**get_event_relationships**](EventsApi.md#get_event_relationships) | **GET** /api/events/{id}/relationships/{related_resource}/ | Get Event Relationships | +| [**get_event_relationships_metrics**](EventsApi.md#get_event_relationships_metrics) | **GET** /api/events/{id}/relationships/metrics/ | Get Event Relationships Metrics | +| [**get_event_relationships_profiles**](EventsApi.md#get_event_relationships_profiles) | **GET** /api/events/{id}/relationships/profiles/ | Get Event Relationships Profiles | | [**get_events**](EventsApi.md#get_events) | **GET** /api/events/ | Get Events | ## create_event @@ -32,11 +33,11 @@ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) # config.api_key_prefix['Klaviyo-API-Key'] = 'Bearer' end api_instance = KlaviyoAPI::EventsApi.new -event_create_query = KlaviyoAPI::EventCreateQuery.new({data: KlaviyoAPI::EventCreateQueryAsSubResource.new({type: 'event', attributes: KlaviyoAPI::EventCreateQueryAsSubResourceAttributes.new({profile: {"$email":"matt.kemp@klaviyo-demo.com"}, metric: KlaviyoAPI::MetricCreateQuery.new({name: 'Viewed Product'}), properties: {"Brand":"Kids Book","Categories":["Fiction","Children"],"ProductID":1111,"ProductName":"Winnie the Pooh","$extra":{"URL":"http://www.example.com/path/to/product","ImageURL":"http://www.example.com/path/to/product/image.png"}}})})}) # EventCreateQuery | Event to create. +event_create_query = KlaviyoAPI::EventCreateQuery.new({data: KlaviyoAPI::EventCreateQueryResourceObject.new({type: KlaviyoAPI::EventEnum::EVENT, attributes: KlaviyoAPI::EventCreateQueryResourceObjectAttributes.new({profile: {"$email":"matt.kemp@klaviyo-demo.com"}, metric: KlaviyoAPI::MetricCreateQuery.new({name: 'Viewed Product'}), properties: {"Brand":"Kids Book","Categories":["Fiction","Children"],"ProductID":1111,"ProductName":"Winnie the Pooh","$extra":{"URL":"http://www.example.com/path/to/product","ImageURL":"http://www.example.com/path/to/product/image.png"}}})})}) # EventCreateQuery | Event to create. begin # Create Event api_instance.create_event(event_create_query) rescue KlaviyoAPI::ApiError => e @@ -260,10 +261,11 @@ end api_instance = KlaviyoAPI::EventsApi.new id = 'id_example' # String | ID of the event opts = { + additional_fields_profile: ['predictive_analytics'], # Array<String> | Request additional fields not included by default in the response. Supported values: 'predictive_analytics' fields_profile: ['email'] # Array<String> | For more information please visit https://developers.klaviyo.com/en/v2023-02-22/reference/api-overview#sparse-fieldsets } begin # Get Event Profiles @@ -295,10 +297,11 @@ ### Parameters | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **id** | **String** | ID of the event | | +| **additional_fields_profile** | [**Array&lt;String&gt;**](String.md) | Request additional fields not included by default in the response. Supported values: &#39;predictive_analytics&#39; | [optional] | | **fields_profile** | [**Array&lt;String&gt;**](String.md) | For more information please visit https://developers.klaviyo.com/en/v2023-02-22/reference/api-overview#sparse-fieldsets | [optional] | ### Return type **Hash&lt;String, Object&gt;** @@ -311,17 +314,17 @@ - **Content-Type**: Not defined - **Accept**: application/json -## get_event_relationships +## get_event_relationships_metrics -> Hash&lt;String, Object&gt; get_event_relationships(id, related_resource) +> Hash&lt;String, Object&gt; get_event_relationships_metrics(id) -Get Event Relationships +Get Event Relationships Metrics -Get metrics or profile [relationships](https://developers.klaviyo.com/en/reference/api_overview#relationships) for an event with the given event ID.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `Events Read` `Metrics Read` `Profiles Read` +Get a list of related Metrics for an Event<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `Events Read` `Metrics Read` ### Examples ```ruby require 'time' @@ -334,45 +337,43 @@ # config.api_key_prefix['Klaviyo-API-Key'] = 'Bearer' end api_instance = KlaviyoAPI::EventsApi.new id = 'id_example' # String | -related_resource = 'metrics' # String | begin - # Get Event Relationships - result = api_instance.get_event_relationships(id, related_resource) + # Get Event Relationships Metrics + result = api_instance.get_event_relationships_metrics(id) p result rescue KlaviyoAPI::ApiError => e - puts "Error when calling EventsApi->get_event_relationships: #{e}" + puts "Error when calling EventsApi->get_event_relationships_metrics: #{e}" end ``` -#### Using the get_event_relationships_with_http_info variant +#### Using the get_event_relationships_metrics_with_http_info variant This returns an Array which contains the response data, status code and headers. -> <Array(Hash&lt;String, Object&gt;, Integer, Hash)> get_event_relationships_with_http_info(id, related_resource) +> <Array(Hash&lt;String, Object&gt;, Integer, Hash)> get_event_relationships_metrics_with_http_info(id) ```ruby begin - # Get Event Relationships - data, status_code, headers = api_instance.get_event_relationships_with_http_info(id, related_resource) + # Get Event Relationships Metrics + data, status_code, headers = api_instance.get_event_relationships_metrics_with_http_info(id) p status_code # => 2xx p headers # => { ... } p data # => Hash&lt;String, Object&gt; rescue KlaviyoAPI::ApiError => e - puts "Error when calling EventsApi->get_event_relationships_with_http_info: #{e}" + puts "Error when calling EventsApi->get_event_relationships_metrics_with_http_info: #{e}" end ``` ### Parameters | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **id** | **String** | | | -| **related_resource** | **String** | | | ### Return type **Hash&lt;String, Object&gt;** @@ -384,10 +385,81 @@ - **Content-Type**: Not defined - **Accept**: application/json +## get_event_relationships_profiles + +> Hash&lt;String, Object&gt; get_event_relationships_profiles(id) + +Get Event Relationships Profiles + +Get profile [relationships](https://developers.klaviyo.com/en/reference/api_overview#relationships) for an event with the given event ID.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `Events Read` `Profiles Read` + +### Examples + +```ruby +require 'time' +require 'klaviyo-api-sdk' +# setup authorization +KlaviyoAPI.configure do |config| + # Configure API key authorization: Klaviyo-API-Key + config.api_key['Klaviyo-API-Key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + # config.api_key_prefix['Klaviyo-API-Key'] = 'Bearer' +end + +api_instance = KlaviyoAPI::EventsApi.new +id = 'id_example' # String | + +begin + # Get Event Relationships Profiles + result = api_instance.get_event_relationships_profiles(id) + p result +rescue KlaviyoAPI::ApiError => e + puts "Error when calling EventsApi->get_event_relationships_profiles: #{e}" +end +``` + +#### Using the get_event_relationships_profiles_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> <Array(Hash&lt;String, Object&gt;, Integer, Hash)> get_event_relationships_profiles_with_http_info(id) + +```ruby +begin + # Get Event Relationships Profiles + data, status_code, headers = api_instance.get_event_relationships_profiles_with_http_info(id) + p status_code # => 2xx + p headers # => { ... } + p data # => Hash&lt;String, Object&gt; +rescue KlaviyoAPI::ApiError => e + puts "Error when calling EventsApi->get_event_relationships_profiles_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | | | + +### Return type + +**Hash&lt;String, Object&gt;** + +### Authorization + +[Klaviyo-API-Key](../README.md#Klaviyo-API-Key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + ## get_events > Hash&lt;String, Object&gt; get_events(opts) Get Events @@ -410,11 +482,11 @@ api_instance = KlaviyoAPI::EventsApi.new opts = { fields_event: ['metric_id'], # Array<String> | For more information please visit https://developers.klaviyo.com/en/v2023-02-22/reference/api-overview#sparse-fieldsets fields_metric: ['name'], # Array<String> | For more information please visit https://developers.klaviyo.com/en/v2023-02-22/reference/api-overview#sparse-fieldsets fields_profile: ['email'], # Array<String> | For more information please visit https://developers.klaviyo.com/en/v2023-02-22/reference/api-overview#sparse-fieldsets - filter: 'filter_example', # String | For more information please visit https://developers.klaviyo.com/en/v2023-02-22/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`metric_id`: `equals`<br>`datetime`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`timestamp`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` + filter: 'filter_example', # String | For more information please visit https://developers.klaviyo.com/en/v2023-02-22/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`metric_id`: `equals`<br>`profile_id`: `equals`<br>`datetime`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`timestamp`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` include: ['metrics'], # Array<String> | For more information please visit https://developers.klaviyo.com/en/v2023-02-22/reference/api-overview#relationships page_cursor: 'page_cursor_example', # String | For more information please visit https://developers.klaviyo.com/en/v2023-02-22/reference/api-overview#pagination sort: 'datetime' # String | For more information please visit https://developers.klaviyo.com/en/v2023-02-22/reference/api-overview#sorting } @@ -450,10 +522,10 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **fields_event** | [**Array&lt;String&gt;**](String.md) | For more information please visit https://developers.klaviyo.com/en/v2023-02-22/reference/api-overview#sparse-fieldsets | [optional] | | **fields_metric** | [**Array&lt;String&gt;**](String.md) | For more information please visit https://developers.klaviyo.com/en/v2023-02-22/reference/api-overview#sparse-fieldsets | [optional] | | **fields_profile** | [**Array&lt;String&gt;**](String.md) | For more information please visit https://developers.klaviyo.com/en/v2023-02-22/reference/api-overview#sparse-fieldsets | [optional] | -| **filter** | **String** | For more information please visit https://developers.klaviyo.com/en/v2023-02-22/reference/api-overview#filtering&lt;br&gt;Allowed field(s)/operator(s):&lt;br&gt;&#x60;metric_id&#x60;: &#x60;equals&#x60;&lt;br&gt;&#x60;datetime&#x60;: &#x60;greater-or-equal&#x60;, &#x60;greater-than&#x60;, &#x60;less-or-equal&#x60;, &#x60;less-than&#x60;&lt;br&gt;&#x60;timestamp&#x60;: &#x60;greater-or-equal&#x60;, &#x60;greater-than&#x60;, &#x60;less-or-equal&#x60;, &#x60;less-than&#x60; | [optional] | +| **filter** | **String** | For more information please visit https://developers.klaviyo.com/en/v2023-02-22/reference/api-overview#filtering&lt;br&gt;Allowed field(s)/operator(s):&lt;br&gt;&#x60;metric_id&#x60;: &#x60;equals&#x60;&lt;br&gt;&#x60;profile_id&#x60;: &#x60;equals&#x60;&lt;br&gt;&#x60;datetime&#x60;: &#x60;greater-or-equal&#x60;, &#x60;greater-than&#x60;, &#x60;less-or-equal&#x60;, &#x60;less-than&#x60;&lt;br&gt;&#x60;timestamp&#x60;: &#x60;greater-or-equal&#x60;, &#x60;greater-than&#x60;, &#x60;less-or-equal&#x60;, &#x60;less-than&#x60; | [optional] | | **include** | [**Array&lt;String&gt;**](String.md) | For more information please visit https://developers.klaviyo.com/en/v2023-02-22/reference/api-overview#relationships | [optional] | | **page_cursor** | **String** | For more information please visit https://developers.klaviyo.com/en/v2023-02-22/reference/api-overview#pagination | [optional] | | **sort** | **String** | For more information please visit https://developers.klaviyo.com/en/v2023-02-22/reference/api-overview#sorting | [optional] | ### Return type