klaviyo_sdk 1.0.3.20220329 → 1.0.4.20220329

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -0
  3. data/README.md +25 -3
  4. data/klaviyo_sdk.gemspec +1 -1
  5. data/lib/klaviyo_sdk/api/data_privacy_api.rb +2 -2
  6. data/lib/klaviyo_sdk/api/profiles_api.rb +66 -0
  7. data/lib/klaviyo_sdk/api_client.rb +1 -1
  8. data/lib/klaviyo_sdk/models/campaign.rb +198 -18
  9. data/lib/klaviyo_sdk/models/campaign_lists.rb +318 -0
  10. data/lib/klaviyo_sdk/models/campaigns.rb +487 -0
  11. data/lib/klaviyo_sdk/models/inline_object5.rb +0 -1
  12. data/lib/klaviyo_sdk/models/inline_response200.rb +218 -0
  13. data/lib/klaviyo_sdk.rb +3 -0
  14. metadata +6 -76
  15. data/docs/Campaign.md +0 -38
  16. data/docs/CampaignsApi.md +0 -707
  17. data/docs/CheckMembershipRequest.md +0 -22
  18. data/docs/DataPrivacyApi.md +0 -81
  19. data/docs/DeleteEmail.md +0 -18
  20. data/docs/DeletePerson.md +0 -18
  21. data/docs/DeletePhone.md +0 -18
  22. data/docs/DeprecatedGetListResponse.md +0 -30
  23. data/docs/DeprecatedGetListResponseData.md +0 -28
  24. data/docs/GlobalExclusionResponseData.md +0 -30
  25. data/docs/IdentifyPayload.md +0 -20
  26. data/docs/IdentifyPayloadProperties.md +0 -42
  27. data/docs/InlineObject.md +0 -18
  28. data/docs/InlineObject3.md +0 -18
  29. data/docs/InlineObject4.md +0 -18
  30. data/docs/InlineObject5.md +0 -22
  31. data/docs/ListsSegmentsApi.md +0 -1198
  32. data/docs/Metric.md +0 -28
  33. data/docs/MetricExport.md +0 -32
  34. data/docs/MetricTimeline.md +0 -24
  35. data/docs/MetricTimelineData.md +0 -34
  36. data/docs/MetricsApi.md +0 -329
  37. data/docs/Person.md +0 -56
  38. data/docs/PrivacyEmail.md +0 -18
  39. data/docs/PrivacyId.md +0 -18
  40. data/docs/PrivacyPhone.md +0 -18
  41. data/docs/ProfilesApi.md +0 -391
  42. data/docs/RenderedTemplate.md +0 -24
  43. data/docs/Template.md +0 -30
  44. data/docs/TemplatesApi.md +0 -541
  45. data/docs/TrackIdentifyApi.md +0 -267
  46. data/docs/TrackPayload.md +0 -24
  47. data/docs/TrackPayloadCustomerProperties.md +0 -20
  48. data/docs/TrackPayloadProperties.md +0 -22
  49. data/git_push.sh +0 -57
  50. data/klaviyo_sdk-1.0.3.2022.03.29.gem +0 -0
  51. data/spec/api/campaigns_api_spec.rb +0 -165
  52. data/spec/api/data_privacy_api_spec.rb +0 -47
  53. data/spec/api/lists_segments_api_spec.rb +0 -239
  54. data/spec/api/metrics_api_spec.rb +0 -96
  55. data/spec/api/profiles_api_spec.rb +0 -103
  56. data/spec/api/templates_api_spec.rb +0 -130
  57. data/spec/api/track_identify_api_spec.rb +0 -83
  58. data/spec/api_client_spec.rb +0 -226
  59. data/spec/configuration_spec.rb +0 -42
  60. data/spec/models/campaign_spec.rb +0 -94
  61. data/spec/models/check_membership_request_spec.rb +0 -46
  62. data/spec/models/delete_email_spec.rb +0 -34
  63. data/spec/models/delete_person_spec.rb +0 -34
  64. data/spec/models/delete_phone_spec.rb +0 -34
  65. data/spec/models/deprecated_get_list_response_data_spec.rb +0 -64
  66. data/spec/models/deprecated_get_list_response_spec.rb +0 -70
  67. data/spec/models/global_exclusion_response_data_spec.rb +0 -70
  68. data/spec/models/identify_payload_properties_spec.rb +0 -106
  69. data/spec/models/identify_payload_spec.rb +0 -40
  70. data/spec/models/inline_object3_spec.rb +0 -34
  71. data/spec/models/inline_object4_spec.rb +0 -34
  72. data/spec/models/inline_object5_spec.rb +0 -46
  73. data/spec/models/inline_object_spec.rb +0 -34
  74. data/spec/models/metric_export_spec.rb +0 -76
  75. data/spec/models/metric_spec.rb +0 -64
  76. data/spec/models/metric_timeline_data_spec.rb +0 -82
  77. data/spec/models/metric_timeline_spec.rb +0 -52
  78. data/spec/models/person_spec.rb +0 -148
  79. data/spec/models/privacy_email_spec.rb +0 -34
  80. data/spec/models/privacy_id_spec.rb +0 -34
  81. data/spec/models/privacy_phone_spec.rb +0 -34
  82. data/spec/models/rendered_template_spec.rb +0 -52
  83. data/spec/models/template_spec.rb +0 -70
  84. data/spec/models/track_payload_customer_properties_spec.rb +0 -40
  85. data/spec/models/track_payload_properties_spec.rb +0 -46
  86. data/spec/models/track_payload_spec.rb +0 -52
  87. data/spec/spec_helper.rb +0 -111
