zernio-sdk 0.0.550 → 0.0.552

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +73 -75
  3. data/docs/AdAccountsApi.md +915 -0
  4. data/docs/AdCampaignsApi.md +615 -15
  5. data/docs/AdCreativesApi.md +815 -0
  6. data/docs/AdInsightsApi.md +415 -0
  7. data/docs/AdTargetingApi.md +371 -0
  8. data/docs/AnalyticsApi.md +7 -7
  9. data/docs/BoostPostRequestTracking.md +1 -1
  10. data/docs/{CreateLeadFormRequestQuestionsInnerOptionsInner.md → BoostPostRequestTrackingUrlTagsInner.md} +2 -2
  11. data/docs/ConversionsApi.md +890 -0
  12. data/docs/CreateLeadFormRequestQuestionsInner.md +1 -1
  13. data/docs/LeadGenApi.md +527 -0
  14. data/docs/MessagingAdsApi.md +215 -0
  15. data/docs/ReachAndFrequencyApi.md +294 -0
  16. data/docs/TrackingTagsApi.md +141 -0
  17. data/docs/YouTubeDailyViewsResponse.md +2 -0
  18. data/docs/YouTubeDemographicsResponse.md +2 -0
  19. data/docs/YouTubeVideoRetentionResponse.md +2 -0
  20. data/lib/zernio-sdk/api/ad_accounts_api.rb +958 -0
  21. data/lib/zernio-sdk/api/ad_campaigns_api.rb +618 -12
  22. data/lib/zernio-sdk/api/ad_creatives_api.rb +826 -0
  23. data/lib/zernio-sdk/api/ad_insights_api.rb +446 -0
  24. data/lib/zernio-sdk/api/ad_targeting_api.rb +404 -0
  25. data/lib/zernio-sdk/api/analytics_api.rb +8 -8
  26. data/lib/zernio-sdk/api/conversions_api.rb +936 -0
  27. data/lib/zernio-sdk/api/lead_gen_api.rb +547 -0
  28. data/lib/zernio-sdk/api/messaging_ads_api.rb +226 -0
  29. data/lib/zernio-sdk/api/reach_and_frequency_api.rb +316 -0
  30. data/lib/zernio-sdk/api/tracking_tags_api.rb +137 -0
  31. data/lib/zernio-sdk/models/boost_post_request_tracking.rb +5 -2
  32. data/lib/zernio-sdk/models/{create_lead_form_request_questions_inner_options_inner.rb → boost_post_request_tracking_url_tags_inner.rb} +3 -3
  33. data/lib/zernio-sdk/models/create_lead_form_request_questions_inner.rb +1 -1
  34. data/lib/zernio-sdk/models/you_tube_daily_views_response.rb +11 -1
  35. data/lib/zernio-sdk/models/you_tube_demographics_response.rb +11 -1
  36. data/lib/zernio-sdk/models/you_tube_video_retention_response.rb +11 -1
  37. data/lib/zernio-sdk/version.rb +1 -1
  38. data/lib/zernio-sdk.rb +9 -2
  39. data/openapi.yaml +329 -163
  40. data/spec/api/ad_accounts_api_spec.rb +206 -0
  41. data/spec/api/ad_campaigns_api_spec.rb +119 -6
  42. data/spec/api/ad_creatives_api_spec.rb +182 -0
  43. data/spec/api/ad_insights_api_spec.rb +120 -0
  44. data/spec/api/ad_targeting_api_spec.rb +101 -0
  45. data/spec/api/analytics_api_spec.rb +4 -4
  46. data/spec/api/conversions_api_spec.rb +199 -0
  47. data/spec/api/lead_gen_api_spec.rb +131 -0
  48. data/spec/api/messaging_ads_api_spec.rb +71 -0
  49. data/spec/api/reach_and_frequency_api_spec.rb +87 -0
  50. data/spec/api/tracking_tags_api_spec.rb +25 -0
  51. data/spec/models/{create_lead_form_request_questions_inner_options_inner_spec.rb → boost_post_request_tracking_url_tags_inner_spec.rb} +6 -6
  52. data/spec/models/you_tube_daily_views_response_spec.rb +6 -0
  53. data/spec/models/you_tube_demographics_response_spec.rb +6 -0
  54. data/spec/models/you_tube_video_retention_response_spec.rb +6 -0
  55. metadata +38 -10
  56. data/docs/AdsApi.md +0 -5278
  57. data/lib/zernio-sdk/api/ads_api.rb +0 -5391
  58. data/spec/api/ads_api_spec.rb +0 -1015
