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/CampaignsApi.md DELETED
@@ -1,707 +0,0 @@
1
- # Klaviyo::CampaignsApi
2
-
3
- All URIs are relative to *https://a.klaviyo.com/api*
4
-
5
- | Method | HTTP request | Description |
6
- | ------ | ------------ | ----------- |
7
- | [**cancel_campaign**](CampaignsApi.md#cancel_campaign) | **POST** /v1/campaign/{campaign_id}/cancel | Cancel a Campaign |
8
- | [**clone_campaign**](CampaignsApi.md#clone_campaign) | **POST** /v1/campaign/{campaign_id}/clone | Clone a Campaign |
9
- | [**create_campaign**](CampaignsApi.md#create_campaign) | **POST** /v1/campaigns | Create New Campaign |
10
- | [**get_campaign_info**](CampaignsApi.md#get_campaign_info) | **GET** /v1/campaign/{campaign_id} | Get Campaign Info |
11
- | [**get_campaign_recipients**](CampaignsApi.md#get_campaign_recipients) | **GET** /v1/campaign/{campaign_id}/recipients | Get Campaign Recipients |
12
- | [**get_campaigns**](CampaignsApi.md#get_campaigns) | **GET** /v1/campaigns | Get Campaigns |
13
- | [**schedule_campaign**](CampaignsApi.md#schedule_campaign) | **POST** /v1/campaign/{campaign_id}/schedule | Schedule a Campaign |
14
- | [**send_campaign**](CampaignsApi.md#send_campaign) | **POST** /v1/campaign/{campaign_id}/send | Send a Campaign Immediately |
15
- | [**update_campaign**](CampaignsApi.md#update_campaign) | **PUT** /v1/campaign/{campaign_id} | Update Campaign |
16
-
17
-
18
- ## cancel_campaign
19
-
20
- > <Campaign> cancel_campaign(campaign_id)
21
-
22
- Cancel a Campaign
23
-
24
- Cancels a campaign send. Marks a campaign as cancelled regardless of it's current status.
25
-
26
- ### Examples
27
-
28
- ```ruby
29
- require 'time'
30
- require 'klaviyo_sdk'
31
- # setup authorization
32
- Klaviyo.configure do |config|
33
- # Configure API key authorization: ApiKeyAuth
34
- config.api_key['ApiKeyAuth'] = 'YOUR API KEY'
35
- # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
36
- # config.api_key_prefix['ApiKeyAuth'] = 'Bearer'
37
- end
38
-
39
- api_instance = Klaviyo::CampaignsApi.new
40
- campaign_id = 'CAMPAIGN_ID' # String |
41
-
42
- begin
43
- # Cancel a Campaign
44
- result = api_instance.cancel_campaign(campaign_id)
45
- p result
46
- rescue Klaviyo::ApiError => e
47
- puts "Error when calling CampaignsApi->cancel_campaign: #{e}"
48
- end
49
- ```
50
-
51
- #### Using the cancel_campaign_with_http_info variant
52
-
53
- This returns an Array which contains the response data, status code and headers.
54
-
55
- > <Array(<Campaign>, Integer, Hash)> cancel_campaign_with_http_info(campaign_id)
56
-
57
- ```ruby
58
- begin
59
- # Cancel a Campaign
60
- data, status_code, headers = api_instance.cancel_campaign_with_http_info(campaign_id)
61
- p status_code # => 2xx
62
- p headers # => { ... }
63
- p data # => <Campaign>
64
- rescue Klaviyo::ApiError => e
65
- puts "Error when calling CampaignsApi->cancel_campaign_with_http_info: #{e}"
66
- end
67
- ```
68
-
69
- ### Parameters
70
-
71
- | Name | Type | Description | Notes |
72
- | ---- | ---- | ----------- | ----- |
73
- | **campaign_id** | **String** | | [default to &#39;CAMPAIGN_ID&#39;] |
74
-
75
- ### Return type
76
-
77
- [**Campaign**](Campaign.md)
78
-
79
- ### Authorization
80
-
81
- [ApiKeyAuth](../README.md#ApiKeyAuth)
82
-
83
- ### HTTP request headers
84
-
85
- - **Content-Type**: Not defined
86
- - **Accept**: application/json
87
-
88
-
89
- ## clone_campaign
90
-
91
- > <Campaign> clone_campaign(campaign_id, name, list_id)
92
-
93
- Clone a Campaign
94
-
95
- Creates a copy of a campaign. The new campaign starts as a draft.
96
-
97
- ### Examples
98
-
99
- ```ruby
100
- require 'time'
101
- require 'klaviyo_sdk'
102
- # setup authorization
103
- Klaviyo.configure do |config|
104
- # Configure API key authorization: ApiKeyAuth
105
- config.api_key['ApiKeyAuth'] = 'YOUR API KEY'
106
- # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
107
- # config.api_key_prefix['ApiKeyAuth'] = 'Bearer'
108
- end
109
-
110
- api_instance = Klaviyo::CampaignsApi.new
111
- campaign_id = 'CAMPAIGN_ID' # String |
112
- name = 'name_example' # String | The name for the new campaign. All other properties of the campaign will remain the same. Note, the template for the new campaign will be cloned from the existing template so changes to the existing campaign's content will not alter the content of the new campaign.
113
- list_id = 'list_id_example' # String | The list you will send the campaign to.
114
-
115
- begin
116
- # Clone a Campaign
117
- result = api_instance.clone_campaign(campaign_id, name, list_id)
118
- p result
119
- rescue Klaviyo::ApiError => e
120
- puts "Error when calling CampaignsApi->clone_campaign: #{e}"
121
- end
122
- ```
123
-
124
- #### Using the clone_campaign_with_http_info variant
125
-
126
- This returns an Array which contains the response data, status code and headers.
127
-
128
- > <Array(<Campaign>, Integer, Hash)> clone_campaign_with_http_info(campaign_id, name, list_id)
129
-
130
- ```ruby
131
- begin
132
- # Clone a Campaign
133
- data, status_code, headers = api_instance.clone_campaign_with_http_info(campaign_id, name, list_id)
134
- p status_code # => 2xx
135
- p headers # => { ... }
136
- p data # => <Campaign>
137
- rescue Klaviyo::ApiError => e
138
- puts "Error when calling CampaignsApi->clone_campaign_with_http_info: #{e}"
139
- end
140
- ```
141
-
142
- ### Parameters
143
-
144
- | Name | Type | Description | Notes |
145
- | ---- | ---- | ----------- | ----- |
146
- | **campaign_id** | **String** | | [default to &#39;CAMPAIGN_ID&#39;] |
147
- | **name** | **String** | The name for the new campaign. All other properties of the campaign will remain the same. Note, the template for the new campaign will be cloned from the existing template so changes to the existing campaign&#39;s content will not alter the content of the new campaign. | [default to &#39;Cloned Campaign&#39;] |
148
- | **list_id** | **String** | The list you will send the campaign to. | [default to &#39;LIST_ID&#39;] |
149
-
150
- ### Return type
151
-
152
- [**Campaign**](Campaign.md)
153
-
154
- ### Authorization
155
-
156
- [ApiKeyAuth](../README.md#ApiKeyAuth)
157
-
158
- ### HTTP request headers
159
-
160
- - **Content-Type**: application/x-www-form-urlencoded
161
- - **Accept**: application/json
162
-
163
-
164
- ## create_campaign
165
-
166
- > <Campaign> create_campaign(list_id, template_id, from_email, from_name, subject, opts)
167
-
168
- Create New Campaign
169
-
170
- Creates a new campaign. The created campaign is a draft and is not automatically sent.
171
-
172
- ### Examples
173
-
174
- ```ruby
175
- require 'time'
176
- require 'klaviyo_sdk'
177
- # setup authorization
178
- Klaviyo.configure do |config|
179
- # Configure API key authorization: ApiKeyAuth
180
- config.api_key['ApiKeyAuth'] = 'YOUR API KEY'
181
- # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
182
- # config.api_key_prefix['ApiKeyAuth'] = 'Bearer'
183
- end
184
-
185
- api_instance = Klaviyo::CampaignsApi.new
186
- list_id = 'list_id_example' # String | The list you will send the campaign to.
187
- template_id = 'template_id_example' # String | The template that will define the content of the page. Note: the Email Template is copied when creating this campaign, so future changes to that Email Template will not alter the content of this campaign.
188
- from_email = 'from_email_example' # String | The email address your email will be sent from and will be used in the `reply-to` header.
189
- from_name = 'from_name_example' # String | The name or label associated with the email address you're sending from.
190
- subject = 'subject_example' # String | The email subject of the campaign
191
- opts = {
192
- name: 'name_example', # String | If not specified, this will default to the subject of the campaign.
193
- use_smart_sending: true, # Boolean | If set, limits the number of emails sent to an individual within a short period. Valid values are `true` and `false`. If not specified, defaults to `true`.
194
- add_google_analytics: true # Boolean | If specified, adds Google Analytics tracking tags to links. Valid values are `true` and `false`. If not specified, defaults to `false`.
195
- }
196
-
197
- begin
198
- # Create New Campaign
199
- result = api_instance.create_campaign(list_id, template_id, from_email, from_name, subject, opts)
200
- p result
201
- rescue Klaviyo::ApiError => e
202
- puts "Error when calling CampaignsApi->create_campaign: #{e}"
203
- end
204
- ```
205
-
206
- #### Using the create_campaign_with_http_info variant
207
-
208
- This returns an Array which contains the response data, status code and headers.
209
-
210
- > <Array(<Campaign>, Integer, Hash)> create_campaign_with_http_info(list_id, template_id, from_email, from_name, subject, opts)
211
-
212
- ```ruby
213
- begin
214
- # Create New Campaign
215
- data, status_code, headers = api_instance.create_campaign_with_http_info(list_id, template_id, from_email, from_name, subject, opts)
216
- p status_code # => 2xx
217
- p headers # => { ... }
218
- p data # => <Campaign>
219
- rescue Klaviyo::ApiError => e
220
- puts "Error when calling CampaignsApi->create_campaign_with_http_info: #{e}"
221
- end
222
- ```
223
-
224
- ### Parameters
225
-
226
- | Name | Type | Description | Notes |
227
- | ---- | ---- | ----------- | ----- |
228
- | **list_id** | **String** | The list you will send the campaign to. | [default to &#39;LIST_ID&#39;] |
229
- | **template_id** | **String** | The template that will define the content of the page. Note: the Email Template is copied when creating this campaign, so future changes to that Email Template will not alter the content of this campaign. | [default to &#39;TEMPLATE_ID&#39;] |
230
- | **from_email** | **String** | The email address your email will be sent from and will be used in the &#x60;reply-to&#x60; header. | [default to &#39;george.washington@klaviyo.com&#39;] |
231
- | **from_name** | **String** | The name or label associated with the email address you&#39;re sending from. | [default to &#39;George Washington&#39;] |
232
- | **subject** | **String** | The email subject of the campaign | [default to &#39;Happy Fourth!&#39;] |
233
- | **name** | **String** | If not specified, this will default to the subject of the campaign. | [optional][default to &#39;Campaign Name&#39;] |
234
- | **use_smart_sending** | **Boolean** | If set, limits the number of emails sent to an individual within a short period. Valid values are &#x60;true&#x60; and &#x60;false&#x60;. If not specified, defaults to &#x60;true&#x60;. | [optional][default to true] |
235
- | **add_google_analytics** | **Boolean** | If specified, adds Google Analytics tracking tags to links. Valid values are &#x60;true&#x60; and &#x60;false&#x60;. If not specified, defaults to &#x60;false&#x60;. | [optional][default to false] |
236
-
237
- ### Return type
238
-
239
- [**Campaign**](Campaign.md)
240
-
241
- ### Authorization
242
-
243
- [ApiKeyAuth](../README.md#ApiKeyAuth)
244
-
245
- ### HTTP request headers
246
-
247
- - **Content-Type**: application/x-www-form-urlencoded
248
- - **Accept**: application/json
249
-
250
-
251
- ## get_campaign_info
252
-
253
- > <Campaign> get_campaign_info(campaign_id)
254
-
255
- Get Campaign Info
256
-
257
- Returns summary information for the campaign specified.
258
-
259
- ### Examples
260
-
261
- ```ruby
262
- require 'time'
263
- require 'klaviyo_sdk'
264
- # setup authorization
265
- Klaviyo.configure do |config|
266
- # Configure API key authorization: ApiKeyAuth
267
- config.api_key['ApiKeyAuth'] = 'YOUR API KEY'
268
- # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
269
- # config.api_key_prefix['ApiKeyAuth'] = 'Bearer'
270
- end
271
-
272
- api_instance = Klaviyo::CampaignsApi.new
273
- campaign_id = 'CAMPAIGN_ID' # String |
274
-
275
- begin
276
- # Get Campaign Info
277
- result = api_instance.get_campaign_info(campaign_id)
278
- p result
279
- rescue Klaviyo::ApiError => e
280
- puts "Error when calling CampaignsApi->get_campaign_info: #{e}"
281
- end
282
- ```
283
-
284
- #### Using the get_campaign_info_with_http_info variant
285
-
286
- This returns an Array which contains the response data, status code and headers.
287
-
288
- > <Array(<Campaign>, Integer, Hash)> get_campaign_info_with_http_info(campaign_id)
289
-
290
- ```ruby
291
- begin
292
- # Get Campaign Info
293
- data, status_code, headers = api_instance.get_campaign_info_with_http_info(campaign_id)
294
- p status_code # => 2xx
295
- p headers # => { ... }
296
- p data # => <Campaign>
297
- rescue Klaviyo::ApiError => e
298
- puts "Error when calling CampaignsApi->get_campaign_info_with_http_info: #{e}"
299
- end
300
- ```
301
-
302
- ### Parameters
303
-
304
- | Name | Type | Description | Notes |
305
- | ---- | ---- | ----------- | ----- |
306
- | **campaign_id** | **String** | | [default to &#39;CAMPAIGN_ID&#39;] |
307
-
308
- ### Return type
309
-
310
- [**Campaign**](Campaign.md)
311
-
312
- ### Authorization
313
-
314
- [ApiKeyAuth](../README.md#ApiKeyAuth)
315
-
316
- ### HTTP request headers
317
-
318
- - **Content-Type**: Not defined
319
- - **Accept**: application/json
320
-
321
-
322
- ## get_campaign_recipients
323
-
324
- > Hash&lt;String, Object&gt; get_campaign_recipients(campaign_id, opts)
325
-
326
- Get Campaign Recipients
327
-
328
- Returns summary information about email recipients for the campaign specified that includes each recipients email, customer ID, and status.
329
-
330
- ### Examples
331
-
332
- ```ruby
333
- require 'time'
334
- require 'klaviyo_sdk'
335
- # setup authorization
336
- Klaviyo.configure do |config|
337
- # Configure API key authorization: ApiKeyAuth
338
- config.api_key['ApiKeyAuth'] = 'YOUR API KEY'
339
- # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
340
- # config.api_key_prefix['ApiKeyAuth'] = 'Bearer'
341
- end
342
-
343
- api_instance = Klaviyo::CampaignsApi.new
344
- campaign_id = 'CAMPAIGN_ID' # String |
345
- opts = {
346
- count: 25000, # Integer | For pagination, the number of results to return. Max = 25,000
347
- sort: 'asc', # String | Sort order to apply to results, either ascending or descending. Valid values are `asc` or `desc`. Defaults to `asc`.
348
- offset: 'next_offset' # String | For pagination, if a response to this endpoint includes a `next_offset`, use that value to get the next page of recipients.
349
- }
350
-
351
- begin
352
- # Get Campaign Recipients
353
- result = api_instance.get_campaign_recipients(campaign_id, opts)
354
- p result
355
- rescue Klaviyo::ApiError => e
356
- puts "Error when calling CampaignsApi->get_campaign_recipients: #{e}"
357
- end
358
- ```
359
-
360
- #### Using the get_campaign_recipients_with_http_info variant
361
-
362
- This returns an Array which contains the response data, status code and headers.
363
-
364
- > <Array(Hash&lt;String, Object&gt;, Integer, Hash)> get_campaign_recipients_with_http_info(campaign_id, opts)
365
-
366
- ```ruby
367
- begin
368
- # Get Campaign Recipients
369
- data, status_code, headers = api_instance.get_campaign_recipients_with_http_info(campaign_id, opts)
370
- p status_code # => 2xx
371
- p headers # => { ... }
372
- p data # => Hash&lt;String, Object&gt;
373
- rescue Klaviyo::ApiError => e
374
- puts "Error when calling CampaignsApi->get_campaign_recipients_with_http_info: #{e}"
375
- end
376
- ```
377
-
378
- ### Parameters
379
-
380
- | Name | Type | Description | Notes |
381
- | ---- | ---- | ----------- | ----- |
382
- | **campaign_id** | **String** | | [default to &#39;CAMPAIGN_ID&#39;] |
383
- | **count** | **Integer** | For pagination, the number of results to return. Max &#x3D; 25,000 | [optional][default to 5000] |
384
- | **sort** | **String** | Sort order to apply to results, either ascending or descending. Valid values are &#x60;asc&#x60; or &#x60;desc&#x60;. Defaults to &#x60;asc&#x60;. | [optional][default to &#39;asc&#39;] |
385
- | **offset** | **String** | For pagination, if a response to this endpoint includes a &#x60;next_offset&#x60;, use that value to get the next page of recipients. | [optional] |
386
-
387
- ### Return type
388
-
389
- **Hash&lt;String, Object&gt;**
390
-
391
- ### Authorization
392
-
393
- [ApiKeyAuth](../README.md#ApiKeyAuth)
394
-
395
- ### HTTP request headers
396
-
397
- - **Content-Type**: Not defined
398
- - **Accept**: application/json
399
-
400
-
401
- ## get_campaigns
402
-
403
- > Hash&lt;String, Object&gt; get_campaigns(opts)
404
-
405
- Get Campaigns
406
-
407
- Returns a list of all the campaigns you've created. The campaigns are returned in reverse sorted order by the time they were created.
408
-
409
- ### Examples
410
-
411
- ```ruby
412
- require 'time'
413
- require 'klaviyo_sdk'
414
- # setup authorization
415
- Klaviyo.configure do |config|
416
- # Configure API key authorization: ApiKeyAuth
417
- config.api_key['ApiKeyAuth'] = 'YOUR API KEY'
418
- # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
419
- # config.api_key_prefix['ApiKeyAuth'] = 'Bearer'
420
- end
421
-
422
- api_instance = Klaviyo::CampaignsApi.new
423
- opts = {
424
- page: 0, # Integer | For pagination, which page of results to return. Default = 0
425
- count: 100 # Integer | For pagination, the number of results to return. Max = 100
426
- }
427
-
428
- begin
429
- # Get Campaigns
430
- result = api_instance.get_campaigns(opts)
431
- p result
432
- rescue Klaviyo::ApiError => e
433
- puts "Error when calling CampaignsApi->get_campaigns: #{e}"
434
- end
435
- ```
436
-
437
- #### Using the get_campaigns_with_http_info variant
438
-
439
- This returns an Array which contains the response data, status code and headers.
440
-
441
- > <Array(Hash&lt;String, Object&gt;, Integer, Hash)> get_campaigns_with_http_info(opts)
442
-
443
- ```ruby
444
- begin
445
- # Get Campaigns
446
- data, status_code, headers = api_instance.get_campaigns_with_http_info(opts)
447
- p status_code # => 2xx
448
- p headers # => { ... }
449
- p data # => Hash&lt;String, Object&gt;
450
- rescue Klaviyo::ApiError => e
451
- puts "Error when calling CampaignsApi->get_campaigns_with_http_info: #{e}"
452
- end
453
- ```
454
-
455
- ### Parameters
456
-
457
- | Name | Type | Description | Notes |
458
- | ---- | ---- | ----------- | ----- |
459
- | **page** | **Integer** | For pagination, which page of results to return. Default &#x3D; 0 | [optional][default to 0] |
460
- | **count** | **Integer** | For pagination, the number of results to return. Max &#x3D; 100 | [optional][default to 50] |
461
-
462
- ### Return type
463
-
464
- **Hash&lt;String, Object&gt;**
465
-
466
- ### Authorization
467
-
468
- [ApiKeyAuth](../README.md#ApiKeyAuth)
469
-
470
- ### HTTP request headers
471
-
472
- - **Content-Type**: Not defined
473
- - **Accept**: application/json
474
-
475
-
476
- ## schedule_campaign
477
-
478
- > Hash&lt;String, Object&gt; schedule_campaign(campaign_id, send_time)
479
-
480
- Schedule a Campaign
481
-
482
- Schedules a campaign for a time in the future
483
-
484
- ### Examples
485
-
486
- ```ruby
487
- require 'time'
488
- require 'klaviyo_sdk'
489
- # setup authorization
490
- Klaviyo.configure do |config|
491
- # Configure API key authorization: ApiKeyAuth
492
- config.api_key['ApiKeyAuth'] = 'YOUR API KEY'
493
- # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
494
- # config.api_key_prefix['ApiKeyAuth'] = 'Bearer'
495
- end
496
-
497
- api_instance = Klaviyo::CampaignsApi.new
498
- campaign_id = 'CAMPAIGN_ID' # String |
499
- send_time = 'send_time_example' # String | A timestamp of the format `%Y-%m-%d %H:%M:%S` in the UTC timezone. Ex: `2022-01-13 00:00:00`
500
-
501
- begin
502
- # Schedule a Campaign
503
- result = api_instance.schedule_campaign(campaign_id, send_time)
504
- p result
505
- rescue Klaviyo::ApiError => e
506
- puts "Error when calling CampaignsApi->schedule_campaign: #{e}"
507
- end
508
- ```
509
-
510
- #### Using the schedule_campaign_with_http_info variant
511
-
512
- This returns an Array which contains the response data, status code and headers.
513
-
514
- > <Array(Hash&lt;String, Object&gt;, Integer, Hash)> schedule_campaign_with_http_info(campaign_id, send_time)
515
-
516
- ```ruby
517
- begin
518
- # Schedule a Campaign
519
- data, status_code, headers = api_instance.schedule_campaign_with_http_info(campaign_id, send_time)
520
- p status_code # => 2xx
521
- p headers # => { ... }
522
- p data # => Hash&lt;String, Object&gt;
523
- rescue Klaviyo::ApiError => e
524
- puts "Error when calling CampaignsApi->schedule_campaign_with_http_info: #{e}"
525
- end
526
- ```
527
-
528
- ### Parameters
529
-
530
- | Name | Type | Description | Notes |
531
- | ---- | ---- | ----------- | ----- |
532
- | **campaign_id** | **String** | | [default to &#39;CAMPAIGN_ID&#39;] |
533
- | **send_time** | **String** | A timestamp of the format &#x60;%Y-%m-%d %H:%M:%S&#x60; in the UTC timezone. Ex: &#x60;2022-01-13 00:00:00&#x60; | [default to &#39;2022-01-13 00:00:00&#39;] |
534
-
535
- ### Return type
536
-
537
- **Hash&lt;String, Object&gt;**
538
-
539
- ### Authorization
540
-
541
- [ApiKeyAuth](../README.md#ApiKeyAuth)
542
-
543
- ### HTTP request headers
544
-
545
- - **Content-Type**: application/x-www-form-urlencoded
546
- - **Accept**: application/json
547
-
548
-
549
- ## send_campaign
550
-
551
- > Hash&lt;String, Object&gt; send_campaign(campaign_id)
552
-
553
- Send a Campaign Immediately
554
-
555
- Queues a campaign for immediate delivery
556
-
557
- ### Examples
558
-
559
- ```ruby
560
- require 'time'
561
- require 'klaviyo_sdk'
562
- # setup authorization
563
- Klaviyo.configure do |config|
564
- # Configure API key authorization: ApiKeyAuth
565
- config.api_key['ApiKeyAuth'] = 'YOUR API KEY'
566
- # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
567
- # config.api_key_prefix['ApiKeyAuth'] = 'Bearer'
568
- end
569
-
570
- api_instance = Klaviyo::CampaignsApi.new
571
- campaign_id = 'CAMPAIGN_ID' # String |
572
-
573
- begin
574
- # Send a Campaign Immediately
575
- result = api_instance.send_campaign(campaign_id)
576
- p result
577
- rescue Klaviyo::ApiError => e
578
- puts "Error when calling CampaignsApi->send_campaign: #{e}"
579
- end
580
- ```
581
-
582
- #### Using the send_campaign_with_http_info variant
583
-
584
- This returns an Array which contains the response data, status code and headers.
585
-
586
- > <Array(Hash&lt;String, Object&gt;, Integer, Hash)> send_campaign_with_http_info(campaign_id)
587
-
588
- ```ruby
589
- begin
590
- # Send a Campaign Immediately
591
- data, status_code, headers = api_instance.send_campaign_with_http_info(campaign_id)
592
- p status_code # => 2xx
593
- p headers # => { ... }
594
- p data # => Hash&lt;String, Object&gt;
595
- rescue Klaviyo::ApiError => e
596
- puts "Error when calling CampaignsApi->send_campaign_with_http_info: #{e}"
597
- end
598
- ```
599
-
600
- ### Parameters
601
-
602
- | Name | Type | Description | Notes |
603
- | ---- | ---- | ----------- | ----- |
604
- | **campaign_id** | **String** | | [default to &#39;CAMPAIGN_ID&#39;] |
605
-
606
- ### Return type
607
-
608
- **Hash&lt;String, Object&gt;**
609
-
610
- ### Authorization
611
-
612
- [ApiKeyAuth](../README.md#ApiKeyAuth)
613
-
614
- ### HTTP request headers
615
-
616
- - **Content-Type**: Not defined
617
- - **Accept**: application/json
618
-
619
-
620
- ## update_campaign
621
-
622
- > <Campaign> update_campaign(campaign_id, opts)
623
-
624
- Update Campaign
625
-
626
- Updates details of a campaign. You can update a campaign's name, subject, from email address, from name, template or list.
627
-
628
- ### Examples
629
-
630
- ```ruby
631
- require 'time'
632
- require 'klaviyo_sdk'
633
- # setup authorization
634
- Klaviyo.configure do |config|
635
- # Configure API key authorization: ApiKeyAuth
636
- config.api_key['ApiKeyAuth'] = 'YOUR API KEY'
637
- # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
638
- # config.api_key_prefix['ApiKeyAuth'] = 'Bearer'
639
- end
640
-
641
- api_instance = Klaviyo::CampaignsApi.new
642
- campaign_id = 'CAMPAIGN_ID' # String |
643
- opts = {
644
- list_id: 'list_id_example', # String | The list you will send the campaign to.
645
- template_id: 'template_id_example', # String | The ID of the Email Template object that will be the content of this campaign. Note the Email Template is copied when creating this campaign, so future changes to that Email Template will not alter the content of this campaign.
646
- from_email: 'from_email_example', # String | The email address your email will be sent from and will be used in the reply-to header.
647
- from_name: 'from_name_example', # String | The name or label associated with the email address you're sending from.
648
- subject: 'subject_example', # String | The email subject of the campaign
649
- name: 'name_example', # String | A name for this campaign. If not specified, this will default to the subject of the campaign.
650
- use_smart_sending: true, # Boolean | If set, limits the number of emails sent to an individual within a short period. Campaigns initially default to `true`.
651
- add_google_analytics: true # Boolean | If specified, adds Google Analytics tracking tags to links. Campaigns initially default to `false`.
652
- }
653
-
654
- begin
655
- # Update Campaign
656
- result = api_instance.update_campaign(campaign_id, opts)
657
- p result
658
- rescue Klaviyo::ApiError => e
659
- puts "Error when calling CampaignsApi->update_campaign: #{e}"
660
- end
661
- ```
662
-
663
- #### Using the update_campaign_with_http_info variant
664
-
665
- This returns an Array which contains the response data, status code and headers.
666
-
667
- > <Array(<Campaign>, Integer, Hash)> update_campaign_with_http_info(campaign_id, opts)
668
-
669
- ```ruby
670
- begin
671
- # Update Campaign
672
- data, status_code, headers = api_instance.update_campaign_with_http_info(campaign_id, opts)
673
- p status_code # => 2xx
674
- p headers # => { ... }
675
- p data # => <Campaign>
676
- rescue Klaviyo::ApiError => e
677
- puts "Error when calling CampaignsApi->update_campaign_with_http_info: #{e}"
678
- end
679
- ```
680
-
681
- ### Parameters
682
-
683
- | Name | Type | Description | Notes |
684
- | ---- | ---- | ----------- | ----- |
685
- | **campaign_id** | **String** | | [default to &#39;CAMPAIGN_ID&#39;] |
686
- | **list_id** | **String** | The list you will send the campaign to. | [optional] |
687
- | **template_id** | **String** | The ID of the Email Template object that will be the content of this campaign. Note the Email Template is copied when creating this campaign, so future changes to that Email Template will not alter the content of this campaign. | [optional] |
688
- | **from_email** | **String** | The email address your email will be sent from and will be used in the reply-to header. | [optional] |
689
- | **from_name** | **String** | The name or label associated with the email address you&#39;re sending from. | [optional] |
690
- | **subject** | **String** | The email subject of the campaign | [optional] |
691
- | **name** | **String** | A name for this campaign. If not specified, this will default to the subject of the campaign. | [optional] |
692
- | **use_smart_sending** | **Boolean** | If set, limits the number of emails sent to an individual within a short period. Campaigns initially default to &#x60;true&#x60;. | [optional] |
693
- | **add_google_analytics** | **Boolean** | If specified, adds Google Analytics tracking tags to links. Campaigns initially default to &#x60;false&#x60;. | [optional] |
694
-
695
- ### Return type
696
-
697
- [**Campaign**](Campaign.md)
698
-
699
- ### Authorization
700
-
701
- [ApiKeyAuth](../README.md#ApiKeyAuth)
702
-
703
- ### HTTP request headers
704
-
705
- - **Content-Type**: application/x-www-form-urlencoded
706
- - **Accept**: application/json
707
-