data/docs/ProfilesApi.md DELETED
@@ -1,391 +0,0 @@
1
- # Klaviyo::ProfilesApi
2
-
3
- All URIs are relative to *https://a.klaviyo.com/api*
4
-
5
- | Method | HTTP request | Description |
6
- | ------ | ------------ | ----------- |
7
- | [**exchange**](ProfilesApi.md#exchange) | **POST** /v2/people/exchange | Exchange ID for Profile ID |
8
- | [**get_profile**](ProfilesApi.md#get_profile) | **GET** /v1/person/{person_id} | Get Profile |
9
- | [**profile_metric_timeline**](ProfilesApi.md#profile_metric_timeline) | **GET** /v1/person/{person_id}/metric/{metric_id}/timeline | Get Profile's Events for a Specific Metric |
10
- | [**profile_metrics_timeline**](ProfilesApi.md#profile_metrics_timeline) | **GET** /v1/person/{person_id}/metrics/timeline | Get Profile's Events for all Metrics |
11
- | [**update_profile**](ProfilesApi.md#update_profile) | **PUT** /v1/person/{person_id} | Update Profile |
12
-
13
-
14
- ## exchange
15
-
16
- > Hash<String, Object> exchange(opts)
17
-
18
- Exchange ID for Profile ID
19
-
20
- Klaviyo's web tracking uses an encrypted identifier. However, there are many use cases that require developers to have access to a given profile's email or phone number. In such cases, developers can use this operation to exchange an encrypted identifier for a profile ID, which they can then use to retrieve the full profile data (by making a subsequent request to the `get-profiles` operation). The `exchange_id` takes the following form: `<IDENTIFIER>.<COMPANY_ID>` The `exchange_id` appears in the url as follows: `?_kx=<IDENTIFIER>.<COMPANY_ID>`
21
-
22
- ### Examples
23
-
24
- ```ruby
25
- require 'time'
26
- require 'klaviyo_sdk'
27
- # setup authorization
28
- Klaviyo.configure do |config|
29
- # Configure API key authorization: ApiKeyAuth
30
- config.api_key['ApiKeyAuth'] = 'YOUR API KEY'
31
- # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
32
- # config.api_key_prefix['ApiKeyAuth'] = 'Bearer'
33
- end
34
-
35
- api_instance = Klaviyo::ProfilesApi.new
36
- opts = {
37
- inline_object: Klaviyo::InlineObject.new({exchange_id: 'EXCHANGE_ID'}) # InlineObject |
38
- }
39
-
40
- begin
41
- # Exchange ID for Profile ID
42
- result = api_instance.exchange(opts)
43
- p result
44
- rescue Klaviyo::ApiError => e
45
- puts "Error when calling ProfilesApi->exchange: #{e}"
46
- end
47
- ```
48
-
49
- #### Using the exchange_with_http_info variant
50
-
51
- This returns an Array which contains the response data, status code and headers.
52
-
53
- > <Array(Hash&lt;String, Object&gt;, Integer, Hash)> exchange_with_http_info(opts)
54
-
55
- ```ruby
56
- begin
57
- # Exchange ID for Profile ID
58
- data, status_code, headers = api_instance.exchange_with_http_info(opts)
59
- p status_code # => 2xx
60
- p headers # => { ... }
61
- p data # => Hash&lt;String, Object&gt;
62
- rescue Klaviyo::ApiError => e
63
- puts "Error when calling ProfilesApi->exchange_with_http_info: #{e}"
64
- end
65
- ```
66
-
67
- ### Parameters
68
-
69
- | Name | Type | Description | Notes |
70
- | ---- | ---- | ----------- | ----- |
71
- | **inline_object** | [**InlineObject**](InlineObject.md) | | [optional] |
72
-
73
- ### Return type
74
-
75
- **Hash&lt;String, Object&gt;**
76
-
77
- ### Authorization
78
-
79
- [ApiKeyAuth](../README.md#ApiKeyAuth)
80
-
81
- ### HTTP request headers
82
-
83
- - **Content-Type**: application/json
84
- - **Accept**: application/json
85
-
86
-
87
- ## get_profile
88
-
89
- > <Person> get_profile(person_id)
90
-
91
- Get Profile
92
-
93
- Retrieves all the data attributes for a person, based on the Klaviyo Person ID.
94
-
95
- ### Examples
96
-
97
- ```ruby
98
- require 'time'
99
- require 'klaviyo_sdk'
100
- # setup authorization
101
- Klaviyo.configure do |config|
102
- # Configure API key authorization: ApiKeyAuth
103
- config.api_key['ApiKeyAuth'] = 'YOUR API KEY'
104
- # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
105
- # config.api_key_prefix['ApiKeyAuth'] = 'Bearer'
106
- end
107
-
108
- api_instance = Klaviyo::ProfilesApi.new
109
- person_id = 'PERSON_ID' # String |
110
-
111
- begin
112
- # Get Profile
113
- result = api_instance.get_profile(person_id)
114
- p result
115
- rescue Klaviyo::ApiError => e
116
- puts "Error when calling ProfilesApi->get_profile: #{e}"
117
- end
118
- ```
119
-
120
- #### Using the get_profile_with_http_info variant
121
-
122
- This returns an Array which contains the response data, status code and headers.
123
-
124
- > <Array(<Person>, Integer, Hash)> get_profile_with_http_info(person_id)
125
-
126
- ```ruby
127
- begin
128
- # Get Profile
129
- data, status_code, headers = api_instance.get_profile_with_http_info(person_id)
130
- p status_code # => 2xx
131
- p headers # => { ... }
132
- p data # => <Person>
133
- rescue Klaviyo::ApiError => e
134
- puts "Error when calling ProfilesApi->get_profile_with_http_info: #{e}"
135
- end
136
- ```
137
-
138
- ### Parameters
139
-
140
- | Name | Type | Description | Notes |
141
- | ---- | ---- | ----------- | ----- |
142
- | **person_id** | **String** | | [default to &#39;PERSON_ID&#39;] |
143
-
144
- ### Return type
145
-
146
- [**Person**](Person.md)
147
-
148
- ### Authorization
149
-
150
- [ApiKeyAuth](../README.md#ApiKeyAuth)
151
-
152
- ### HTTP request headers
153
-
154
- - **Content-Type**: Not defined
155
- - **Accept**: application/json
156
-
157
-
158
- ## profile_metric_timeline
159
-
160
- > <MetricTimeline> profile_metric_timeline(person_id, metric_id, opts)
161
-
162
- Get Profile's Events for a Specific Metric
163
-
164
- Returns a person's batched timeline for one specific event type.
165
-
166
- ### Examples
167
-
168
- ```ruby
169
- require 'time'
170
- require 'klaviyo_sdk'
171
- # setup authorization
172
- Klaviyo.configure do |config|
173
- # Configure API key authorization: ApiKeyAuth
174
- config.api_key['ApiKeyAuth'] = 'YOUR API KEY'
175
- # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
176
- # config.api_key_prefix['ApiKeyAuth'] = 'Bearer'
177
- end
178
-
179
- api_instance = Klaviyo::ProfilesApi.new
180
- person_id = 'PERSON_ID' # String |
181
- metric_id = 'METRIC_ID' # String |
182
- opts = {
183
- since: 'since_example', # String | Either a 10-digit Unix timestamp (UTC) to use as starting datetime, OR a pagination token obtained from the next attribute of a prior API call. For backwards compatibility, UUIDs will continue to be supported for a limited time. Defaults to current time.
184
- count: 100, # Integer | Number of events to return in a batch.
185
- sort: 'desc' # String | Sort order to apply to timeline, either descending or ascending. Valid values are `desc` or `asc`. Defaults to `desc`.
186
- }
187
-
188
- begin
189
- # Get Profile's Events for a Specific Metric
190
- result = api_instance.profile_metric_timeline(person_id, metric_id, opts)
191
- p result
192
- rescue Klaviyo::ApiError => e
193
- puts "Error when calling ProfilesApi->profile_metric_timeline: #{e}"
194
- end
195
- ```
196
-
197
- #### Using the profile_metric_timeline_with_http_info variant
198
-
199
- This returns an Array which contains the response data, status code and headers.
200
-
201
- > <Array(<MetricTimeline>, Integer, Hash)> profile_metric_timeline_with_http_info(person_id, metric_id, opts)
202
-
203
- ```ruby
204
- begin
205
- # Get Profile's Events for a Specific Metric
206
- data, status_code, headers = api_instance.profile_metric_timeline_with_http_info(person_id, metric_id, opts)
207
- p status_code # => 2xx
208
- p headers # => { ... }
209
- p data # => <MetricTimeline>
210
- rescue Klaviyo::ApiError => e
211
- puts "Error when calling ProfilesApi->profile_metric_timeline_with_http_info: #{e}"
212
- end
213
- ```
214
-
215
- ### Parameters
216
-
217
- | Name | Type | Description | Notes |
218
- | ---- | ---- | ----------- | ----- |
219
- | **person_id** | **String** | | [default to &#39;PERSON_ID&#39;] |
220
- | **metric_id** | **String** | | [default to &#39;METRIC_ID&#39;] |
221
- | **since** | **String** | Either a 10-digit Unix timestamp (UTC) to use as starting datetime, OR a pagination token obtained from the next attribute of a prior API call. For backwards compatibility, UUIDs will continue to be supported for a limited time. Defaults to current time. | [optional] |
222
- | **count** | **Integer** | Number of events to return in a batch. | [optional][default to 50] |
223
- | **sort** | **String** | Sort order to apply to timeline, either descending or ascending. Valid values are &#x60;desc&#x60; or &#x60;asc&#x60;. Defaults to &#x60;desc&#x60;. | [optional][default to &#39;desc&#39;] |
224
-
225
- ### Return type
226
-
227
- [**MetricTimeline**](MetricTimeline.md)
228
-
229
- ### Authorization
230
-
231
- [ApiKeyAuth](../README.md#ApiKeyAuth)
232
-
233
- ### HTTP request headers
234
-
235
- - **Content-Type**: Not defined
236
- - **Accept**: application/json
237
-
238
-
239
- ## profile_metrics_timeline
240
-
241
- > <MetricTimeline> profile_metrics_timeline(person_id, opts)
242
-
243
- Get Profile's Events for all Metrics
244
-
245
- Returns a batched timeline of all events for a person.
246
-
247
- ### Examples
248
-
249
- ```ruby
250
- require 'time'
251
- require 'klaviyo_sdk'
252
- # setup authorization
253
- Klaviyo.configure do |config|
254
- # Configure API key authorization: ApiKeyAuth
255
- config.api_key['ApiKeyAuth'] = 'YOUR API KEY'
256
- # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
257
- # config.api_key_prefix['ApiKeyAuth'] = 'Bearer'
258
- end
259
-
260
- api_instance = Klaviyo::ProfilesApi.new
261
- person_id = 'PERSON_ID' # String |
262
- opts = {
263
- since: 'since_example', # String | Either a 10-digit Unix timestamp (UTC) to use as starting datetime, OR a pagination token obtained from the next attribute of a prior API call. For backwards compatibility, UUIDs will continue to be supported for a limited time. Defaults to current time.
264
- count: 50, # Integer | Number of events to return in a batch. Default = 50, Max = 100
265
- sort: 'desc' # String | Sort order to apply to timeline, either descending or ascending. Valid values are `desc` or `asc`. Defaults to `desc`. Always descending when `since` is not sent, as `since` defaults to current time.
266
- }
267
-
268
- begin
269
- # Get Profile's Events for all Metrics
270
- result = api_instance.profile_metrics_timeline(person_id, opts)
271
- p result
272
- rescue Klaviyo::ApiError => e
273
- puts "Error when calling ProfilesApi->profile_metrics_timeline: #{e}"
274
- end
275
- ```
276
-
277
- #### Using the profile_metrics_timeline_with_http_info variant
278
-
279
- This returns an Array which contains the response data, status code and headers.
280
-
281
- > <Array(<MetricTimeline>, Integer, Hash)> profile_metrics_timeline_with_http_info(person_id, opts)
282
-
283
- ```ruby
284
- begin
285
- # Get Profile's Events for all Metrics
286
- data, status_code, headers = api_instance.profile_metrics_timeline_with_http_info(person_id, opts)
287
- p status_code # => 2xx
288
- p headers # => { ... }
289
- p data # => <MetricTimeline>
290
- rescue Klaviyo::ApiError => e
291
- puts "Error when calling ProfilesApi->profile_metrics_timeline_with_http_info: #{e}"
292
- end
293
- ```
294
-
295
- ### Parameters
296
-
297
- | Name | Type | Description | Notes |
298
- | ---- | ---- | ----------- | ----- |
299
- | **person_id** | **String** | | [default to &#39;PERSON_ID&#39;] |
300
- | **since** | **String** | Either a 10-digit Unix timestamp (UTC) to use as starting datetime, OR a pagination token obtained from the next attribute of a prior API call. For backwards compatibility, UUIDs will continue to be supported for a limited time. Defaults to current time. | [optional] |
301
- | **count** | **Integer** | Number of events to return in a batch. Default &#x3D; 50, Max &#x3D; 100 | [optional][default to 50] |
302
- | **sort** | **String** | Sort order to apply to timeline, either descending or ascending. Valid values are &#x60;desc&#x60; or &#x60;asc&#x60;. Defaults to &#x60;desc&#x60;. Always descending when &#x60;since&#x60; is not sent, as &#x60;since&#x60; defaults to current time. | [optional][default to &#39;desc&#39;] |
303
-
304
- ### Return type
305
-
306
- [**MetricTimeline**](MetricTimeline.md)
307
-
308
- ### Authorization
309
-
310
- [ApiKeyAuth](../README.md#ApiKeyAuth)
311
-
312
- ### HTTP request headers
313
-
314
- - **Content-Type**: Not defined
315
- - **Accept**: application/json
316
-
317
-
318
- ## update_profile
319
-
320
- > <Person> update_profile(person_id, opts)
321
-
322
- Update Profile
323
-
324
- NOTE: If you are interested in creating or updating profiles in Klaviyo, you should be using the Identify API instead. The best use-case for this route is changing a profiles's email address or other primary identifier after a profile already exists in Klaviyo. Add or update one more more attributes for a Person, based on the Klaviyo Person ID. If a property already exists, it will be updated. If a property is not set for that record, it will be created. You can update any attribute, by sending one or more attributes along their new values, as query parameters. Recommended attributes for this endpoint: `$email`, `$phone_number`, `$id`
325
-
326
- ### Examples
327
-
328
- ```ruby
329
- require 'time'
330
- require 'klaviyo_sdk'
331
- # setup authorization
332
- Klaviyo.configure do |config|
333
- # Configure API key authorization: ApiKeyAuth
334
- config.api_key['ApiKeyAuth'] = 'YOUR API KEY'
335
- # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
336
- # config.api_key_prefix['ApiKeyAuth'] = 'Bearer'
337
- end
338
-
339
- api_instance = Klaviyo::ProfilesApi.new
340
- person_id = 'PERSON_ID' # String |
341
- opts = {
342
- params: { key: 3.56} # Hash<String, Object> |
343
- }
344
-
345
- begin
346
- # Update Profile
347
- result = api_instance.update_profile(person_id, opts)
348
- p result
349
- rescue Klaviyo::ApiError => e
350
- puts "Error when calling ProfilesApi->update_profile: #{e}"
351
- end
352
- ```
353
-
354
- #### Using the update_profile_with_http_info variant
355
-
356
- This returns an Array which contains the response data, status code and headers.
357
-
358
- > <Array(<Person>, Integer, Hash)> update_profile_with_http_info(person_id, opts)
359
-
360
- ```ruby
361
- begin
362
- # Update Profile
363
- data, status_code, headers = api_instance.update_profile_with_http_info(person_id, opts)
364
- p status_code # => 2xx
365
- p headers # => { ... }
366
- p data # => <Person>
367
- rescue Klaviyo::ApiError => e
368
- puts "Error when calling ProfilesApi->update_profile_with_http_info: #{e}"
369
- end
370
- ```
371
-
372
- ### Parameters
373
-
374
- | Name | Type | Description | Notes |
375
- | ---- | ---- | ----------- | ----- |
376
- | **person_id** | **String** | | [default to &#39;PERSON_ID&#39;] |
377
- | **params** | [**Hash&lt;String, Object&gt;**](Object.md) | | [optional] |
378
-
379
- ### Return type
380
-
381
- [**Person**](Person.md)
382
-
383
- ### Authorization
384
-
385
- [ApiKeyAuth](../README.md#ApiKeyAuth)
386
-
387
- ### HTTP request headers
388
-
389
- - **Content-Type**: Not defined
390
- - **Accept**: application/json
391
-
@@ -1,24 +0,0 @@
1
- # Klaviyo::RenderedTemplate
2
-
3
- ## Properties
4
-
5
- | Name | Type | Description | Notes |
6
- | ---- | ---- | ----------- | ----- |
7
- | **object** | **String** | | [optional] |
8
- | **id** | **String** | | [optional] |
9
- | **name** | **String** | | [optional] |
10
- | **data** | **Hash&lt;String, Object&gt;** | | [optional] |
11
-
12
- ## Example
13
-
14
- ```ruby
15
- require 'klaviyo_sdk'
16
-
17
- instance = Klaviyo::RenderedTemplate.new(
18
- object: email-template,
19
- id: TEMPLATE_ID,
20
- name: My Cloned Template,
21
- data: null
22
- )
23
- ```
24
-
data/docs/Template.md DELETED
@@ -1,30 +0,0 @@
1
- # Klaviyo::Template
2
-
3
- ## Properties
4
-
5
- | Name | Type | Description | Notes |
6
- | ---- | ---- | ----------- | ----- |
7
- | **object** | **String** | | [optional] |
8
- | **id** | **String** | | [optional] |
9
- | **name** | **String** | | [optional] |
10
- | **html** | **String** | | [optional] |
11
- | **is_writeable** | **Boolean** | | [optional] |
12
- | **created** | **String** | | [optional] |
13
- | **updated** | **String** | | [optional] |
14
-
15
- ## Example
16
-
17
- ```ruby
18
- require 'klaviyo_sdk'
19
-
20
- instance = Klaviyo::Template.new(
21
- object: email-template,
22
- id: TEMPLATE_ID,
23
- name: TEMPLATE_NAME,
24
- html: HTML_STRING,
25
- is_writeable: true,
26
- created: TEMPLATE_NAME,
27
- updated: TEMPLATE_NAME
28
- )
29
- ```
30
-