@@ -0,0 +1,815 @@
1
+ # Zernio::AdCreativesApi
2
+
3
+ All URIs are relative to *https://zernio.com/api*
4
+
5
+ | Method | HTTP request | Description |
6
+ | ------ | ------------ | ----------- |
7
+ | [**create_ad_creative**](AdCreativesApi.md#create_ad_creative) | **POST** /v1/ads/creatives | Create a standalone creative |
8
+ | [**delete_ad_creative**](AdCreativesApi.md#delete_ad_creative) | **DELETE** /v1/ads/creatives/{creativeId} | Delete a creative |
9
+ | [**generate_ad_previews**](AdCreativesApi.md#generate_ad_previews) | **POST** /v1/ads/preview | Render pre-create ad previews |
10
+ | [**get_ad_creative**](AdCreativesApi.md#get_ad_creative) | **GET** /v1/ads/creatives/{creativeId} | Creative details |
11
+ | [**get_ad_previews**](AdCreativesApi.md#get_ad_previews) | **GET** /v1/ads/{adId}/preview | Render previews of an existing ad |
12
+ | [**list_ad_catalog_product_sets**](AdCreativesApi.md#list_ad_catalog_product_sets) | **GET** /v1/ads/catalogs/{catalogId}/product-sets | List a catalog's product sets |
13
+ | [**list_ad_catalogs**](AdCreativesApi.md#list_ad_catalogs) | **GET** /v1/ads/catalogs | List Meta product catalogs |
14
+ | [**list_ad_creatives**](AdCreativesApi.md#list_ad_creatives) | **GET** /v1/ads/creatives | Creative library |
15
+ | [**list_ad_images**](AdCreativesApi.md#list_ad_images) | **GET** /v1/ads/images | Ad image library |
16
+ | [**update_ad_creative**](AdCreativesApi.md#update_ad_creative) | **PUT** /v1/ads/creatives/{creativeId} | Rename a creative |
17
+ | [**upload_ad_image**](AdCreativesApi.md#upload_ad_image) | **POST** /v1/ads/images | Upload an ad image from base64 |
18
+
19
+
20
+ ## create_ad_creative
21
+
22
+ > <CreateAdCreative201Response> create_ad_creative(create_ad_creative_request)
23
+
24
+ Create a standalone creative
25
+
26
+ Creates a creative in the library WITHOUT an ad, reusable on the create endpoints via `existingCreativeId`. Provide exactly one of `imageUrl` (uploaded server-side), `imageHash` (from POST /v1/ads/images or the library list), or `carouselCards` (2-10 hand-built cards). The Page (and linked Instagram account, when present) is resolved from `accountId` as the story actor.
27
+
28
+ ### Examples
29
+
30
+ ```ruby
31
+ require 'time'
32
+ require 'zernio-sdk'
33
+ # setup authorization
34
+ Zernio.configure do |config|
35
+ # Configure Bearer authorization (JWT): bearerAuth
36
+ config.access_token = 'YOUR_BEARER_TOKEN'
37
+ end
38
+
39
+ api_instance = Zernio::AdCreativesApi.new
40
+ create_ad_creative_request = Zernio::CreateAdCreativeRequest.new({account_id: 'account_id_example', ad_account_id: 'ad_account_id_example', headline: 'headline_example', body: 'body_example', link_url: 'link_url_example'}) # CreateAdCreativeRequest |
41
+
42
+ begin
43
+ # Create a standalone creative
44
+ result = api_instance.create_ad_creative(create_ad_creative_request)
45
+ p result
46
+ rescue Zernio::ApiError => e
47
+ puts "Error when calling AdCreativesApi->create_ad_creative: #{e}"
48
+ end
49
+ ```
50
+
51
+ #### Using the create_ad_creative_with_http_info variant
52
+
53
+ This returns an Array which contains the response data, status code and headers.
54
+
55
+ > <Array(<CreateAdCreative201Response>, Integer, Hash)> create_ad_creative_with_http_info(create_ad_creative_request)
56
+
57
+ ```ruby
58
+ begin
59
+ # Create a standalone creative
60
+ data, status_code, headers = api_instance.create_ad_creative_with_http_info(create_ad_creative_request)
61
+ p status_code # => 2xx
62
+ p headers # => { ... }
63
+ p data # => <CreateAdCreative201Response>
64
+ rescue Zernio::ApiError => e
65
+ puts "Error when calling AdCreativesApi->create_ad_creative_with_http_info: #{e}"
66
+ end
67
+ ```
68
+
69
+ ### Parameters
70
+
71
+ | Name | Type | Description | Notes |
72
+ | ---- | ---- | ----------- | ----- |
73
+ | **create_ad_creative_request** | [**CreateAdCreativeRequest**](CreateAdCreativeRequest.md) | | |
74
+
75
+ ### Return type
76
+
77
+ [**CreateAdCreative201Response**](CreateAdCreative201Response.md)
78
+
79
+ ### Authorization
80
+
81
+ [bearerAuth](../README.md#bearerAuth)
82
+
83
+ ### HTTP request headers
84
+
85
+ - **Content-Type**: application/json
86
+ - **Accept**: application/json
87
+
88
+
89
+ ## delete_ad_creative
90
+
91
+ > <DeleteAdCreative200Response> delete_ad_creative(creative_id, account_id)
92
+
93
+ Delete a creative
94
+
95
+ Deletes a creative from the library. Meta only allows deleting creatives not referenced by any ad — otherwise its 400 surfaces verbatim.
96
+
97
+ ### Examples
98
+
99
+ ```ruby
100
+ require 'time'
101
+ require 'zernio-sdk'
102
+ # setup authorization
103
+ Zernio.configure do |config|
104
+ # Configure Bearer authorization (JWT): bearerAuth
105
+ config.access_token = 'YOUR_BEARER_TOKEN'
106
+ end
107
+
108
+ api_instance = Zernio::AdCreativesApi.new
109
+ creative_id = 'creative_id_example' # String | Platform creative id
110
+ account_id = 'account_id_example' # String | Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
111
+
112
+ begin
113
+ # Delete a creative
114
+ result = api_instance.delete_ad_creative(creative_id, account_id)
115
+ p result
116
+ rescue Zernio::ApiError => e
117
+ puts "Error when calling AdCreativesApi->delete_ad_creative: #{e}"
118
+ end
119
+ ```
120
+
121
+ #### Using the delete_ad_creative_with_http_info variant
122
+
123
+ This returns an Array which contains the response data, status code and headers.
124
+
125
+ > <Array(<DeleteAdCreative200Response>, Integer, Hash)> delete_ad_creative_with_http_info(creative_id, account_id)
126
+
127
+ ```ruby
128
+ begin
129
+ # Delete a creative
130
+ data, status_code, headers = api_instance.delete_ad_creative_with_http_info(creative_id, account_id)
131
+ p status_code # => 2xx
132
+ p headers # => { ... }
133
+ p data # => <DeleteAdCreative200Response>
134
+ rescue Zernio::ApiError => e
135
+ puts "Error when calling AdCreativesApi->delete_ad_creative_with_http_info: #{e}"
136
+ end
137
+ ```
138
+
139
+ ### Parameters
140
+
141
+ | Name | Type | Description | Notes |
142
+ | ---- | ---- | ----------- | ----- |
143
+ | **creative_id** | **String** | Platform creative id | |
144
+ | **account_id** | **String** | Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token. | |
145
+
146
+ ### Return type
147
+
148
+ [**DeleteAdCreative200Response**](DeleteAdCreative200Response.md)
149
+
150
+ ### Authorization
151
+
152
+ [bearerAuth](../README.md#bearerAuth)
153
+
154
+ ### HTTP request headers
155
+
156
+ - **Content-Type**: Not defined
157
+ - **Accept**: application/json
158
+
159
+
160
+ ## generate_ad_previews
161
+
162
+ > <GenerateAdPreviews200Response> generate_ad_previews(generate_ad_previews_request)
163
+
164
+ Render pre-create ad previews
165
+
166
+ Renders how a creative would look per placement BEFORE any ad exists, via Meta's `/generatepreviews`. Provide exactly one creative source: `existingCreativeId` or `creativeSpec`. Each preview is an HTML `<iframe>` snippet embeddable directly. Unknown `formats` values return Meta's 400 verbatim.
167
+
168
+ ### Examples
169
+
170
+ ```ruby
171
+ require 'time'
172
+ require 'zernio-sdk'
173
+ # setup authorization
174
+ Zernio.configure do |config|
175
+ # Configure Bearer authorization (JWT): bearerAuth
176
+ config.access_token = 'YOUR_BEARER_TOKEN'
177
+ end
178
+
179
+ api_instance = Zernio::AdCreativesApi.new
180
+ generate_ad_previews_request = Zernio::GenerateAdPreviewsRequest.new({account_id: 'account_id_example', ad_account_id: 'ad_account_id_example'}) # GenerateAdPreviewsRequest |
181
+
182
+ begin
183
+ # Render pre-create ad previews
184
+ result = api_instance.generate_ad_previews(generate_ad_previews_request)
185
+ p result
186
+ rescue Zernio::ApiError => e
187
+ puts "Error when calling AdCreativesApi->generate_ad_previews: #{e}"
188
+ end
189
+ ```
190
+
191
+ #### Using the generate_ad_previews_with_http_info variant
192
+
193
+ This returns an Array which contains the response data, status code and headers.
194
+
195
+ > <Array(<GenerateAdPreviews200Response>, Integer, Hash)> generate_ad_previews_with_http_info(generate_ad_previews_request)
196
+
197
+ ```ruby
198
+ begin
199
+ # Render pre-create ad previews
200
+ data, status_code, headers = api_instance.generate_ad_previews_with_http_info(generate_ad_previews_request)
201
+ p status_code # => 2xx
202
+ p headers # => { ... }
203
+ p data # => <GenerateAdPreviews200Response>
204
+ rescue Zernio::ApiError => e
205
+ puts "Error when calling AdCreativesApi->generate_ad_previews_with_http_info: #{e}"
206
+ end
207
+ ```
208
+
209
+ ### Parameters
210
+
211
+ | Name | Type | Description | Notes |
212
+ | ---- | ---- | ----------- | ----- |
213
+ | **generate_ad_previews_request** | [**GenerateAdPreviewsRequest**](GenerateAdPreviewsRequest.md) | | |
214
+
215
+ ### Return type
216
+
217
+ [**GenerateAdPreviews200Response**](GenerateAdPreviews200Response.md)
218
+
219
+ ### Authorization
220
+
221
+ [bearerAuth](../README.md#bearerAuth)
222
+
223
+ ### HTTP request headers
224
+
225
+ - **Content-Type**: application/json
226
+ - **Accept**: application/json
227
+
228
+
229
+ ## get_ad_creative
230
+
231
+ > <GetAdCreative200Response> get_ad_creative(creative_id, account_id, opts)
232
+
233
+ Creative details
234
+
235
+ One creative's details, verbatim from Meta. `fields` is a raw-passthrough override of the default projection.
236
+
237
+ ### Examples
238
+
239
+ ```ruby
240
+ require 'time'
241
+ require 'zernio-sdk'
242
+ # setup authorization
243
+ Zernio.configure do |config|
244
+ # Configure Bearer authorization (JWT): bearerAuth
245
+ config.access_token = 'YOUR_BEARER_TOKEN'
246
+ end
247
+
248
+ api_instance = Zernio::AdCreativesApi.new
249
+ creative_id = 'creative_id_example' # String | Platform creative id
250
+ account_id = 'account_id_example' # String | Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
251
+ opts = {
252
+ fields: 'fields_example' # String | Comma-separated Graph field override (supports nested {} projections).
253
+ }
254
+
255
+ begin
256
+ # Creative details
257
+ result = api_instance.get_ad_creative(creative_id, account_id, opts)
258
+ p result
259
+ rescue Zernio::ApiError => e
260
+ puts "Error when calling AdCreativesApi->get_ad_creative: #{e}"
261
+ end
262
+ ```
263
+
264
+ #### Using the get_ad_creative_with_http_info variant
265
+
266
+ This returns an Array which contains the response data, status code and headers.
267
+
268
+ > <Array(<GetAdCreative200Response>, Integer, Hash)> get_ad_creative_with_http_info(creative_id, account_id, opts)
269
+
270
+ ```ruby
271
+ begin
272
+ # Creative details
273
+ data, status_code, headers = api_instance.get_ad_creative_with_http_info(creative_id, account_id, opts)
274
+ p status_code # => 2xx
275
+ p headers # => { ... }
276
+ p data # => <GetAdCreative200Response>
277
+ rescue Zernio::ApiError => e
278
+ puts "Error when calling AdCreativesApi->get_ad_creative_with_http_info: #{e}"
279
+ end
280
+ ```
281
+
282
+ ### Parameters
283
+
284
+ | Name | Type | Description | Notes |
285
+ | ---- | ---- | ----------- | ----- |
286
+ | **creative_id** | **String** | Platform creative id | |
287
+ | **account_id** | **String** | Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token. | |
288
+ | **fields** | **String** | Comma-separated Graph field override (supports nested {} projections). | [optional] |
289
+
290
+ ### Return type
291
+
292
+ [**GetAdCreative200Response**](GetAdCreative200Response.md)
293
+
294
+ ### Authorization
295
+
296
+ [bearerAuth](../README.md#bearerAuth)
297
+
298
+ ### HTTP request headers
299
+
300
+ - **Content-Type**: Not defined
301
+ - **Accept**: application/json
302
+
303
+
304
+ ## get_ad_previews
305
+
306
+ > <GetAdPreviews200Response> get_ad_previews(ad_id, opts)
307
+
308
+ Render previews of an existing ad
309
+
310
+ Renders an EXISTING ad per placement via Meta's `/{ad_id}/previews`. Each preview is an HTML `<iframe>` snippet embeddable directly. Unknown `formats` values return Meta's 400 verbatim.
311
+
312
+ ### Examples
313
+
314
+ ```ruby
315
+ require 'time'
316
+ require 'zernio-sdk'
317
+ # setup authorization
318
+ Zernio.configure do |config|
319
+ # Configure Bearer authorization (JWT): bearerAuth
320
+ config.access_token = 'YOUR_BEARER_TOKEN'
321
+ end
322
+
323
+ api_instance = Zernio::AdCreativesApi.new
324
+ ad_id = 'ad_id_example' # String | Zernio ad id (24-char hex).
325
+ opts = {
326
+ formats: 'formats_example' # String | Comma-separated Meta ad_format values (max 10), one preview per format. Defaults to DESKTOP_FEED_STANDARD.
327
+ }
328
+
329
+ begin
330
+ # Render previews of an existing ad
331
+ result = api_instance.get_ad_previews(ad_id, opts)
332
+ p result
333
+ rescue Zernio::ApiError => e
334
+ puts "Error when calling AdCreativesApi->get_ad_previews: #{e}"
335
+ end
336
+ ```
337
+
338
+ #### Using the get_ad_previews_with_http_info variant
339
+
340
+ This returns an Array which contains the response data, status code and headers.
341
+
342
+ > <Array(<GetAdPreviews200Response>, Integer, Hash)> get_ad_previews_with_http_info(ad_id, opts)
343
+
344
+ ```ruby
345
+ begin
346
+ # Render previews of an existing ad
347
+ data, status_code, headers = api_instance.get_ad_previews_with_http_info(ad_id, opts)
348
+ p status_code # => 2xx
349
+ p headers # => { ... }
350
+ p data # => <GetAdPreviews200Response>
351
+ rescue Zernio::ApiError => e
352
+ puts "Error when calling AdCreativesApi->get_ad_previews_with_http_info: #{e}"
353
+ end
354
+ ```
355
+
356
+ ### Parameters
357
+
358
+ | Name | Type | Description | Notes |
359
+ | ---- | ---- | ----------- | ----- |
360
+ | **ad_id** | **String** | Zernio ad id (24-char hex). | |
361
+ | **formats** | **String** | Comma-separated Meta ad_format values (max 10), one preview per format. Defaults to DESKTOP_FEED_STANDARD. | [optional] |
362
+
363
+ ### Return type
364
+
365
+ [**GetAdPreviews200Response**](GetAdPreviews200Response.md)
366
+
367
+ ### Authorization
368
+
369
+ [bearerAuth](../README.md#bearerAuth)
370
+
371
+ ### HTTP request headers
372
+
373
+ - **Content-Type**: Not defined
374
+ - **Accept**: application/json
375
+
376
+
377
+ ## list_ad_catalog_product_sets
378
+
379
+ > <ListAdCatalogProductSets200Response> list_ad_catalog_product_sets(catalog_id, account_id)
380
+
381
+ List a catalog's product sets
382
+
383
+ Lists a Meta product catalog's product sets — the unit a catalog ad promotes. Pass the chosen set as `promotedObject.productSetId` on POST /v1/ads/create with `goal: catalog_sales`.
384
+
385
+ ### Examples
386
+
387
+ ```ruby
388
+ require 'time'
389
+ require 'zernio-sdk'
390
+ # setup authorization
391
+ Zernio.configure do |config|
392
+ # Configure Bearer authorization (JWT): bearerAuth
393
+ config.access_token = 'YOUR_BEARER_TOKEN'
394
+ end
395
+
396
+ api_instance = Zernio::AdCreativesApi.new
397
+ catalog_id = 'catalog_id_example' # String | Meta product catalog ID (from GET /v1/ads/catalogs)
398
+ account_id = 'account_id_example' # String | A facebook, instagram, or metaads social account ID
399
+
400
+ begin
401
+ # List a catalog's product sets
402
+ result = api_instance.list_ad_catalog_product_sets(catalog_id, account_id)
403
+ p result
404
+ rescue Zernio::ApiError => e
405
+ puts "Error when calling AdCreativesApi->list_ad_catalog_product_sets: #{e}"
406
+ end
407
+ ```
408
+
409
+ #### Using the list_ad_catalog_product_sets_with_http_info variant
410
+
411
+ This returns an Array which contains the response data, status code and headers.
412
+
413
+ > <Array(<ListAdCatalogProductSets200Response>, Integer, Hash)> list_ad_catalog_product_sets_with_http_info(catalog_id, account_id)
414
+
415
+ ```ruby
416
+ begin
417
+ # List a catalog's product sets
418
+ data, status_code, headers = api_instance.list_ad_catalog_product_sets_with_http_info(catalog_id, account_id)
419
+ p status_code # => 2xx
420
+ p headers # => { ... }
421
+ p data # => <ListAdCatalogProductSets200Response>
422
+ rescue Zernio::ApiError => e
423
+ puts "Error when calling AdCreativesApi->list_ad_catalog_product_sets_with_http_info: #{e}"
424
+ end
425
+ ```
426
+
427
+ ### Parameters
428
+
429
+ | Name | Type | Description | Notes |
430
+ | ---- | ---- | ----------- | ----- |
431
+ | **catalog_id** | **String** | Meta product catalog ID (from GET /v1/ads/catalogs) | |
432
+ | **account_id** | **String** | A facebook, instagram, or metaads social account ID | |
433
+
434
+ ### Return type
435
+
436
+ [**ListAdCatalogProductSets200Response**](ListAdCatalogProductSets200Response.md)
437
+
438
+ ### Authorization
439
+
440
+ [bearerAuth](../README.md#bearerAuth)
441
+
442
+ ### HTTP request headers
443
+
444
+ - **Content-Type**: Not defined
445
+ - **Accept**: application/json
446
+
447
+
448
+ ## list_ad_catalogs
449
+
450
+ > <ListAdCatalogs200Response> list_ad_catalogs(account_id, ad_account_id)
451
+
452
+ List Meta product catalogs
453
+
454
+ Lists the Meta product catalogs reachable from an ad account (owned + agency-shared catalogs of the ad account's business), for Advantage+ catalog ads (`goal: catalog_sales` on POST /v1/ads/create — e.g. vehicle inventory catalogs). Read-only; uses scopes customers already granted (no reconnect needed). Catalog contents (items, feeds) are managed in Meta Commerce Manager, not through this API.
455
+
456
+ ### Examples
457
+
458
+ ```ruby
459
+ require 'time'
460
+ require 'zernio-sdk'
461
+ # setup authorization
462
+ Zernio.configure do |config|
463
+ # Configure Bearer authorization (JWT): bearerAuth
464
+ config.access_token = 'YOUR_BEARER_TOKEN'
465
+ end
466
+
467
+ api_instance = Zernio::AdCreativesApi.new
468
+ account_id = 'account_id_example' # String | A facebook, instagram, or metaads social account ID
469
+ ad_account_id = 'ad_account_id_example' # String | Meta ad account ID (act_...)
470
+
471
+ begin
472
+ # List Meta product catalogs
473
+ result = api_instance.list_ad_catalogs(account_id, ad_account_id)
474
+ p result
475
+ rescue Zernio::ApiError => e
476
+ puts "Error when calling AdCreativesApi->list_ad_catalogs: #{e}"
477
+ end
478
+ ```
479
+
480
+ #### Using the list_ad_catalogs_with_http_info variant
481
+
482
+ This returns an Array which contains the response data, status code and headers.
483
+
484
+ > <Array(<ListAdCatalogs200Response>, Integer, Hash)> list_ad_catalogs_with_http_info(account_id, ad_account_id)
485
+
486
+ ```ruby
487
+ begin
488
+ # List Meta product catalogs
489
+ data, status_code, headers = api_instance.list_ad_catalogs_with_http_info(account_id, ad_account_id)
490
+ p status_code # => 2xx
491
+ p headers # => { ... }
492
+ p data # => <ListAdCatalogs200Response>
493
+ rescue Zernio::ApiError => e
494
+ puts "Error when calling AdCreativesApi->list_ad_catalogs_with_http_info: #{e}"
495
+ end
496
+ ```
497
+
498
+ ### Parameters
499
+
500
+ | Name | Type | Description | Notes |
501
+ | ---- | ---- | ----------- | ----- |
502
+ | **account_id** | **String** | A facebook, instagram, or metaads social account ID | |
503
+ | **ad_account_id** | **String** | Meta ad account ID (act_...) | |
504
+
505
+ ### Return type
506
+
507
+ [**ListAdCatalogs200Response**](ListAdCatalogs200Response.md)
508
+
509
+ ### Authorization
510
+
511
+ [bearerAuth](../README.md#bearerAuth)
512
+
513
+ ### HTTP request headers
514
+
515
+ - **Content-Type**: Not defined
516
+ - **Accept**: application/json
517
+
518
+
519
+ ## list_ad_creatives
520
+
521
+ > <ListAdCreatives200Response> list_ad_creatives(account_id, ad_account_id, opts)
522
+
523
+ Creative library
524
+
525
+ Lists the ad account's creative library (Meta's `/act_X/adcreatives`), rows returned verbatim. The default projection covers id, name, status, object type, thumbnail, object_story_spec / asset_feed_spec and url_tags; `fields` is a raw-passthrough override. Any creative id here is reusable on the create endpoints via `existingCreativeId`.
526
+
527
+ ### Examples
528
+
529
+ ```ruby
530
+ require 'time'
531
+ require 'zernio-sdk'
532
+ # setup authorization
533
+ Zernio.configure do |config|
534
+ # Configure Bearer authorization (JWT): bearerAuth
535
+ config.access_token = 'YOUR_BEARER_TOKEN'
536
+ end
537
+
538
+ api_instance = Zernio::AdCreativesApi.new
539
+ account_id = 'account_id_example' # String | Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
540
+ ad_account_id = 'ad_account_id_example' # String | Meta ad account id (act_<n>).
541
+ opts = {
542
+ fields: 'fields_example', # String | Comma-separated Graph field override (supports nested {} projections).
543
+ limit: 56, # Integer | Rows per page
544
+ after: 'after_example' # String | Cursor from paging.after of the previous page.
545
+ }
546
+
547
+ begin
548
+ # Creative library
549
+ result = api_instance.list_ad_creatives(account_id, ad_account_id, opts)
550
+ p result
551
+ rescue Zernio::ApiError => e
552
+ puts "Error when calling AdCreativesApi->list_ad_creatives: #{e}"
553
+ end
554
+ ```
555
+
556
+ #### Using the list_ad_creatives_with_http_info variant
557
+
558
+ This returns an Array which contains the response data, status code and headers.
559
+
560
+ > <Array(<ListAdCreatives200Response>, Integer, Hash)> list_ad_creatives_with_http_info(account_id, ad_account_id, opts)
561
+
562
+ ```ruby
563
+ begin
564
+ # Creative library
565
+ data, status_code, headers = api_instance.list_ad_creatives_with_http_info(account_id, ad_account_id, opts)
566
+ p status_code # => 2xx
567
+ p headers # => { ... }
568
+ p data # => <ListAdCreatives200Response>
569
+ rescue Zernio::ApiError => e
570
+ puts "Error when calling AdCreativesApi->list_ad_creatives_with_http_info: #{e}"
571
+ end
572
+ ```
573
+
574
+ ### Parameters
575
+
576
+ | Name | Type | Description | Notes |
577
+ | ---- | ---- | ----------- | ----- |
578
+ | **account_id** | **String** | Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token. | |
579
+ | **ad_account_id** | **String** | Meta ad account id (act_&lt;n&gt;). | |
580
+ | **fields** | **String** | Comma-separated Graph field override (supports nested {} projections). | [optional] |
581
+ | **limit** | **Integer** | Rows per page | [optional][default to 25] |
582
+ | **after** | **String** | Cursor from paging.after of the previous page. | [optional] |
583
+
584
+ ### Return type
585
+
586
+ [**ListAdCreatives200Response**](ListAdCreatives200Response.md)
587
+
588
+ ### Authorization
589
+
590
+ [bearerAuth](../README.md#bearerAuth)
591
+
592
+ ### HTTP request headers
593
+
594
+ - **Content-Type**: Not defined
595
+ - **Accept**: application/json
596
+
597
+
598
+ ## list_ad_images
599
+
600
+ > <ListAdImages200Response> list_ad_images(account_id, ad_account_id, opts)
601
+
602
+ Ad image library
603
+
604
+ Lists the ad account's image library (Meta's `/act_X/adimages`), rows returned verbatim. The default projection covers hash, url, name, dimensions and status; `fields` is a raw-passthrough override. Any `hash` here is reusable wherever Meta accepts `image_hash` (e.g. `imageHash` on POST /v1/ads/creatives).
605
+
606
+ ### Examples
607
+
608
+ ```ruby
609
+ require 'time'
610
+ require 'zernio-sdk'
611
+ # setup authorization
612
+ Zernio.configure do |config|
613
+ # Configure Bearer authorization (JWT): bearerAuth
614
+ config.access_token = 'YOUR_BEARER_TOKEN'
615
+ end
616
+
617
+ api_instance = Zernio::AdCreativesApi.new
618
+ account_id = 'account_id_example' # String | Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
619
+ ad_account_id = 'ad_account_id_example' # String | Meta ad account id (act_<n>).
620
+ opts = {
621
+ fields: 'fields_example', # String | Comma-separated Graph field override (supports nested {} projections).
622
+ limit: 56, # Integer | Rows per page
623
+ after: 'after_example' # String | Cursor from paging.after of the previous page.
624
+ }
625
+
626
+ begin
627
+ # Ad image library
628
+ result = api_instance.list_ad_images(account_id, ad_account_id, opts)
629
+ p result
630
+ rescue Zernio::ApiError => e
631
+ puts "Error when calling AdCreativesApi->list_ad_images: #{e}"
632
+ end
633
+ ```
634
+
635
+ #### Using the list_ad_images_with_http_info variant
636
+
637
+ This returns an Array which contains the response data, status code and headers.
638
+
639
+ > <Array(<ListAdImages200Response>, Integer, Hash)> list_ad_images_with_http_info(account_id, ad_account_id, opts)
640
+
641
+ ```ruby
642
+ begin
643
+ # Ad image library
644
+ data, status_code, headers = api_instance.list_ad_images_with_http_info(account_id, ad_account_id, opts)
645
+ p status_code # => 2xx
646
+ p headers # => { ... }
647
+ p data # => <ListAdImages200Response>
648
+ rescue Zernio::ApiError => e
649
+ puts "Error when calling AdCreativesApi->list_ad_images_with_http_info: #{e}"
650
+ end
651
+ ```
652
+
653
+ ### Parameters
654
+
655
+ | Name | Type | Description | Notes |
656
+ | ---- | ---- | ----------- | ----- |
657
+ | **account_id** | **String** | Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token. | |
658
+ | **ad_account_id** | **String** | Meta ad account id (act_&lt;n&gt;). | |
659
+ | **fields** | **String** | Comma-separated Graph field override (supports nested {} projections). | [optional] |
660
+ | **limit** | **Integer** | Rows per page | [optional][default to 25] |
661
+ | **after** | **String** | Cursor from paging.after of the previous page. | [optional] |
662
+
663
+ ### Return type
664
+
665
+ [**ListAdImages200Response**](ListAdImages200Response.md)
666
+
667
+ ### Authorization
668
+
669
+ [bearerAuth](../README.md#bearerAuth)
670
+
671
+ ### HTTP request headers
672
+
673
+ - **Content-Type**: Not defined
674
+ - **Accept**: application/json
675
+
676
+
677
+ ## update_ad_creative
678
+
679
+ > <UpdateAdCreative200Response> update_ad_creative(creative_id, update_ad_creative_request)
680
+
681
+ Rename a creative
682
+
683
+ Renames a creative. Creatives are immutable on Meta beyond `name` — for content changes create a new creative (POST /v1/ads/creatives) and swap it onto the ad (PUT /v1/ads/{adId} with `creative`).
684
+
685
+ ### Examples
686
+
687
+ ```ruby
688
+ require 'time'
689
+ require 'zernio-sdk'
690
+ # setup authorization
691
+ Zernio.configure do |config|
692
+ # Configure Bearer authorization (JWT): bearerAuth
693
+ config.access_token = 'YOUR_BEARER_TOKEN'
694
+ end
695
+
696
+ api_instance = Zernio::AdCreativesApi.new
697
+ creative_id = 'creative_id_example' # String | Platform creative id
698
+ update_ad_creative_request = Zernio::UpdateAdCreativeRequest.new({account_id: 'account_id_example', name: 'name_example'}) # UpdateAdCreativeRequest |
699
+
700
+ begin
701
+ # Rename a creative
702
+ result = api_instance.update_ad_creative(creative_id, update_ad_creative_request)
703
+ p result
704
+ rescue Zernio::ApiError => e
705
+ puts "Error when calling AdCreativesApi->update_ad_creative: #{e}"
706
+ end
707
+ ```
708
+
709
+ #### Using the update_ad_creative_with_http_info variant
710
+
711
+ This returns an Array which contains the response data, status code and headers.
712
+
713
+ > <Array(<UpdateAdCreative200Response>, Integer, Hash)> update_ad_creative_with_http_info(creative_id, update_ad_creative_request)
714
+
715
+ ```ruby
716
+ begin
717
+ # Rename a creative
718
+ data, status_code, headers = api_instance.update_ad_creative_with_http_info(creative_id, update_ad_creative_request)
719
+ p status_code # => 2xx
720
+ p headers # => { ... }
721
+ p data # => <UpdateAdCreative200Response>
722
+ rescue Zernio::ApiError => e
723
+ puts "Error when calling AdCreativesApi->update_ad_creative_with_http_info: #{e}"
724
+ end
725
+ ```
726
+
727
+ ### Parameters
728
+
729
+ | Name | Type | Description | Notes |
730
+ | ---- | ---- | ----------- | ----- |
731
+ | **creative_id** | **String** | Platform creative id | |
732
+ | **update_ad_creative_request** | [**UpdateAdCreativeRequest**](UpdateAdCreativeRequest.md) | | |
733
+
734
+ ### Return type
735
+
736
+ [**UpdateAdCreative200Response**](UpdateAdCreative200Response.md)
737
+
738
+ ### Authorization
739
+
740
+ [bearerAuth](../README.md#bearerAuth)
741
+
742
+ ### HTTP request headers
743
+
744
+ - **Content-Type**: application/json
745
+ - **Accept**: application/json
746
+
747
+
748
+ ## upload_ad_image
749
+
750
+ > <UploadAdImage201Response> upload_ad_image(upload_ad_image_request)
751
+
752
+ Upload an ad image from base64
753
+
754
+ Uploads raw image bytes to the Meta ad account's image library — for callers whose creatives aren't hosted at a public URL. Returns the image `hash` (Meta's identifier for the asset) and the Meta-hosted `url`, which can be used directly as `imageUrl` on the create endpoints. Max 30 MB decoded.
755
+
756
+ ### Examples
757
+
758
+ ```ruby
759
+ require 'time'
760
+ require 'zernio-sdk'
761
+ # setup authorization
762
+ Zernio.configure do |config|
763
+ # Configure Bearer authorization (JWT): bearerAuth
764
+ config.access_token = 'YOUR_BEARER_TOKEN'
765
+ end
766
+
767
+ api_instance = Zernio::AdCreativesApi.new
768
+ upload_ad_image_request = Zernio::UploadAdImageRequest.new({account_id: 'account_id_example', ad_account_id: 'ad_account_id_example', image_base64: 'image_base64_example'}) # UploadAdImageRequest |
769
+
770
+ begin
771
+ # Upload an ad image from base64
772
+ result = api_instance.upload_ad_image(upload_ad_image_request)
773
+ p result
774
+ rescue Zernio::ApiError => e
775
+ puts "Error when calling AdCreativesApi->upload_ad_image: #{e}"
776
+ end
777
+ ```
778
+
779
+ #### Using the upload_ad_image_with_http_info variant
780
+
781
+ This returns an Array which contains the response data, status code and headers.
782
+
783
+ > <Array(<UploadAdImage201Response>, Integer, Hash)> upload_ad_image_with_http_info(upload_ad_image_request)
784
+
785
+ ```ruby
786
+ begin
787
+ # Upload an ad image from base64
788
+ data, status_code, headers = api_instance.upload_ad_image_with_http_info(upload_ad_image_request)
789
+ p status_code # => 2xx
790
+ p headers # => { ... }
791
+ p data # => <UploadAdImage201Response>
792
+ rescue Zernio::ApiError => e
793
+ puts "Error when calling AdCreativesApi->upload_ad_image_with_http_info: #{e}"
794
+ end
795
+ ```
796
+
797
+ ### Parameters
798
+
799
+ | Name | Type | Description | Notes |
800
+ | ---- | ---- | ----------- | ----- |
801
+ | **upload_ad_image_request** | [**UploadAdImageRequest**](UploadAdImageRequest.md) | | |
802
+
803
+ ### Return type
804
+
805
+ [**UploadAdImage201Response**](UploadAdImage201Response.md)
806
+
807
+ ### Authorization
808
+
809
+ [bearerAuth](../README.md#bearerAuth)
810
+
811
+ ### HTTP request headers
812
+
813
+ - **Content-Type**: application/json
814
+ - **Accept**: application/json
815
+