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,915 @@
1
+ # Zernio::AdAccountsApi
2
+
3
+ All URIs are relative to *https://zernio.com/api*
4
+
5
+ | Method | HTTP request | Description |
6
+ | ------ | ------------ | ----------- |
7
+ | [**get_ad_account_finance**](AdAccountsApi.md#get_ad_account_finance) | **GET** /v1/ads/accounts/finance | Ad account finances |
8
+ | [**get_ad_comments**](AdAccountsApi.md#get_ad_comments) | **GET** /v1/ads/{adId}/comments | List comments on an ad |
9
+ | [**get_ads_activity_log**](AdAccountsApi.md#get_ads_activity_log) | **GET** /v1/ads/activity | Ad account change / audit log |
10
+ | [**get_dsa_defaults**](AdAccountsApi.md#get_dsa_defaults) | **GET** /v1/ads/dsa-defaults | Get ad account DSA defaults |
11
+ | [**get_dsa_recommendations**](AdAccountsApi.md#get_dsa_recommendations) | **GET** /v1/ads/dsa-recommendations | List DSA beneficiary/payor suggestions |
12
+ | [**list_ad_accounts**](AdAccountsApi.md#list_ad_accounts) | **GET** /v1/ads/accounts | List ad accounts |
13
+ | [**list_ad_labels**](AdAccountsApi.md#list_ad_labels) | **GET** /v1/ads/labels | Ad labels |
14
+ | [**list_ad_studies**](AdAccountsApi.md#list_ad_studies) | **GET** /v1/ads/studies | A/B tests and lift studies |
15
+ | [**list_ads_business_centers**](AdAccountsApi.md#list_ads_business_centers) | **GET** /v1/ads/business-centers | List TikTok Business Centers |
16
+ | [**list_high_demand_periods**](AdAccountsApi.md#list_high_demand_periods) | **GET** /v1/ads/high-demand-periods | High demand periods / budget schedules |
17
+ | [**list_meta_businesses**](AdAccountsApi.md#list_meta_businesses) | **GET** /v1/ads/businesses | Businesses list |
18
+ | [**update_ad_account**](AdAccountsApi.md#update_ad_account) | **PATCH** /v1/ads/accounts | Update ad account settings |
19
+
20
+
21
+ ## get_ad_account_finance
22
+
23
+ > <GetAdAccountFinance200Response> get_ad_account_finance(account_id, ad_account_id)
24
+
25
+ Ad account finances
26
+
27
+ Finances of one Meta ad account: prepaid `balance`, lifetime `amountSpent`, account `spendCap` (null = no cap) and the `fundingSource`. Money values are converted from Meta's minor units to whole units of `currency`.
28
+
29
+ ### Examples
30
+
31
+ ```ruby
32
+ require 'time'
33
+ require 'zernio-sdk'
34
+ # setup authorization
35
+ Zernio.configure do |config|
36
+ # Configure Bearer authorization (JWT): bearerAuth
37
+ config.access_token = 'YOUR_BEARER_TOKEN'
38
+ end
39
+
40
+ api_instance = Zernio::AdAccountsApi.new
41
+ account_id = 'account_id_example' # String | Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
42
+ ad_account_id = 'ad_account_id_example' # String | Meta ad account id (act_<n>).
43
+
44
+ begin
45
+ # Ad account finances
46
+ result = api_instance.get_ad_account_finance(account_id, ad_account_id)
47
+ p result
48
+ rescue Zernio::ApiError => e
49
+ puts "Error when calling AdAccountsApi->get_ad_account_finance: #{e}"
50
+ end
51
+ ```
52
+
53
+ #### Using the get_ad_account_finance_with_http_info variant
54
+
55
+ This returns an Array which contains the response data, status code and headers.
56
+
57
+ > <Array(<GetAdAccountFinance200Response>, Integer, Hash)> get_ad_account_finance_with_http_info(account_id, ad_account_id)
58
+
59
+ ```ruby
60
+ begin
61
+ # Ad account finances
62
+ data, status_code, headers = api_instance.get_ad_account_finance_with_http_info(account_id, ad_account_id)
63
+ p status_code # => 2xx
64
+ p headers # => { ... }
65
+ p data # => <GetAdAccountFinance200Response>
66
+ rescue Zernio::ApiError => e
67
+ puts "Error when calling AdAccountsApi->get_ad_account_finance_with_http_info: #{e}"
68
+ end
69
+ ```
70
+
71
+ ### Parameters
72
+
73
+ | Name | Type | Description | Notes |
74
+ | ---- | ---- | ----------- | ----- |
75
+ | **account_id** | **String** | Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token. | |
76
+ | **ad_account_id** | **String** | Meta ad account id (act_&lt;n&gt;). | |
77
+
78
+ ### Return type
79
+
80
+ [**GetAdAccountFinance200Response**](GetAdAccountFinance200Response.md)
81
+
82
+ ### Authorization
83
+
84
+ [bearerAuth](../README.md#bearerAuth)
85
+
86
+ ### HTTP request headers
87
+
88
+ - **Content-Type**: Not defined
89
+ - **Accept**: application/json
90
+
91
+
92
+ ## get_ad_comments
93
+
94
+ > <GetAdComments200Response> get_ad_comments(ad_id, opts)
95
+
96
+ List comments on an ad
97
+
98
+ Returns comments on an ad's underlying creative post. Useful for moderating or analyzing engagement on dark posts (ad creatives that never went live organically), which the regular GET /v1/inbox/comments/{postId} endpoint cannot serve because dark posts are not in Zernio's post database. An ad that runs on both Facebook feed and Instagram feed has two separate underlying posts with separate comment threads (the creative's effective_object_story_id and effective_instagram_media_id). Use the `placement` query param to pick one; with no param the Instagram side is returned when it exists, otherwise Facebook. The identifiers are read from the ad record (persisted during sync) with a Marketing-API fallback for ads that predate the field. For Instagram-placed comments, the Instagram account that runs the ad must be connected to Zernio — those comments are read through that account's token. If no connected Instagram account on the profile can read the ad's media, the call returns ads_connection_required (the Facebook side, if any, is still readable via ?placement=facebook). Meta-only. Other ad platforms (TikTok, LinkedIn, Pinterest, Google, X) do not expose a public per-ad comments API and return feature_not_available. Requires the Ads add-on. Response shape matches GET /v1/inbox/comments/{postId}. The `{adId}` path segment accepts any identifier dialect Zernio indexes for the ad: Zernio internal `_id` (24-char hex), Meta's numeric `platformAdId` (the value shipped in `comment.received` webhooks as `comment.ad.id`), or the creative's `effective_object_story_id` / `effective_instagram_media_id`. Caller doesn't need a translation step.
99
+
100
+ ### Examples
101
+
102
+ ```ruby
103
+ require 'time'
104
+ require 'zernio-sdk'
105
+ # setup authorization
106
+ Zernio.configure do |config|
107
+ # Configure Bearer authorization (JWT): bearerAuth
108
+ config.access_token = 'YOUR_BEARER_TOKEN'
109
+ end
110
+
111
+ api_instance = Zernio::AdAccountsApi.new
112
+ ad_id = 'ad_id_example' # String | Internal Zernio ad ID (ObjectId).
113
+ opts = {
114
+ placement: 'facebook', # String | Which side of the ad to return comments for. Omit to default to the Instagram side when present, else Facebook. Returns ad_not_commentable if the ad has no such placement.
115
+ limit: 56, # Integer |
116
+ cursor: 'cursor_example' # String | Pagination cursor from a previous response.
117
+ }
118
+
119
+ begin
120
+ # List comments on an ad
121
+ result = api_instance.get_ad_comments(ad_id, opts)
122
+ p result
123
+ rescue Zernio::ApiError => e
124
+ puts "Error when calling AdAccountsApi->get_ad_comments: #{e}"
125
+ end
126
+ ```
127
+
128
+ #### Using the get_ad_comments_with_http_info variant
129
+
130
+ This returns an Array which contains the response data, status code and headers.
131
+
132
+ > <Array(<GetAdComments200Response>, Integer, Hash)> get_ad_comments_with_http_info(ad_id, opts)
133
+
134
+ ```ruby
135
+ begin
136
+ # List comments on an ad
137
+ data, status_code, headers = api_instance.get_ad_comments_with_http_info(ad_id, opts)
138
+ p status_code # => 2xx
139
+ p headers # => { ... }
140
+ p data # => <GetAdComments200Response>
141
+ rescue Zernio::ApiError => e
142
+ puts "Error when calling AdAccountsApi->get_ad_comments_with_http_info: #{e}"
143
+ end
144
+ ```
145
+
146
+ ### Parameters
147
+
148
+ | Name | Type | Description | Notes |
149
+ | ---- | ---- | ----------- | ----- |
150
+ | **ad_id** | **String** | Internal Zernio ad ID (ObjectId). | |
151
+ | **placement** | **String** | Which side of the ad to return comments for. Omit to default to the Instagram side when present, else Facebook. Returns ad_not_commentable if the ad has no such placement. | [optional] |
152
+ | **limit** | **Integer** | | [optional][default to 25] |
153
+ | **cursor** | **String** | Pagination cursor from a previous response. | [optional] |
154
+
155
+ ### Return type
156
+
157
+ [**GetAdComments200Response**](GetAdComments200Response.md)
158
+
159
+ ### Authorization
160
+
161
+ [bearerAuth](../README.md#bearerAuth)
162
+
163
+ ### HTTP request headers
164
+
165
+ - **Content-Type**: Not defined
166
+ - **Accept**: application/json
167
+
168
+
169
+ ## get_ads_activity_log
170
+
171
+ > <GetAdsActivityLog200Response> get_ads_activity_log(account_id, ad_account_id, opts)
172
+
173
+ Ad account change / audit log
174
+
175
+ Account-level audit log from Meta's `/act_X/activities`: who changed what and when (creates, edits, status flips, budget changes...) with Meta's translated event names and the structured before/after in `extra_data`. Rows are returned verbatim. Meta has no server-side per-object filter on this edge, so `objectId` filters the returned page client-side (combine with paging to walk history for one campaign/ad set/ad).
176
+
177
+ ### Examples
178
+
179
+ ```ruby
180
+ require 'time'
181
+ require 'zernio-sdk'
182
+ # setup authorization
183
+ Zernio.configure do |config|
184
+ # Configure Bearer authorization (JWT): bearerAuth
185
+ config.access_token = 'YOUR_BEARER_TOKEN'
186
+ end
187
+
188
+ api_instance = Zernio::AdAccountsApi.new
189
+ account_id = 'account_id_example' # String | Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
190
+ ad_account_id = 'ad_account_id_example' # String | Meta ad account id (act_<n>).
191
+ opts = {
192
+ since: Date.parse('2013-10-20'), # Date | Start of range (YYYY-MM-DD).
193
+ _until: Date.parse('2013-10-20'), # Date | End of range (YYYY-MM-DD).
194
+ object_id: 'object_id_example', # String | Client-side filter to one Meta object id (campaign, ad set or ad).
195
+ limit: 56, # Integer | Rows per page
196
+ after: 'after_example' # String | Cursor from paging.after of the previous page.
197
+ }
198
+
199
+ begin
200
+ # Ad account change / audit log
201
+ result = api_instance.get_ads_activity_log(account_id, ad_account_id, opts)
202
+ p result
203
+ rescue Zernio::ApiError => e
204
+ puts "Error when calling AdAccountsApi->get_ads_activity_log: #{e}"
205
+ end
206
+ ```
207
+
208
+ #### Using the get_ads_activity_log_with_http_info variant
209
+
210
+ This returns an Array which contains the response data, status code and headers.
211
+
212
+ > <Array(<GetAdsActivityLog200Response>, Integer, Hash)> get_ads_activity_log_with_http_info(account_id, ad_account_id, opts)
213
+
214
+ ```ruby
215
+ begin
216
+ # Ad account change / audit log
217
+ data, status_code, headers = api_instance.get_ads_activity_log_with_http_info(account_id, ad_account_id, opts)
218
+ p status_code # => 2xx
219
+ p headers # => { ... }
220
+ p data # => <GetAdsActivityLog200Response>
221
+ rescue Zernio::ApiError => e
222
+ puts "Error when calling AdAccountsApi->get_ads_activity_log_with_http_info: #{e}"
223
+ end
224
+ ```
225
+
226
+ ### Parameters
227
+
228
+ | Name | Type | Description | Notes |
229
+ | ---- | ---- | ----------- | ----- |
230
+ | **account_id** | **String** | Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token. | |
231
+ | **ad_account_id** | **String** | Meta ad account id (act_&lt;n&gt;). | |
232
+ | **since** | **Date** | Start of range (YYYY-MM-DD). | [optional] |
233
+ | **_until** | **Date** | End of range (YYYY-MM-DD). | [optional] |
234
+ | **object_id** | **String** | Client-side filter to one Meta object id (campaign, ad set or ad). | [optional] |
235
+ | **limit** | **Integer** | Rows per page | [optional][default to 50] |
236
+ | **after** | **String** | Cursor from paging.after of the previous page. | [optional] |
237
+
238
+ ### Return type
239
+
240
+ [**GetAdsActivityLog200Response**](GetAdsActivityLog200Response.md)
241
+
242
+ ### Authorization
243
+
244
+ [bearerAuth](../README.md#bearerAuth)
245
+
246
+ ### HTTP request headers
247
+
248
+ - **Content-Type**: Not defined
249
+ - **Accept**: application/json
250
+
251
+
252
+ ## get_dsa_defaults
253
+
254
+ > <UpdateAdAccount200Response> get_dsa_defaults(account_id, ad_account_id)
255
+
256
+ Get ad account DSA defaults
257
+
258
+ Returns the default DSA beneficiary and payor currently set on a Meta ad account, whether they were set via `PATCH /v1/ads/accounts` or in Meta Ads Manager. Fields are omitted when no default is configured. Meta accounts only.
259
+
260
+ ### Examples
261
+
262
+ ```ruby
263
+ require 'time'
264
+ require 'zernio-sdk'
265
+ # setup authorization
266
+ Zernio.configure do |config|
267
+ # Configure Bearer authorization (JWT): bearerAuth
268
+ config.access_token = 'YOUR_BEARER_TOKEN'
269
+ end
270
+
271
+ api_instance = Zernio::AdAccountsApi.new
272
+ account_id = 'account_id_example' # String | Social account ID (metaads, or a facebook/instagram posting account)
273
+ ad_account_id = 'ad_account_id_example' # String | Meta ad account ID (act_...)
274
+
275
+ begin
276
+ # Get ad account DSA defaults
277
+ result = api_instance.get_dsa_defaults(account_id, ad_account_id)
278
+ p result
279
+ rescue Zernio::ApiError => e
280
+ puts "Error when calling AdAccountsApi->get_dsa_defaults: #{e}"
281
+ end
282
+ ```
283
+
284
+ #### Using the get_dsa_defaults_with_http_info variant
285
+
286
+ This returns an Array which contains the response data, status code and headers.
287
+
288
+ > <Array(<UpdateAdAccount200Response>, Integer, Hash)> get_dsa_defaults_with_http_info(account_id, ad_account_id)
289
+
290
+ ```ruby
291
+ begin
292
+ # Get ad account DSA defaults
293
+ data, status_code, headers = api_instance.get_dsa_defaults_with_http_info(account_id, ad_account_id)
294
+ p status_code # => 2xx
295
+ p headers # => { ... }
296
+ p data # => <UpdateAdAccount200Response>
297
+ rescue Zernio::ApiError => e
298
+ puts "Error when calling AdAccountsApi->get_dsa_defaults_with_http_info: #{e}"
299
+ end
300
+ ```
301
+
302
+ ### Parameters
303
+
304
+ | Name | Type | Description | Notes |
305
+ | ---- | ---- | ----------- | ----- |
306
+ | **account_id** | **String** | Social account ID (metaads, or a facebook/instagram posting account) | |
307
+ | **ad_account_id** | **String** | Meta ad account ID (act_...) | |
308
+
309
+ ### Return type
310
+
311
+ [**UpdateAdAccount200Response**](UpdateAdAccount200Response.md)
312
+
313
+ ### Authorization
314
+
315
+ [bearerAuth](../README.md#bearerAuth)
316
+
317
+ ### HTTP request headers
318
+
319
+ - **Content-Type**: Not defined
320
+ - **Accept**: application/json
321
+
322
+
323
+ ## get_dsa_recommendations
324
+
325
+ > <GetDsaRecommendations200Response> get_dsa_recommendations(account_id, ad_account_id)
326
+
327
+ List DSA beneficiary/payor suggestions
328
+
329
+ Returns Meta's suggested beneficiary/payor names for an ad account, derived by Meta from the account's recent activity. Useful for prefilling `dsaBeneficiary`/`dsaPayor` inputs, or the defaults sent to `PATCH /v1/ads/accounts`, in your own UI. Meta returns a single flat list. Entries are not labeled as beneficiary or payor, and since these are legal disclosures Zernio never applies them automatically: let your user pick the right entity. The list may be empty for accounts with little activity. Meta accounts only.
330
+
331
+ ### Examples
332
+
333
+ ```ruby
334
+ require 'time'
335
+ require 'zernio-sdk'
336
+ # setup authorization
337
+ Zernio.configure do |config|
338
+ # Configure Bearer authorization (JWT): bearerAuth
339
+ config.access_token = 'YOUR_BEARER_TOKEN'
340
+ end
341
+
342
+ api_instance = Zernio::AdAccountsApi.new
343
+ account_id = 'account_id_example' # String | Social account ID (metaads, or a facebook/instagram posting account)
344
+ ad_account_id = 'ad_account_id_example' # String | Meta ad account ID (act_...)
345
+
346
+ begin
347
+ # List DSA beneficiary/payor suggestions
348
+ result = api_instance.get_dsa_recommendations(account_id, ad_account_id)
349
+ p result
350
+ rescue Zernio::ApiError => e
351
+ puts "Error when calling AdAccountsApi->get_dsa_recommendations: #{e}"
352
+ end
353
+ ```
354
+
355
+ #### Using the get_dsa_recommendations_with_http_info variant
356
+
357
+ This returns an Array which contains the response data, status code and headers.
358
+
359
+ > <Array(<GetDsaRecommendations200Response>, Integer, Hash)> get_dsa_recommendations_with_http_info(account_id, ad_account_id)
360
+
361
+ ```ruby
362
+ begin
363
+ # List DSA beneficiary/payor suggestions
364
+ data, status_code, headers = api_instance.get_dsa_recommendations_with_http_info(account_id, ad_account_id)
365
+ p status_code # => 2xx
366
+ p headers # => { ... }
367
+ p data # => <GetDsaRecommendations200Response>
368
+ rescue Zernio::ApiError => e
369
+ puts "Error when calling AdAccountsApi->get_dsa_recommendations_with_http_info: #{e}"
370
+ end
371
+ ```
372
+
373
+ ### Parameters
374
+
375
+ | Name | Type | Description | Notes |
376
+ | ---- | ---- | ----------- | ----- |
377
+ | **account_id** | **String** | Social account ID (metaads, or a facebook/instagram posting account) | |
378
+ | **ad_account_id** | **String** | Meta ad account ID (act_...) | |
379
+
380
+ ### Return type
381
+
382
+ [**GetDsaRecommendations200Response**](GetDsaRecommendations200Response.md)
383
+
384
+ ### Authorization
385
+
386
+ [bearerAuth](../README.md#bearerAuth)
387
+
388
+ ### HTTP request headers
389
+
390
+ - **Content-Type**: Not defined
391
+ - **Accept**: application/json
392
+
393
+
394
+ ## list_ad_accounts
395
+
396
+ > <ListAdAccounts200Response> list_ad_accounts(account_id, opts)
397
+
398
+ List ad accounts
399
+
400
+ Returns the platform ad accounts available for the given social account (e.g. Meta ad accounts, TikTok advertiser IDs, Google Ads customer IDs). For TikTok agencies: enumerates every advertiser under every Business Center the token can read (paginated server-side), then chunks the lookup against TikTok's `/advertiser/info/` endpoint (which has a per-call cap of ≤100 IDs). Solo advertisers without a BC fall back to the OAuth-time `advertiser_ids` list. Cached for 1h on the SocialAccount; lazy-refreshed on first call after expiry.
401
+
402
+ ### Examples
403
+
404
+ ```ruby
405
+ require 'time'
406
+ require 'zernio-sdk'
407
+ # setup authorization
408
+ Zernio.configure do |config|
409
+ # Configure Bearer authorization (JWT): bearerAuth
410
+ config.access_token = 'YOUR_BEARER_TOKEN'
411
+ end
412
+
413
+ api_instance = Zernio::AdAccountsApi.new
414
+ account_id = 'account_id_example' # String | Social account ID
415
+ opts = {
416
+ ad_account_id: 'ad_account_id_example', # String | Filter response to a single platform ad account ID (e.g. `act_123` for Meta, advertiser_id for TikTok). Returns at most one item.
417
+ limit: 56 # Integer | Clamp the returned `accounts[]` length. Useful for typeahead pickers on agency tokens with hundreds of advertisers.
418
+ }
419
+
420
+ begin
421
+ # List ad accounts
422
+ result = api_instance.list_ad_accounts(account_id, opts)
423
+ p result
424
+ rescue Zernio::ApiError => e
425
+ puts "Error when calling AdAccountsApi->list_ad_accounts: #{e}"
426
+ end
427
+ ```
428
+
429
+ #### Using the list_ad_accounts_with_http_info variant
430
+
431
+ This returns an Array which contains the response data, status code and headers.
432
+
433
+ > <Array(<ListAdAccounts200Response>, Integer, Hash)> list_ad_accounts_with_http_info(account_id, opts)
434
+
435
+ ```ruby
436
+ begin
437
+ # List ad accounts
438
+ data, status_code, headers = api_instance.list_ad_accounts_with_http_info(account_id, opts)
439
+ p status_code # => 2xx
440
+ p headers # => { ... }
441
+ p data # => <ListAdAccounts200Response>
442
+ rescue Zernio::ApiError => e
443
+ puts "Error when calling AdAccountsApi->list_ad_accounts_with_http_info: #{e}"
444
+ end
445
+ ```
446
+
447
+ ### Parameters
448
+
449
+ | Name | Type | Description | Notes |
450
+ | ---- | ---- | ----------- | ----- |
451
+ | **account_id** | **String** | Social account ID | |
452
+ | **ad_account_id** | **String** | Filter response to a single platform ad account ID (e.g. &#x60;act_123&#x60; for Meta, advertiser_id for TikTok). Returns at most one item. | [optional] |
453
+ | **limit** | **Integer** | Clamp the returned &#x60;accounts[]&#x60; length. Useful for typeahead pickers on agency tokens with hundreds of advertisers. | [optional] |
454
+
455
+ ### Return type
456
+
457
+ [**ListAdAccounts200Response**](ListAdAccounts200Response.md)
458
+
459
+ ### Authorization
460
+
461
+ [bearerAuth](../README.md#bearerAuth)
462
+
463
+ ### HTTP request headers
464
+
465
+ - **Content-Type**: Not defined
466
+ - **Accept**: application/json
467
+
468
+
469
+ ## list_ad_labels
470
+
471
+ > <ListAdLabels200Response> list_ad_labels(account_id, ad_account_id, opts)
472
+
473
+ Ad labels
474
+
475
+ Lists the ad account's organizational labels (Meta's `/act_X/adlabels`), rows returned verbatim (id, name, created/updated time).
476
+
477
+ ### Examples
478
+
479
+ ```ruby
480
+ require 'time'
481
+ require 'zernio-sdk'
482
+ # setup authorization
483
+ Zernio.configure do |config|
484
+ # Configure Bearer authorization (JWT): bearerAuth
485
+ config.access_token = 'YOUR_BEARER_TOKEN'
486
+ end
487
+
488
+ api_instance = Zernio::AdAccountsApi.new
489
+ account_id = 'account_id_example' # String | Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
490
+ ad_account_id = 'ad_account_id_example' # String | Meta ad account id (act_<n>).
491
+ opts = {
492
+ limit: 56, # Integer | Rows per page
493
+ after: 'after_example' # String | Cursor from paging.after of the previous page.
494
+ }
495
+
496
+ begin
497
+ # Ad labels
498
+ result = api_instance.list_ad_labels(account_id, ad_account_id, opts)
499
+ p result
500
+ rescue Zernio::ApiError => e
501
+ puts "Error when calling AdAccountsApi->list_ad_labels: #{e}"
502
+ end
503
+ ```
504
+
505
+ #### Using the list_ad_labels_with_http_info variant
506
+
507
+ This returns an Array which contains the response data, status code and headers.
508
+
509
+ > <Array(<ListAdLabels200Response>, Integer, Hash)> list_ad_labels_with_http_info(account_id, ad_account_id, opts)
510
+
511
+ ```ruby
512
+ begin
513
+ # Ad labels
514
+ data, status_code, headers = api_instance.list_ad_labels_with_http_info(account_id, ad_account_id, opts)
515
+ p status_code # => 2xx
516
+ p headers # => { ... }
517
+ p data # => <ListAdLabels200Response>
518
+ rescue Zernio::ApiError => e
519
+ puts "Error when calling AdAccountsApi->list_ad_labels_with_http_info: #{e}"
520
+ end
521
+ ```
522
+
523
+ ### Parameters
524
+
525
+ | Name | Type | Description | Notes |
526
+ | ---- | ---- | ----------- | ----- |
527
+ | **account_id** | **String** | Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token. | |
528
+ | **ad_account_id** | **String** | Meta ad account id (act_&lt;n&gt;). | |
529
+ | **limit** | **Integer** | Rows per page | [optional][default to 25] |
530
+ | **after** | **String** | Cursor from paging.after of the previous page. | [optional] |
531
+
532
+ ### Return type
533
+
534
+ [**ListAdLabels200Response**](ListAdLabels200Response.md)
535
+
536
+ ### Authorization
537
+
538
+ [bearerAuth](../README.md#bearerAuth)
539
+
540
+ ### HTTP request headers
541
+
542
+ - **Content-Type**: Not defined
543
+ - **Accept**: application/json
544
+
545
+
546
+ ## list_ad_studies
547
+
548
+ > <ListAdStudies200Response> list_ad_studies(account_id, ad_account_id, opts)
549
+
550
+ A/B tests and lift studies
551
+
552
+ Lists the ad account's A/B tests and lift studies (Meta's `/act_X/ad_studies`), rows returned verbatim. The default projection covers id, name, type, timing and cells with split percentages; `fields` is a raw-passthrough override.
553
+
554
+ ### Examples
555
+
556
+ ```ruby
557
+ require 'time'
558
+ require 'zernio-sdk'
559
+ # setup authorization
560
+ Zernio.configure do |config|
561
+ # Configure Bearer authorization (JWT): bearerAuth
562
+ config.access_token = 'YOUR_BEARER_TOKEN'
563
+ end
564
+
565
+ api_instance = Zernio::AdAccountsApi.new
566
+ account_id = 'account_id_example' # String | Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
567
+ ad_account_id = 'ad_account_id_example' # String | Meta ad account id (act_<n>).
568
+ opts = {
569
+ fields: 'fields_example', # String | Comma-separated Graph field override (supports nested {} projections).
570
+ limit: 56, # Integer | Rows per page
571
+ after: 'after_example' # String | Cursor from paging.after of the previous page.
572
+ }
573
+
574
+ begin
575
+ # A/B tests and lift studies
576
+ result = api_instance.list_ad_studies(account_id, ad_account_id, opts)
577
+ p result
578
+ rescue Zernio::ApiError => e
579
+ puts "Error when calling AdAccountsApi->list_ad_studies: #{e}"
580
+ end
581
+ ```
582
+
583
+ #### Using the list_ad_studies_with_http_info variant
584
+
585
+ This returns an Array which contains the response data, status code and headers.
586
+
587
+ > <Array(<ListAdStudies200Response>, Integer, Hash)> list_ad_studies_with_http_info(account_id, ad_account_id, opts)
588
+
589
+ ```ruby
590
+ begin
591
+ # A/B tests and lift studies
592
+ data, status_code, headers = api_instance.list_ad_studies_with_http_info(account_id, ad_account_id, opts)
593
+ p status_code # => 2xx
594
+ p headers # => { ... }
595
+ p data # => <ListAdStudies200Response>
596
+ rescue Zernio::ApiError => e
597
+ puts "Error when calling AdAccountsApi->list_ad_studies_with_http_info: #{e}"
598
+ end
599
+ ```
600
+
601
+ ### Parameters
602
+
603
+ | Name | Type | Description | Notes |
604
+ | ---- | ---- | ----------- | ----- |
605
+ | **account_id** | **String** | Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token. | |
606
+ | **ad_account_id** | **String** | Meta ad account id (act_&lt;n&gt;). | |
607
+ | **fields** | **String** | Comma-separated Graph field override (supports nested {} projections). | [optional] |
608
+ | **limit** | **Integer** | Rows per page | [optional][default to 25] |
609
+ | **after** | **String** | Cursor from paging.after of the previous page. | [optional] |
610
+
611
+ ### Return type
612
+
613
+ [**ListAdStudies200Response**](ListAdStudies200Response.md)
614
+
615
+ ### Authorization
616
+
617
+ [bearerAuth](../README.md#bearerAuth)
618
+
619
+ ### HTTP request headers
620
+
621
+ - **Content-Type**: Not defined
622
+ - **Accept**: application/json
623
+
624
+
625
+ ## list_ads_business_centers
626
+
627
+ > <ListAdsBusinessCenters200Response> list_ads_business_centers(account_id)
628
+
629
+ List TikTok Business Centers
630
+
631
+ Returns the TikTok Business Centers (BCs) the connected `tiktokads` account can read. Each BC reports its advertiser count so callers can build agency-style pickers without re-walking `/v1/ads/accounts` per BC. TikTok-only. Solo advertisers (non-agency tokens) return an empty array.
632
+
633
+ ### Examples
634
+
635
+ ```ruby
636
+ require 'time'
637
+ require 'zernio-sdk'
638
+ # setup authorization
639
+ Zernio.configure do |config|
640
+ # Configure Bearer authorization (JWT): bearerAuth
641
+ config.access_token = 'YOUR_BEARER_TOKEN'
642
+ end
643
+
644
+ api_instance = Zernio::AdAccountsApi.new
645
+ account_id = 'account_id_example' # String | ID of the `tiktokads` (or parent `tiktok` posting) SocialAccount
646
+
647
+ begin
648
+ # List TikTok Business Centers
649
+ result = api_instance.list_ads_business_centers(account_id)
650
+ p result
651
+ rescue Zernio::ApiError => e
652
+ puts "Error when calling AdAccountsApi->list_ads_business_centers: #{e}"
653
+ end
654
+ ```
655
+
656
+ #### Using the list_ads_business_centers_with_http_info variant
657
+
658
+ This returns an Array which contains the response data, status code and headers.
659
+
660
+ > <Array(<ListAdsBusinessCenters200Response>, Integer, Hash)> list_ads_business_centers_with_http_info(account_id)
661
+
662
+ ```ruby
663
+ begin
664
+ # List TikTok Business Centers
665
+ data, status_code, headers = api_instance.list_ads_business_centers_with_http_info(account_id)
666
+ p status_code # => 2xx
667
+ p headers # => { ... }
668
+ p data # => <ListAdsBusinessCenters200Response>
669
+ rescue Zernio::ApiError => e
670
+ puts "Error when calling AdAccountsApi->list_ads_business_centers_with_http_info: #{e}"
671
+ end
672
+ ```
673
+
674
+ ### Parameters
675
+
676
+ | Name | Type | Description | Notes |
677
+ | ---- | ---- | ----------- | ----- |
678
+ | **account_id** | **String** | ID of the &#x60;tiktokads&#x60; (or parent &#x60;tiktok&#x60; posting) SocialAccount | |
679
+
680
+ ### Return type
681
+
682
+ [**ListAdsBusinessCenters200Response**](ListAdsBusinessCenters200Response.md)
683
+
684
+ ### Authorization
685
+
686
+ [bearerAuth](../README.md#bearerAuth)
687
+
688
+ ### HTTP request headers
689
+
690
+ - **Content-Type**: Not defined
691
+ - **Accept**: application/json
692
+
693
+
694
+ ## list_high_demand_periods
695
+
696
+ > <ListHighDemandPeriods200Response> list_high_demand_periods(account_id, opts)
697
+
698
+ High demand periods / budget schedules
699
+
700
+ Scheduled budget increases (Meta's budget-scheduling API). The Graph edge lives on the campaign and ad-set nodes only, so exactly one of `campaignId` / `adSetId` (platform ids) is required. Rows returned verbatim (budget_value, budget_value_type, time window, recurrence).
701
+
702
+ ### Examples
703
+
704
+ ```ruby
705
+ require 'time'
706
+ require 'zernio-sdk'
707
+ # setup authorization
708
+ Zernio.configure do |config|
709
+ # Configure Bearer authorization (JWT): bearerAuth
710
+ config.access_token = 'YOUR_BEARER_TOKEN'
711
+ end
712
+
713
+ api_instance = Zernio::AdAccountsApi.new
714
+ account_id = 'account_id_example' # String | Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
715
+ opts = {
716
+ campaign_id: 'campaign_id_example', # String | Platform campaign id. Exactly one of campaignId / adSetId.
717
+ ad_set_id: 'ad_set_id_example', # String | Platform ad set id. Exactly one of campaignId / adSetId.
718
+ limit: 56, # Integer | Rows per page
719
+ after: 'after_example' # String | Cursor from paging.after of the previous page.
720
+ }
721
+
722
+ begin
723
+ # High demand periods / budget schedules
724
+ result = api_instance.list_high_demand_periods(account_id, opts)
725
+ p result
726
+ rescue Zernio::ApiError => e
727
+ puts "Error when calling AdAccountsApi->list_high_demand_periods: #{e}"
728
+ end
729
+ ```
730
+
731
+ #### Using the list_high_demand_periods_with_http_info variant
732
+
733
+ This returns an Array which contains the response data, status code and headers.
734
+
735
+ > <Array(<ListHighDemandPeriods200Response>, Integer, Hash)> list_high_demand_periods_with_http_info(account_id, opts)
736
+
737
+ ```ruby
738
+ begin
739
+ # High demand periods / budget schedules
740
+ data, status_code, headers = api_instance.list_high_demand_periods_with_http_info(account_id, opts)
741
+ p status_code # => 2xx
742
+ p headers # => { ... }
743
+ p data # => <ListHighDemandPeriods200Response>
744
+ rescue Zernio::ApiError => e
745
+ puts "Error when calling AdAccountsApi->list_high_demand_periods_with_http_info: #{e}"
746
+ end
747
+ ```
748
+
749
+ ### Parameters
750
+
751
+ | Name | Type | Description | Notes |
752
+ | ---- | ---- | ----------- | ----- |
753
+ | **account_id** | **String** | Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token. | |
754
+ | **campaign_id** | **String** | Platform campaign id. Exactly one of campaignId / adSetId. | [optional] |
755
+ | **ad_set_id** | **String** | Platform ad set id. Exactly one of campaignId / adSetId. | [optional] |
756
+ | **limit** | **Integer** | Rows per page | [optional][default to 25] |
757
+ | **after** | **String** | Cursor from paging.after of the previous page. | [optional] |
758
+
759
+ ### Return type
760
+
761
+ [**ListHighDemandPeriods200Response**](ListHighDemandPeriods200Response.md)
762
+
763
+ ### Authorization
764
+
765
+ [bearerAuth](../README.md#bearerAuth)
766
+
767
+ ### HTTP request headers
768
+
769
+ - **Content-Type**: Not defined
770
+ - **Accept**: application/json
771
+
772
+
773
+ ## list_meta_businesses
774
+
775
+ > <ListMetaBusinesses200Response> list_meta_businesses(account_id, opts)
776
+
777
+ Businesses list
778
+
779
+ Business Manager portfolios the connected Meta user belongs to (Meta's `/me/businesses`), rows returned verbatim (id, name, verification_status, created_time). Token-scoped, so no `adAccountId` is needed. For TikTok Business Centers use `GET /v1/ads/business-centers`.
780
+
781
+ ### Examples
782
+
783
+ ```ruby
784
+ require 'time'
785
+ require 'zernio-sdk'
786
+ # setup authorization
787
+ Zernio.configure do |config|
788
+ # Configure Bearer authorization (JWT): bearerAuth
789
+ config.access_token = 'YOUR_BEARER_TOKEN'
790
+ end
791
+
792
+ api_instance = Zernio::AdAccountsApi.new
793
+ account_id = 'account_id_example' # String | Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
794
+ opts = {
795
+ limit: 56, # Integer | Rows per page
796
+ after: 'after_example' # String | Cursor from paging.after of the previous page.
797
+ }
798
+
799
+ begin
800
+ # Businesses list
801
+ result = api_instance.list_meta_businesses(account_id, opts)
802
+ p result
803
+ rescue Zernio::ApiError => e
804
+ puts "Error when calling AdAccountsApi->list_meta_businesses: #{e}"
805
+ end
806
+ ```
807
+
808
+ #### Using the list_meta_businesses_with_http_info variant
809
+
810
+ This returns an Array which contains the response data, status code and headers.
811
+
812
+ > <Array(<ListMetaBusinesses200Response>, Integer, Hash)> list_meta_businesses_with_http_info(account_id, opts)
813
+
814
+ ```ruby
815
+ begin
816
+ # Businesses list
817
+ data, status_code, headers = api_instance.list_meta_businesses_with_http_info(account_id, opts)
818
+ p status_code # => 2xx
819
+ p headers # => { ... }
820
+ p data # => <ListMetaBusinesses200Response>
821
+ rescue Zernio::ApiError => e
822
+ puts "Error when calling AdAccountsApi->list_meta_businesses_with_http_info: #{e}"
823
+ end
824
+ ```
825
+
826
+ ### Parameters
827
+
828
+ | Name | Type | Description | Notes |
829
+ | ---- | ---- | ----------- | ----- |
830
+ | **account_id** | **String** | Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token. | |
831
+ | **limit** | **Integer** | Rows per page | [optional][default to 25] |
832
+ | **after** | **String** | Cursor from paging.after of the previous page. | [optional] |
833
+
834
+ ### Return type
835
+
836
+ [**ListMetaBusinesses200Response**](ListMetaBusinesses200Response.md)
837
+
838
+ ### Authorization
839
+
840
+ [bearerAuth](../README.md#bearerAuth)
841
+
842
+ ### HTTP request headers
843
+
844
+ - **Content-Type**: Not defined
845
+ - **Accept**: application/json
846
+
847
+
848
+ ## update_ad_account
849
+
850
+ > <UpdateAdAccount200Response> update_ad_account(update_ad_account_request)
851
+
852
+ Update ad account settings
853
+
854
+ Sets the default DSA beneficiary and payor on a Meta ad account (EU DSA, Article 26). Set them once and every EU-targeted call to `/v1/ads/create`, `/v1/ads/boost` and `/v1/ads/ctwa` on that ad account can omit `dsaBeneficiary`/`dsaPayor`: Meta applies the defaults automatically. The values are written to the ad account on Meta, the same setting Ads Manager edits. Nothing is stored in Zernio, and defaults already set in Ads Manager work identically. Zernio never guesses these values for you. Beneficiary and payor are legal disclosures shown to EU users, so you must provide the entity names explicitly. Use `GET /v1/ads/dsa-recommendations` to offer suggestions in your UI. If `defaultDsaPayor` is omitted, the beneficiary is also set as the payor, which covers the common case where the same entity benefits from and pays for the ads. Read the current values back with `GET /v1/ads/dsa-defaults`. Currently supported for Meta accounts only; other platforms return 400.
855
+
856
+ ### Examples
857
+
858
+ ```ruby
859
+ require 'time'
860
+ require 'zernio-sdk'
861
+ # setup authorization
862
+ Zernio.configure do |config|
863
+ # Configure Bearer authorization (JWT): bearerAuth
864
+ config.access_token = 'YOUR_BEARER_TOKEN'
865
+ end
866
+
867
+ api_instance = Zernio::AdAccountsApi.new
868
+ update_ad_account_request = Zernio::UpdateAdAccountRequest.new({account_id: 'account_id_example', ad_account_id: 'ad_account_id_example', default_dsa_beneficiary: 'default_dsa_beneficiary_example'}) # UpdateAdAccountRequest |
869
+
870
+ begin
871
+ # Update ad account settings
872
+ result = api_instance.update_ad_account(update_ad_account_request)
873
+ p result
874
+ rescue Zernio::ApiError => e
875
+ puts "Error when calling AdAccountsApi->update_ad_account: #{e}"
876
+ end
877
+ ```
878
+
879
+ #### Using the update_ad_account_with_http_info variant
880
+
881
+ This returns an Array which contains the response data, status code and headers.
882
+
883
+ > <Array(<UpdateAdAccount200Response>, Integer, Hash)> update_ad_account_with_http_info(update_ad_account_request)
884
+
885
+ ```ruby
886
+ begin
887
+ # Update ad account settings
888
+ data, status_code, headers = api_instance.update_ad_account_with_http_info(update_ad_account_request)
889
+ p status_code # => 2xx
890
+ p headers # => { ... }
891
+ p data # => <UpdateAdAccount200Response>
892
+ rescue Zernio::ApiError => e
893
+ puts "Error when calling AdAccountsApi->update_ad_account_with_http_info: #{e}"
894
+ end
895
+ ```
896
+
897
+ ### Parameters
898
+
899
+ | Name | Type | Description | Notes |
900
+ | ---- | ---- | ----------- | ----- |
901
+ | **update_ad_account_request** | [**UpdateAdAccountRequest**](UpdateAdAccountRequest.md) | | |
902
+
903
+ ### Return type
904
+
905
+ [**UpdateAdAccount200Response**](UpdateAdAccount200Response.md)
906
+
907
+ ### Authorization
908
+
909
+ [bearerAuth](../README.md#bearerAuth)
910
+
911
+ ### HTTP request headers
912
+
913
+ - **Content-Type**: application/json
914
+ - **Accept**: application/json
915
+