late-sdk 0.0.549 → 0.0.551

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 (53) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +72 -74
  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/ConversionsApi.md +890 -0
  10. data/docs/LeadGenApi.md +527 -0
  11. data/docs/MessagingAdsApi.md +215 -0
  12. data/docs/ReachAndFrequencyApi.md +294 -0
  13. data/docs/TrackingTagsApi.md +141 -0
  14. data/docs/YouTubeDailyViewsResponse.md +2 -0
  15. data/docs/YouTubeDemographicsResponse.md +2 -0
  16. data/docs/YouTubeVideoRetentionResponse.md +2 -0
  17. data/lib/zernio-sdk/api/ad_accounts_api.rb +958 -0
  18. data/lib/zernio-sdk/api/ad_campaigns_api.rb +618 -12
  19. data/lib/zernio-sdk/api/ad_creatives_api.rb +826 -0
  20. data/lib/zernio-sdk/api/ad_insights_api.rb +446 -0
  21. data/lib/zernio-sdk/api/ad_targeting_api.rb +404 -0
  22. data/lib/zernio-sdk/api/analytics_api.rb +8 -8
  23. data/lib/zernio-sdk/api/conversions_api.rb +936 -0
  24. data/lib/zernio-sdk/api/lead_gen_api.rb +547 -0
  25. data/lib/zernio-sdk/api/messaging_ads_api.rb +226 -0
  26. data/lib/zernio-sdk/api/reach_and_frequency_api.rb +316 -0
  27. data/lib/zernio-sdk/api/tracking_tags_api.rb +137 -0
  28. data/lib/zernio-sdk/models/you_tube_daily_views_response.rb +11 -1
  29. data/lib/zernio-sdk/models/you_tube_demographics_response.rb +11 -1
  30. data/lib/zernio-sdk/models/you_tube_video_retention_response.rb +11 -1
  31. data/lib/zernio-sdk/version.rb +1 -1
  32. data/lib/zernio-sdk.rb +8 -1
  33. data/openapi.yaml +321 -162
  34. data/spec/api/ad_accounts_api_spec.rb +206 -0
  35. data/spec/api/ad_campaigns_api_spec.rb +119 -6
  36. data/spec/api/ad_creatives_api_spec.rb +182 -0
  37. data/spec/api/ad_insights_api_spec.rb +120 -0
  38. data/spec/api/ad_targeting_api_spec.rb +101 -0
  39. data/spec/api/analytics_api_spec.rb +4 -4
  40. data/spec/api/conversions_api_spec.rb +199 -0
  41. data/spec/api/lead_gen_api_spec.rb +131 -0
  42. data/spec/api/messaging_ads_api_spec.rb +71 -0
  43. data/spec/api/reach_and_frequency_api_spec.rb +87 -0
  44. data/spec/api/tracking_tags_api_spec.rb +25 -0
  45. data/spec/models/you_tube_daily_views_response_spec.rb +6 -0
  46. data/spec/models/you_tube_demographics_response_spec.rb +6 -0
  47. data/spec/models/you_tube_video_retention_response_spec.rb +6 -0
  48. data/zernio-sdk-0.0.551.gem +0 -0
  49. metadata +35 -7
  50. data/docs/AdsApi.md +0 -5278
  51. data/lib/zernio-sdk/api/ads_api.rb +0 -5391
  52. data/spec/api/ads_api_spec.rb +0 -1015
  53. data/zernio-sdk-0.0.549.gem +0 -0
@@ -1,1015 +0,0 @@
1
- =begin
2
- #Zernio API
3
-
4
- #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
5
-
6
- The version of the OpenAPI document: 1.0.4
7
- Contact: support@zernio.com
8
- Generated by: https://openapi-generator.tech
9
- Generator version: 7.19.0
10
-
11
- =end
12
-
13
- require 'spec_helper'
14
- require 'json'
15
-
16
- # Unit tests for Zernio::AdsApi
17
- # Automatically generated by openapi-generator (https://openapi-generator.tech)
18
- # Please update as you see appropriate
19
- describe 'AdsApi' do
20
- before do
21
- # run before each test
22
- @api_instance = Zernio::AdsApi.new
23
- end
24
-
25
- after do
26
- # run after each test
27
- end
28
-
29
- describe 'test an instance of AdsApi' do
30
- it 'should create an instance of AdsApi' do
31
- expect(@api_instance).to be_instance_of(Zernio::AdsApi)
32
- end
33
- end
34
-
35
- # unit tests for add_conversion_associations
36
- # Associate campaigns
37
- # Associate one or more campaigns with this conversion rule. Returns a per-campaign success/failure result so callers can retry only the rows that failed (e.g. wrong campaign type for the rule's objective).
38
- # @param account_id
39
- # @param destination_id
40
- # @param add_conversion_associations_request
41
- # @param [Hash] opts the optional parameters
42
- # @return [AddConversionAssociations200Response]
43
- describe 'add_conversion_associations test' do
44
- it 'should work' do
45
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
46
- end
47
- end
48
-
49
- # unit tests for adjust_conversions
50
- # Adjust uploaded conversions
51
- # Adjust conversions that were previously uploaded via `POST /v1/ads/conversions` — retract them, restate their value, or enhance them with first-party data. Requires the Ads add-on. **Google Ads only.** Google handles adjustments through the classic Google Ads API (`ConversionAdjustmentUploadService`); the Data Manager `ingestEvents` path used for sending conversions is ingest-only. Meta and LinkedIn have no equivalent, so this endpoint returns `405` for those platforms. Adjustment types: - `RETRACTION` — remove the conversion entirely (refund, chargeback, cancelled order, churn). - `RESTATEMENT` — change the conversion's value (upgrade / downgrade / partial refund). Send the corrected **total** value in `restatementValue` (not a delta). - `ENHANCEMENT` — attach first-party identifiers (hashed email / phone) to an existing conversion (enhanced conversions applied after the fact). Identifying the original conversion (per adjustment): - `orderId` — the transaction ID you sent as `eventId` on the original conversion. Recommended, and **required** for `ENHANCEMENT`. - or `gclid` + `conversionTime` — the click ID and the original conversion's time (unix seconds). Not available for `ENHANCEMENT`. `destinationId` is the conversion action resource name, e.g. `customers/1234567890/conversionActions/987654321` (same value you send to `POST /v1/ads/conversions`). PII in `user` is hashed with SHA-256 server-side (Gmail-specific normalization included). Send plaintext. Times are unix seconds; we convert to Google's required `yyyy-MM-dd HH:mm:ss+00:00` format. Up to 2000 adjustments per request; partial failure is supported (inspect `adjustmentsFailed` / `failures[]`).
52
- # @param adjust_conversions_request
53
- # @param [Hash] opts the optional parameters
54
- # @return [AdjustConversions200Response]
55
- describe 'adjust_conversions test' do
56
- it 'should work' do
57
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
58
- end
59
- end
60
-
61
- # unit tests for archive_lead_form
62
- # Archive a lead form
63
- # Meta has no hard delete for forms; this archives the form (status=ARCHIVED).
64
- # @param form_id
65
- # @param account_id
66
- # @param [Hash] opts the optional parameters
67
- # @return [ArchiveLeadForm200Response]
68
- describe 'archive_lead_form test' do
69
- it 'should work' do
70
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
71
- end
72
- end
73
-
74
- # unit tests for boost_post
75
- # Boost post as ad
76
- # Creates a paid ad campaign from an existing published post. Creates the full platform campaign hierarchy (campaign, ad set, ad).
77
- # @param boost_post_request
78
- # @param [Hash] opts the optional parameters
79
- # @return [UpdateAd200Response]
80
- describe 'boost_post test' do
81
- it 'should work' do
82
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
83
- end
84
- end
85
-
86
- # unit tests for cancel_rf_reservation
87
- # Cancel a Reach & Frequency reservation (Meta)
88
- # Releases a RESERVATION's locked price and inventory. Unreserved predictions expire on their own.
89
- # @param prediction_id
90
- # @param account_id
91
- # @param ad_account_id
92
- # @param [Hash] opts the optional parameters
93
- # @return [nil]
94
- describe 'cancel_rf_reservation test' do
95
- it 'should work' do
96
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
97
- end
98
- end
99
-
100
- # unit tests for create_ad_creative
101
- # Create a standalone creative (Meta)
102
- # 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. Meta only.
103
- # @param create_ad_creative_request
104
- # @param [Hash] opts the optional parameters
105
- # @return [CreateAdCreative201Response]
106
- describe 'create_ad_creative test' do
107
- it 'should work' do
108
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
109
- end
110
- end
111
-
112
- # unit tests for create_ad_insights_report
113
- # Submit an async insights report run (Meta)
114
- # Submits an asynchronous Meta insights report. Same query surface as GET /v1/ads/insights, but in the JSON body; Meta processes the report server-side, which is the right choice for long ranges or large accounts where the sync query is slow or rate-limited. Returns a `reportRunId` to poll via GET /v1/ads/insights/reports/{reportRunId}. Meta only.
115
- # @param create_ad_insights_report_request
116
- # @param [Hash] opts the optional parameters
117
- # @return [CreateAdInsightsReport202Response]
118
- describe 'create_ad_insights_report test' do
119
- it 'should work' do
120
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
121
- end
122
- end
123
-
124
- # unit tests for create_call_ad
125
- # Create Click-to-Call ad
126
- # Same shape and flow as POST /v1/ads/ctwa, but the CTA is CALL_NOW dialing `phoneNumber` via a tel: link. The ad set is destination_type PHONE_CALL optimizing QUALITY_CALL and the campaign objective defaults to OUTCOME_LEADS. Supports the same single-creative and multi-creative shapes as CTWA.
127
- # @param create_call_ad_request
128
- # @param [Hash] opts the optional parameters
129
- # @return [nil]
130
- describe 'create_call_ad test' do
131
- it 'should work' do
132
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
133
- end
134
- end
135
-
136
- # unit tests for create_conversion_destination
137
- # Create a conversion destination
138
- # Create a new conversion destination on the platform. Supported for LinkedIn (conversion rule) and Google Ads (conversion action). Meta manages destinations in its own UI and returns 405. **LinkedIn:** creation is NOT idempotent. A retry creates a second destination. Deduplicate before retrying. **Google Ads:** calling with a name that already exists reuses the existing conversion action transparently (the response is identical to a fresh create). Calling with the same name but a different category returns a typed `IDEMPOTENCY_CONFLICT` (409) rather than silently returning the mismatched action. **LinkedIn:** the rule is created with `conversionMethod=CONVERSIONS_API` and (by default) auto-associated with all of the ad account's campaigns via `autoAssociationType=ALL_CAMPAIGNS`. Pass `autoAssociationType: NONE` to opt out and manage associations explicitly via the associations endpoints below. 365-day attribution windows are only valid for `SUBMIT_APPLICATION`, `PURCHASE`, `ADD_TO_CART`, `QUALIFIED_LEAD`, and `LEAD` rule types; the API rejects other combinations locally. **Google Ads:** the conversion action is created with `type=UPLOAD_CLICKS` (required for API-uploaded offline conversions, immutable after creation). The `type` field carries the Google `ConversionActionCategory` enum value, e.g. `PURCHASE`, `SUBSCRIBE_PAID`, `SIGNUP`, `IMPORTED_LEAD`, `BOOK_APPOINTMENT`. Unified standard event names (e.g. `Purchase`, `Subscribe`, `CompleteRegistration`, `Lead`, `Schedule`) are resolved to their Google category equivalents automatically. The action defaults to secondary (non-primary) to avoid immediately steering Smart Bidding; pass `primaryForGoal: true` to opt in.
139
- # @param account_id SocialAccount ID (linkedinads or googleads).
140
- # @param create_conversion_destination_request
141
- # @param [Hash] opts the optional parameters
142
- # @return [CreateConversionDestination201Response]
143
- describe 'create_conversion_destination test' do
144
- it 'should work' do
145
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
146
- end
147
- end
148
-
149
- # unit tests for create_ctwa_ad
150
- # Create Click-to-WhatsApp ad (deprecated)
151
- # Deprecated: use POST /v1/ads/messaging with `destination: whatsapp`. This endpoint stays available for back-compat; no removal planned. Creates one or more Click-to-WhatsApp (CTWA) ads on Meta under a single campaign and ad set. When tapped, each ad opens a WhatsApp conversation with the business attached to the supplied Facebook Page. The full hierarchy (campaign, ad set, creative(s), ad(s)) is created and activated in one call. The CTA is locked to WHATSAPP_MESSAGE and the destination is hard-coded to api.whatsapp.com/send; Meta resolves the actual WhatsApp number from the Page-to-WA pairing configured in Page settings or Business Manager. Supports two mutually-exclusive shapes: - **Single-creative**: supply top-level `headline`, `body`, and one of `imageUrl` / `video`. Creates 1 campaign + 1 ad set + 1 ad. - **Multi-creative**: supply a `creatives[]` array with N entries (each carrying its own headline, body, and image/video). Creates 1 campaign + 1 ad set + N ads sharing budget and targeting so Meta A/Bs the creatives inside a single auction instead of fragmenting budget across N parallel campaigns. Recommended when launching multiple creative variants for the same campaign. Prerequisites enforced by Meta (surfaced as platform_error on failure): the Facebook Page must be paired with a verified WhatsApp Business number, the WhatsApp Business Account must be business-verified, and the Meta access token must carry ads_management.
152
- # @param ctwa_ad_request_body
153
- # @param [Hash] opts the optional parameters
154
- # @return [CreateCtwaAd201Response]
155
- describe 'create_ctwa_ad test' do
156
- it 'should work' do
157
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
158
- end
159
- end
160
-
161
- # unit tests for create_lead_form
162
- # Create a lead form
163
- # Creates a Lead Gen form on the connected Facebook Page (POST /{page-id}/leadgen_forms). NOT idempotent — a retry creates a second form. Prefilled question types (EMAIL, PHONE, FULL_NAME, …) must omit label/key; CUSTOM questions require both. Requires the Ads add-on.
164
- # @param create_lead_form_request
165
- # @param [Hash] opts the optional parameters
166
- # @return [CreateLeadForm200Response]
167
- describe 'create_lead_form test' do
168
- it 'should work' do
169
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
170
- end
171
- end
172
-
173
- # unit tests for create_messaging_ad
174
- # Create click-to-message ad (WhatsApp / Messenger / Instagram Direct)
175
- # Creates a click-to-message ad; `destination` selects where the tapped ad opens a conversation: WhatsApp, the Page's Messenger inbox or the linked Instagram account's Direct inbox. The ad set is created with the matching destination_type and CONVERSATIONS optimization; the campaign objective defaults to OUTCOME_ENGAGEMENT. Supports single-creative and multi-creative shapes. Supersedes POST /v1/ads/ctwa (deprecated, equivalent to `destination: whatsapp`).
176
- # @param create_messaging_ad_request
177
- # @param [Hash] opts the optional parameters
178
- # @return [nil]
179
- describe 'create_messaging_ad test' do
180
- it 'should work' do
181
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
182
- end
183
- end
184
-
185
- # unit tests for create_rf_prediction
186
- # Create a Reach & Frequency prediction (Meta)
187
- # Creates an R&F prediction — a QUOTE, nothing is bought and no ad entities are created. Provide a date range plus exactly one of `budgetAmount` (Meta predicts reach) or `reach` (Meta predicts the budget). The response carries the estimate and its allowed bounds (min/max budget and reach). Predictions expire on their own; to buy, reserve one via POST /v1/ads/rf-predictions/{predictionId}/reserve and pass the RESERVED id to POST /v1/ads/create with `buyingType: \"RESERVED\"`. Reservation campaigns reject automatic placements, so omitted `placements` default to Facebook feed (+ Instagram stream when a linked IG professional account resolves); Instagram placements require that IG account. Meta only.
188
- # @param create_rf_prediction_request
189
- # @param [Hash] opts the optional parameters
190
- # @return [CreateRfPrediction201Response]
191
- describe 'create_rf_prediction test' do
192
- it 'should work' do
193
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
194
- end
195
- end
196
-
197
- # unit tests for create_standalone_ad
198
- # Create standalone ad
199
- # Creates a paid ad with custom creative across Meta, Google Ads, Pinterest, TikTok, X/Twitter, and LinkedIn. Supports three mutually-exclusive request shapes selected by the body, a legacy single-creative shape (all platforms, default), a Meta-only multi-creative shape via the creatives array (one ad set with N ads sharing budget and targeting), and a Meta-only attach shape via adSetId (adds one new ad to an existing ad set). Per-platform required fields, budget minimums, and video-ad rules are documented on each property below. LinkedIn creates a Single Image or Single Video Ad backed by a Direct Sponsored Content \"dark post\" authored by a Company Page (see `organizationId`); supported goals are engagement, traffic, awareness, and video_views (video ads use the `video` field; video_views requires a video), and traffic ads require `linkUrl`. **Idempotency:** this endpoint is not idempotent at the platform level (a blind retry creates a second campaign/ad set/ad). Send an `Idempotency-Key` header to make retries safe: the first request with a given key creates the ad and we store the response; a retry with the same key replays that exact response (with `Idempotent-Replayed: true`) instead of creating duplicates. Reusing a key with a different body returns 422; a key whose first request is still in flight returns 409 (retry after a short backoff). Keys are scoped to your credential and expire after 24h.
200
- # @param create_standalone_ad_request
201
- # @param [Hash] opts the optional parameters
202
- # @option opts [String] :idempotency_key Optional client-generated unique key (e.g. a UUID) that makes create retries safe. Same key + same body replays the original response; same key + different body → 422; key still processing → 409.
203
- # @return [CreateStandaloneAd200Response]
204
- describe 'create_standalone_ad test' do
205
- it 'should work' do
206
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
207
- end
208
- end
209
-
210
- # unit tests for create_test_lead
211
- # Create a test lead
212
- # Submits a test lead against the form (POST /{form-id}/test_leads) to exercise retrieval without waiting for real ad impressions. Meta allows one test lead per form at a time.
213
- # @param form_id
214
- # @param create_test_lead_request
215
- # @param [Hash] opts the optional parameters
216
- # @return [CreateTestLead200Response]
217
- describe 'create_test_lead test' do
218
- it 'should work' do
219
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
220
- end
221
- end
222
-
223
- # unit tests for delete_ad
224
- # Cancel an ad
225
- # Cancels the ad on the platform and marks it as cancelled in the database. The ad is preserved for history.
226
- # @param ad_id
227
- # @param [Hash] opts the optional parameters
228
- # @return [DeleteAccountGroup200Response]
229
- describe 'delete_ad test' do
230
- it 'should work' do
231
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
232
- end
233
- end
234
-
235
- # unit tests for delete_ad_creative
236
- # Delete a creative (Meta)
237
- # Deletes a creative from the library. Meta only allows deleting creatives not referenced by any ad — otherwise its 400 surfaces verbatim.
238
- # @param creative_id Platform creative id
239
- # @param account_id Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
240
- # @param [Hash] opts the optional parameters
241
- # @return [DeleteAdCreative200Response]
242
- describe 'delete_ad_creative test' do
243
- it 'should work' do
244
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
245
- end
246
- end
247
-
248
- # unit tests for delete_conversion_destination
249
- # Delete a conversion destination
250
- # LinkedIn-only today. LinkedIn does not expose hard-delete on conversion rules — what their UI calls \"delete\" is the same `enabled: false` flip we apply here. The rule remains fetchable via GET with `status: 'inactive'`; the unified discovery endpoint hides it by default. `adAccountId` may be passed as a query parameter (recommended) or as a JSON body field for clients that can send DELETE bodies.
251
- # @param account_id
252
- # @param destination_id
253
- # @param [Hash] opts the optional parameters
254
- # @option opts [String] :ad_account_id Required as query OR in JSON body.
255
- # @return [nil]
256
- describe 'delete_conversion_destination test' do
257
- it 'should work' do
258
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
259
- end
260
- end
261
-
262
- # unit tests for duplicate_ad
263
- # Duplicate an ad (Meta)
264
- # Duplicates a single ad via Meta's native `POST /{ad-id}/copies`. The copy is created paused. `adSetId` retargets the copy into another ad set; omitted = the source's own ad set. Accepts the Zernio ad id or the platform ad id. Sync discovery is triggered automatically (`syncAfter: false` to skip). Meta only.
265
- # @param ad_id Zernio ad ID or platform ad ID
266
- # @param [Hash] opts the optional parameters
267
- # @option opts [DuplicateAdRequest] :duplicate_ad_request
268
- # @return [DuplicateAd200Response]
269
- describe 'duplicate_ad test' do
270
- it 'should work' do
271
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
272
- end
273
- end
274
-
275
- # unit tests for estimate_ad_reach
276
- # Estimate audience reach
277
- # Returns a normalized pre-flight audience-size estimate for a targeting spec, before any campaign is created. Backed by each platform's native reach API (Meta `delivery_estimate`, LinkedIn `audienceCounts`, X `audience_summary`, Pinterest `audience_sizing`). Platforms without a usable pre-flight reach API (Google Search/Display, TikTok) return `available: false` with no bounds, so clients can hide or grey out the estimate rather than treat the absence as an error.
278
- # @param estimate_ad_reach_request
279
- # @param [Hash] opts the optional parameters
280
- # @return [EstimateAdReach200Response]
281
- describe 'estimate_ad_reach test' do
282
- it 'should work' do
283
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
284
- end
285
- end
286
-
287
- # unit tests for generate_ad_previews
288
- # Render pre-create ad previews (Meta)
289
- # 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. Meta only.
290
- # @param generate_ad_previews_request
291
- # @param [Hash] opts the optional parameters
292
- # @return [GenerateAdPreviews200Response]
293
- describe 'generate_ad_previews test' do
294
- it 'should work' do
295
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
296
- end
297
- end
298
-
299
- # unit tests for get_ad
300
- # Get ad details
301
- # Returns an ad with its creative, targeting, status, and performance metrics. The `{adId}` path segment accepts any identifier dialect Zernio indexes for the ad: - the Zernio internal `_id` (24-char hex) - Meta's numeric `platformAdId` (the value shipped in `comment.received` webhooks as `comment.ad.id`) - the creative's `effective_object_story_id` (`{pageId}_{postId}` shape, Facebook side) - the creative's `effective_instagram_media_id` (Instagram side) Any of the four resolve to the same ad. Caller doesn't need a translation step.
302
- # @param ad_id Zernio `_id` (hex), Meta `platformAdId` (numeric), or one of the creative's effective story/media IDs. See description for details.
303
- # @param [Hash] opts the optional parameters
304
- # @return [GetAd200Response]
305
- describe 'get_ad test' do
306
- it 'should work' do
307
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
308
- end
309
- end
310
-
311
- # unit tests for get_ad_account_finance
312
- # Ad account finances (Meta)
313
- # 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`. Meta only.
314
- # @param account_id Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
315
- # @param ad_account_id Meta ad account id (act_<n>).
316
- # @param [Hash] opts the optional parameters
317
- # @return [GetAdAccountFinance200Response]
318
- describe 'get_ad_account_finance test' do
319
- it 'should work' do
320
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
321
- end
322
- end
323
-
324
- # unit tests for get_ad_analytics
325
- # Get ad analytics
326
- # Returns detailed performance analytics for an ad. Includes summary metrics, a daily timeline over the requested date range, and optional demographic breakdowns (Meta and TikTok only). If no date range is provided, defaults to the last 90 days. Date range is capped at 730 days max.
327
- # @param ad_id
328
- # @param [Hash] opts the optional parameters
329
- # @option opts [Date] :from_date Start of date range (YYYY-MM-DD). Defaults to 90 days ago.
330
- # @option opts [Date] :to_date End of date range (YYYY-MM-DD). Defaults to today. Max 730-day range.
331
- # @option opts [String] :breakdowns Comma-separated breakdown dimensions. **Meta**: age, gender, country, publisher_platform, device_platform, region. **TikTok**: gender, age, country_code, platform, ac, language. **LinkedIn** (firmographics): job_title, job_function, seniority, industry, company, company_size, country, region. Rows carry the raw pivot `value` plus a resolved `name`. LinkedIn serves these aggregated over the whole range, delays the data 12-24h, and omits segments with fewer than 3 events.
332
- # @return [GetAdAnalytics200Response]
333
- describe 'get_ad_analytics test' do
334
- it 'should work' do
335
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
336
- end
337
- end
338
-
339
- # unit tests for get_ad_comments
340
- # List comments on an ad
341
- # 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.
342
- # @param ad_id Internal Zernio ad ID (ObjectId).
343
- # @param [Hash] opts the optional parameters
344
- # @option opts [String] :placement 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.
345
- # @option opts [Integer] :limit
346
- # @option opts [String] :cursor Pagination cursor from a previous response.
347
- # @return [GetAdComments200Response]
348
- describe 'get_ad_comments test' do
349
- it 'should work' do
350
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
351
- end
352
- end
353
-
354
- # unit tests for get_ad_creative
355
- # Creative details (Meta)
356
- # One creative's details, verbatim from Meta. `fields` is a raw-passthrough override of the default projection. Meta only.
357
- # @param creative_id Platform creative id
358
- # @param account_id Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
359
- # @param [Hash] opts the optional parameters
360
- # @option opts [String] :fields Comma-separated Graph field override (supports nested {} projections).
361
- # @return [GetAdCreative200Response]
362
- describe 'get_ad_creative test' do
363
- it 'should work' do
364
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
365
- end
366
- end
367
-
368
- # unit tests for get_ad_insights_report
369
- # Poll an async insights report run (Meta)
370
- # Status and results for a report run created via POST /v1/ads/insights/reports. While the job runs, returns `status` and `percentCompletion`. Once `status` is \"Job Completed\" the response also carries a `data` page, cursor-paginated via `limit` / `after`.
371
- # @param report_run_id
372
- # @param account_id Zernio SocialAccount id used to resolve the Meta token (must be the same connection that created the run).
373
- # @param [Hash] opts the optional parameters
374
- # @option opts [Integer] :limit
375
- # @option opts [String] :after
376
- # @return [GetAdInsightsReport200Response]
377
- describe 'get_ad_insights_report test' do
378
- it 'should work' do
379
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
380
- end
381
- end
382
-
383
- # unit tests for get_ad_previews
384
- # Render previews of an existing ad (Meta)
385
- # 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. Meta only.
386
- # @param ad_id Zernio ad id (24-char hex).
387
- # @param [Hash] opts the optional parameters
388
- # @option opts [String] :formats Comma-separated Meta ad_format values (max 10), one preview per format. Defaults to DESKTOP_FEED_STANDARD.
389
- # @return [GetAdPreviews200Response]
390
- describe 'get_ad_previews test' do
391
- it 'should work' do
392
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
393
- end
394
- end
395
-
396
- # unit tests for get_ad_tracking_tags
397
- # Get ad tracking tags
398
- # Unified read of the platform's native click-URL tracking params. - Meta (facebook/instagram): the creative's `url_tags` (and template_url_spec). - Google (googleads): the campaign's `trackingUrlTemplate` + `finalUrlSuffix`. Subject to the Google Ads API access-tier daily quota; bulk audits need Standard access. - LinkedIn (linkedinads): the campaign's Dynamic UTM `dynamicValueParameters` + `customValueParameters`. Returns 405 for platforms without a click-URL tracking surface (TikTok, X, Pinterest).
399
- # @param ad_id Ad id (hex _id, platformAdId, or effective story/media id).
400
- # @param [Hash] opts the optional parameters
401
- # @return [GetAdTrackingTags200Response]
402
- describe 'get_ad_tracking_tags test' do
403
- it 'should work' do
404
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
405
- end
406
- end
407
-
408
- # unit tests for get_ads_activity_log
409
- # Ad account change / audit log (Meta)
410
- # 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). Meta only.
411
- # @param account_id Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
412
- # @param ad_account_id Meta ad account id (act_<n>).
413
- # @param [Hash] opts the optional parameters
414
- # @option opts [Date] :since Start of range (YYYY-MM-DD).
415
- # @option opts [Date] :_until End of range (YYYY-MM-DD).
416
- # @option opts [String] :object_id Client-side filter to one Meta object id (campaign, ad set or ad).
417
- # @option opts [Integer] :limit Rows per page
418
- # @option opts [String] :after Cursor from paging.after of the previous page.
419
- # @return [GetAdsActivityLog200Response]
420
- describe 'get_ads_activity_log test' do
421
- it 'should work' do
422
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
423
- end
424
- end
425
-
426
- # unit tests for get_campaign_analytics
427
- # Get campaign analytics
428
- # Returns performance analytics for a whole campaign in one call: summary metrics, a daily timeline over the requested date range (summed across the campaign's ads), and optional demographic breakdowns. Breakdowns are fetched live from Meta at the campaign level (one call per dimension, no per-ad fan-out), so an agency dashboard gets campaign-level age/gender/etc. without summing thousands of per-ad reads. `campaignId` is the platform campaign id; pass `platform` when a campaign id could be ambiguous across platforms. If no date range is provided, defaults to the last 90 days. Date range is capped at 730 days max.
429
- # @param campaign_id Platform campaign id (platformCampaignId).
430
- # @param [Hash] opts the optional parameters
431
- # @option opts [String] :platform Disambiguate when the campaign id exists across platforms (e.g. facebook, instagram).
432
- # @option opts [Date] :from_date Start of date range (YYYY-MM-DD). Defaults to 90 days ago.
433
- # @option opts [Date] :to_date End of date range (YYYY-MM-DD). Defaults to today. Max 730-day range.
434
- # @option opts [String] :breakdowns Comma-separated breakdown dimensions. **Meta**: age, gender, country, publisher_platform, device_platform, region, platform_position, impression_device, video_asset, image_asset, body_asset, title_asset. **LinkedIn** (firmographics): job_title, job_function, seniority, industry, company, company_size, country, region. Rows carry the raw pivot `value` plus a resolved `name`. LinkedIn serves these aggregated over the whole range, delays the data 12-24h, and omits segments with fewer than 3 events.
435
- # @return [GetCampaignAnalytics200Response]
436
- describe 'get_campaign_analytics test' do
437
- it 'should work' do
438
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
439
- end
440
- end
441
-
442
- # unit tests for get_conversion_destination
443
- # Get a conversion destination
444
- # LinkedIn-only today. Returns the full destination record for one conversion rule. The `adAccountId` query parameter is required because LinkedIn rules are scoped to a sponsored ad account.
445
- # @param account_id
446
- # @param destination_id
447
- # @param ad_account_id Numeric ID or full `urn:li:sponsoredAccount:{id}` URN.
448
- # @param [Hash] opts the optional parameters
449
- # @return [GetConversionDestination200Response]
450
- describe 'get_conversion_destination test' do
451
- it 'should work' do
452
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
453
- end
454
- end
455
-
456
- # unit tests for get_conversion_metrics
457
- # Get attribution metrics
458
- # LinkedIn-only today. Returns conversion-attribution metrics (`externalWebsiteConversions`, `externalWebsitePostClickConversions`, `externalWebsitePostViewConversions`, `conversionValueInLocalCurrency`, `qualifiedLeads`, `costInLocalCurrency`) bucketed by date. Date-range constraints (passed through from LinkedIn): - `granularity=DAILY` is retained for ~6 months only - `granularity=ALL` with a range > 6 months auto-rounds to month boundaries - `granularity=MONTHLY`/`YEARLY` retains 24 months Throttle: LinkedIn caps adAnalytics at 45M metric values per 5-minute window across the calling token. Single-rule queries are well within that limit; surfaces as 429 if hit.
459
- # @param account_id
460
- # @param destination_id
461
- # @param ad_account_id
462
- # @param start_date
463
- # @param [Hash] opts the optional parameters
464
- # @option opts [String] :end_date
465
- # @option opts [String] :granularity
466
- # @return [GetConversionMetrics200Response]
467
- describe 'get_conversion_metrics test' do
468
- it 'should work' do
469
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
470
- end
471
- end
472
-
473
- # unit tests for get_conversions_quality
474
- # Get Event Match Quality
475
- # Reads Meta Event Match Quality (EMQ) and pixel↔CAPI event coverage for a pixel/dataset, live from Meta's Dataset Quality API. Web events only (a Meta limitation). Meta-only; other platforms return 405. Requires the Ads add-on.
476
- # @param account_id SocialAccount _id (must be a metaads account).
477
- # @param destination_id Meta pixel/dataset ID.
478
- # @param [Hash] opts the optional parameters
479
- # @return [GetConversionsQuality200Response]
480
- describe 'get_conversions_quality test' do
481
- it 'should work' do
482
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
483
- end
484
- end
485
-
486
- # unit tests for get_dsa_defaults
487
- # Get ad account DSA defaults
488
- # 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.
489
- # @param account_id Social account ID (metaads, or a facebook/instagram posting account)
490
- # @param ad_account_id Meta ad account ID (act_...)
491
- # @param [Hash] opts the optional parameters
492
- # @return [UpdateAdAccount200Response]
493
- describe 'get_dsa_defaults test' do
494
- it 'should work' do
495
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
496
- end
497
- end
498
-
499
- # unit tests for get_dsa_recommendations
500
- # List DSA beneficiary/payor suggestions
501
- # 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.
502
- # @param account_id Social account ID (metaads, or a facebook/instagram posting account)
503
- # @param ad_account_id Meta ad account ID (act_...)
504
- # @param [Hash] opts the optional parameters
505
- # @return [GetDsaRecommendations200Response]
506
- describe 'get_dsa_recommendations test' do
507
- it 'should work' do
508
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
509
- end
510
- end
511
-
512
- # unit tests for get_lead_form
513
- # Get a lead form
514
- # @param form_id
515
- # @param account_id
516
- # @param [Hash] opts the optional parameters
517
- # @return [GetLeadForm200Response]
518
- describe 'get_lead_form test' do
519
- it 'should work' do
520
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
521
- end
522
- end
523
-
524
- # unit tests for get_linked_in_bid_pricing
525
- # Suggested bid and budget bounds (LinkedIn)
526
- # LinkedIn-only. Returns the suggested bid and bid limits for a targeting spec, plus the daily-budget bounds LinkedIn will accept. Use it before creating a campaign to pick a bid inside the allowed range and warn the user if their daily budget is below the minimum. Wraps LinkedIn's `adBudgetPricing` finder. Non-LinkedIn accounts return `available: false` so clients can hide the pricing UI without treating it as a failure.
527
- # @param get_linked_in_bid_pricing_request
528
- # @param [Hash] opts the optional parameters
529
- # @return [GetLinkedInBidPricing200Response]
530
- describe 'get_linked_in_bid_pricing test' do
531
- it 'should work' do
532
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
533
- end
534
- end
535
-
536
- # unit tests for get_linked_in_supply_forecast
537
- # Impressions, clicks and spend forecast (LinkedIn)
538
- # LinkedIn-only. Forecasted impressions, clicks, spend and ~20 other metrics for a targeting spec over a time range. Wraps LinkedIn's `adSupplyForecasts` finder. Each returned series carries a `metricType` (IMPRESSION, CLICK, SPENDING, MAX_POTENTIAL_BUDGET, COST_PER_MILLION_IMPRESSIONS, ...) and a `granularity` (DAILY, SEVEN_DAY, THIRTY_DAY, CUSTOM). LinkedIn caps the daily spending forecast at 1.2x the daily budget and returns 0 once the total budget is exhausted. Non-LinkedIn accounts return `available: false`.
539
- # @param get_linked_in_supply_forecast_request
540
- # @param [Hash] opts the optional parameters
541
- # @return [GetLinkedInSupplyForecast200Response]
542
- describe 'get_linked_in_supply_forecast test' do
543
- it 'should work' do
544
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
545
- end
546
- end
547
-
548
- # unit tests for get_rf_prediction
549
- # Read a Reach & Frequency prediction (Meta)
550
- # @param prediction_id
551
- # @param account_id
552
- # @param ad_account_id
553
- # @param [Hash] opts the optional parameters
554
- # @return [CreateRfPrediction201Response]
555
- describe 'get_rf_prediction test' do
556
- it 'should work' do
557
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
558
- end
559
- end
560
-
561
- # unit tests for list_ad_accounts
562
- # List ad accounts
563
- # 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.
564
- # @param account_id Social account ID
565
- # @param [Hash] opts the optional parameters
566
- # @option opts [String] :ad_account_id Filter response to a single platform ad account ID (e.g. `act_123` for Meta, advertiser_id for TikTok). Returns at most one item.
567
- # @option opts [Integer] :limit Clamp the returned `accounts[]` length. Useful for typeahead pickers on agency tokens with hundreds of advertisers.
568
- # @return [ListAdAccounts200Response]
569
- describe 'list_ad_accounts test' do
570
- it 'should work' do
571
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
572
- end
573
- end
574
-
575
- # unit tests for list_ad_catalog_product_sets
576
- # List a catalog's product sets
577
- # 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`.
578
- # @param catalog_id Meta product catalog ID (from GET /v1/ads/catalogs)
579
- # @param account_id A facebook, instagram, or metaads social account ID
580
- # @param [Hash] opts the optional parameters
581
- # @return [ListAdCatalogProductSets200Response]
582
- describe 'list_ad_catalog_product_sets test' do
583
- it 'should work' do
584
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
585
- end
586
- end
587
-
588
- # unit tests for list_ad_catalogs
589
- # List Meta product catalogs
590
- # 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.
591
- # @param account_id A facebook, instagram, or metaads social account ID
592
- # @param ad_account_id Meta ad account ID (act_...)
593
- # @param [Hash] opts the optional parameters
594
- # @return [ListAdCatalogs200Response]
595
- describe 'list_ad_catalogs test' do
596
- it 'should work' do
597
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
598
- end
599
- end
600
-
601
- # unit tests for list_ad_creatives
602
- # Creative library (Meta)
603
- # 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`. Meta only.
604
- # @param account_id Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
605
- # @param ad_account_id Meta ad account id (act_<n>).
606
- # @param [Hash] opts the optional parameters
607
- # @option opts [String] :fields Comma-separated Graph field override (supports nested {} projections).
608
- # @option opts [Integer] :limit Rows per page
609
- # @option opts [String] :after Cursor from paging.after of the previous page.
610
- # @return [ListAdCreatives200Response]
611
- describe 'list_ad_creatives test' do
612
- it 'should work' do
613
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
614
- end
615
- end
616
-
617
- # unit tests for list_ad_images
618
- # Ad image library (Meta)
619
- # 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). Meta only.
620
- # @param account_id Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
621
- # @param ad_account_id Meta ad account id (act_<n>).
622
- # @param [Hash] opts the optional parameters
623
- # @option opts [String] :fields Comma-separated Graph field override (supports nested {} projections).
624
- # @option opts [Integer] :limit Rows per page
625
- # @option opts [String] :after Cursor from paging.after of the previous page.
626
- # @return [ListAdImages200Response]
627
- describe 'list_ad_images test' do
628
- it 'should work' do
629
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
630
- end
631
- end
632
-
633
- # unit tests for list_ad_labels
634
- # Ad labels (Meta)
635
- # Lists the ad account's organizational labels (Meta's `/act_X/adlabels`), rows returned verbatim (id, name, created/updated time). Meta only.
636
- # @param account_id Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
637
- # @param ad_account_id Meta ad account id (act_<n>).
638
- # @param [Hash] opts the optional parameters
639
- # @option opts [Integer] :limit Rows per page
640
- # @option opts [String] :after Cursor from paging.after of the previous page.
641
- # @return [ListAdLabels200Response]
642
- describe 'list_ad_labels test' do
643
- it 'should work' do
644
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
645
- end
646
- end
647
-
648
- # unit tests for list_ad_studies
649
- # A/B tests and lift studies (Meta)
650
- # 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. Meta only.
651
- # @param account_id Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
652
- # @param ad_account_id Meta ad account id (act_<n>).
653
- # @param [Hash] opts the optional parameters
654
- # @option opts [String] :fields Comma-separated Graph field override (supports nested {} projections).
655
- # @option opts [Integer] :limit Rows per page
656
- # @option opts [String] :after Cursor from paging.after of the previous page.
657
- # @return [ListAdStudies200Response]
658
- describe 'list_ad_studies test' do
659
- it 'should work' do
660
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
661
- end
662
- end
663
-
664
- # unit tests for list_ads
665
- # List ads
666
- # Returns a paginated list of ads with metrics computed over an optional date range. Use source=all to include externally-synced ads from platform ad managers. If no date range is provided, defaults to the last 90 days. Date range is capped at 730 days max. To find the Zernio ad behind a comment you see in Meta Business Manager, filter by platformAdId (the Meta ad ID), effectiveObjectStoryId (Facebook), or effectiveInstagramMediaId (Instagram) — those are the post/media the ad's engagement lives on, and are also returned on each ad's `creative` object. Then call GET /v1/ads/{adId}/comments with the returned ad id.
667
- # @param [Hash] opts the optional parameters
668
- # @option opts [Integer] :page Page number (1-based)
669
- # @option opts [Integer] :limit
670
- # @option opts [String] :source all (default) = Zernio-created + platform-discovered ads. zernio = restrict to Zernio-created only.
671
- # @option opts [AdStatus] :status
672
- # @option opts [String] :platform
673
- # @option opts [String] :account_id Social account ID
674
- # @option opts [String] :ad_account_id Platform ad account ID (e.g. act_123 for Meta). Mirrors the same filter on /v1/ads/campaigns and /v1/ads/tree.
675
- # @option opts [String] :profile_id Profile ID
676
- # @option opts [String] :campaign_id Platform campaign ID (filter ads within a campaign)
677
- # @option opts [String] :platform_ad_id Meta ad ID. Returns the ad with this platform-side ad ID.
678
- # @option opts [String] :effective_object_story_id Facebook `{pageId}_{postId}` of the post the ad's engagement lives on (Meta `effective_object_story_id`). Use to map a Business-Manager-visible post back to the Zernio ad.
679
- # @option opts [String] :effective_instagram_media_id Instagram media ID of the boosted post (Meta `effective_instagram_media_id`). Use to map a Business-Manager-visible IG post back to the Zernio ad.
680
- # @option opts [Date] :from_date Start of metrics date range (YYYY-MM-DD). Defaults to 90 days ago.
681
- # @option opts [Date] :to_date End of metrics date range (YYYY-MM-DD). Defaults to today. Max 730-day range.
682
- # @return [ListAds200Response]
683
- describe 'list_ads test' do
684
- it 'should work' do
685
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
686
- end
687
- end
688
-
689
- # unit tests for list_ads_business_centers
690
- # List TikTok Business Centers
691
- # 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.
692
- # @param account_id ID of the `tiktokads` (or parent `tiktok` posting) SocialAccount
693
- # @param [Hash] opts the optional parameters
694
- # @return [ListAdsBusinessCenters200Response]
695
- describe 'list_ads_business_centers test' do
696
- it 'should work' do
697
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
698
- end
699
- end
700
-
701
- # unit tests for list_conversion_associations
702
- # List associated campaigns
703
- # LinkedIn-only today. Returns the campaigns currently associated with this conversion rule. Note that auto-association on rule creation runs once at create time; campaigns created after the rule still need explicit association.
704
- # @param account_id
705
- # @param destination_id
706
- # @param ad_account_id
707
- # @param [Hash] opts the optional parameters
708
- # @return [ListConversionAssociations200Response]
709
- describe 'list_conversion_associations test' do
710
- it 'should work' do
711
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
712
- end
713
- end
714
-
715
- # unit tests for list_conversion_destinations
716
- # List conversion destinations
717
- # Returns the list of pixels (Meta), conversion actions (Google), or conversion rules (LinkedIn) accessible to the connected ads account. Use the returned `id` as `destinationId` when posting to `POST /v1/ads/conversions`. For Google and LinkedIn, each destination's `type` reflects the conversion type (PURCHASE, LEAD, SIGN_UP, etc.) — the event type is locked to the destination. For Meta, `type` is absent: pixels accept any event name per request. For LinkedIn, destinations are returned across every sponsored ad account the connected token can access; the `adAccountId` field on each destination identifies the parent ad account and is required for subsequent CRUD calls (update, delete, associations, metrics).
718
- # @param account_id SocialAccount ID (metaads, googleads, linkedinads, or tiktokads).
719
- # @param [Hash] opts the optional parameters
720
- # @return [ListConversionDestinations200Response]
721
- describe 'list_conversion_destinations test' do
722
- it 'should work' do
723
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
724
- end
725
- end
726
-
727
- # unit tests for list_form_leads
728
- # List leads for a single form
729
- # Returns leads for one form. Serves persisted leads (ingested via the leadgen webhook) when available, falling back to a live Graph read.
730
- # @param form_id
731
- # @param account_id
732
- # @param [Hash] opts the optional parameters
733
- # @option opts [Integer] :limit
734
- # @option opts [String] :cursor
735
- # @option opts [Integer] :since Unix seconds.
736
- # @return [ListFormLeads200Response]
737
- describe 'list_form_leads test' do
738
- it 'should work' do
739
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
740
- end
741
- end
742
-
743
- # unit tests for list_high_demand_periods
744
- # High demand periods / budget schedules (Meta)
745
- # 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). Meta only.
746
- # @param account_id Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
747
- # @param [Hash] opts the optional parameters
748
- # @option opts [String] :campaign_id Platform campaign id. Exactly one of campaignId / adSetId.
749
- # @option opts [String] :ad_set_id Platform ad set id. Exactly one of campaignId / adSetId.
750
- # @option opts [Integer] :limit Rows per page
751
- # @option opts [String] :after Cursor from paging.after of the previous page.
752
- # @return [ListHighDemandPeriods200Response]
753
- describe 'list_high_demand_periods test' do
754
- it 'should work' do
755
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
756
- end
757
- end
758
-
759
- # unit tests for list_lead_forms
760
- # List lead forms
761
- # Lists the Lead Gen forms owned by the connected Facebook Page. Requires the Ads add-on.
762
- # @param account_id Connected facebook account id.
763
- # @param [Hash] opts the optional parameters
764
- # @option opts [Integer] :limit
765
- # @option opts [String] :cursor
766
- # @return [ListLeadForms200Response]
767
- describe 'list_lead_forms test' do
768
- it 'should work' do
769
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
770
- end
771
- end
772
-
773
- # unit tests for list_leads
774
- # List submitted leads
775
- # Returns persisted Meta Lead Gen leads for your team, newest-first, with keyset pagination on `cursor`. Leads are ingested in real time from the `leadgen` webhook. Requires the Ads add-on.
776
- # @param [Hash] opts the optional parameters
777
- # @option opts [String] :form_id Filter to a single lead form.
778
- # @option opts [String] :account_id Filter to a single connected account.
779
- # @option opts [Integer] :limit
780
- # @option opts [Integer] :since Unix seconds; only leads created at/after this Meta timestamp.
781
- # @option opts [String] :cursor Keyset cursor from a previous response's pagination.cursor.
782
- # @return [ListLeads200Response]
783
- describe 'list_leads test' do
784
- it 'should work' do
785
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
786
- end
787
- end
788
-
789
- # unit tests for list_meta_businesses
790
- # Businesses list (Meta)
791
- # 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. Meta only; for TikTok Business Centers use `GET /v1/ads/business-centers`.
792
- # @param account_id Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
793
- # @param [Hash] opts the optional parameters
794
- # @option opts [Integer] :limit Rows per page
795
- # @option opts [String] :after Cursor from paging.after of the previous page.
796
- # @return [ListMetaBusinesses200Response]
797
- describe 'list_meta_businesses test' do
798
- it 'should work' do
799
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
800
- end
801
- end
802
-
803
- # unit tests for list_whats_app_conversions
804
- # List conversion events
805
- # Returns the most recent conversion events sent through `POST /v1/whatsapp/conversions` for the given WhatsApp account. Sourced from delivery logs (Axiom `late` dataset), so the visible window is bounded by log retention (about 30 days). Useful for rendering a \"recent activity\" panel on the conversions setup tab without standing up a parallel persistence layer. Per-event payload mirrors the structured log we write on every successful send: `eventName`, `conversationId`, `eventsReceived`, `eventsFailed`, `traceId`, `durationMs`, and the wall-clock `timestamp`.
806
- # @param account_id WhatsApp social account ID
807
- # @param [Hash] opts the optional parameters
808
- # @option opts [Integer] :limit Max events to return (1-200, default 50).
809
- # @return [ListWhatsAppConversions200Response]
810
- describe 'list_whats_app_conversions test' do
811
- it 'should work' do
812
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
813
- end
814
- end
815
-
816
- # unit tests for query_ad_insights
817
- # Flexible live insights query (Meta)
818
- # Live, flexible insights query against Meta's Graph API. Unlike GET /v1/ads/{adId}/analytics (fixed metric set, cached), this forwards caller-chosen `fields`, `breakdowns` and `filtering` to any Meta insights node and returns Meta's rows verbatim. `objectId` selects the node: an ad account, campaign, ad set or ad platform id. `level` sets row granularity independently of the node. Semantic validation is Meta's: an unknown field or invalid breakdown combination returns a 400 carrying Meta's message. For long ranges or agency-scale accounts prefer the async variant (POST /v1/ads/insights/reports). Meta only.
819
- # @param account_id Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
820
- # @param object_id Meta insights node: act_<n>, campaign id, ad set id or ad id.
821
- # @param [Hash] opts the optional parameters
822
- # @option opts [String] :level Row granularity
823
- # @option opts [String] :fields Comma-separated Graph insights fields (e.g. spend,impressions,frequency,website_purchase_roas). Omitted = Meta's default set.
824
- # @option opts [String] :breakdowns Comma-separated Graph breakdowns (e.g. age,gender or publisher_platform).
825
- # @option opts [String] :action_breakdowns Comma-separated Graph action breakdowns. Segments the actions[] arrays in each row.
826
- # @option opts [String] :action_attribution_windows Comma-separated Meta attribution windows. Action values are returned keyed per window.
827
- # @option opts [String] :action_report_time When actions are counted: impression, conversion or mixed.
828
- # @option opts [Boolean] :use_unified_attribution_setting Use the ad sets' own attribution settings for action counting.
829
- # @option opts [String] :filtering JSON array of Meta filter objects: [{\"field\", \"operator\", \"value\"}]. Applied server-side by Meta.
830
- # @option opts [String] :date_preset Meta date_preset (e.g. last_7d, last_30d, this_month). Mutually exclusive with fromDate/toDate.
831
- # @option opts [Date] :from_date Start of range (YYYY-MM-DD); requires toDate.
832
- # @option opts [Date] :to_date End of range (YYYY-MM-DD); requires fromDate.
833
- # @option opts [String] :time_increment Days per row (1-90), monthly, or all_days.
834
- # @option opts [Integer] :limit Rows per page
835
- # @option opts [String] :after Cursor from paging.after of the previous page.
836
- # @return [QueryAdInsights200Response]
837
- describe 'query_ad_insights test' do
838
- it 'should work' do
839
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
840
- end
841
- end
842
-
843
- # unit tests for remove_conversion_associations
844
- # Remove associated campaigns
845
- # Remove one or more campaign associations from this conversion rule. Pass `adAccountId` and `campaignIds` as query parameters (`campaignIds` is comma-separated). The route also accepts a JSON body with the same fields for clients that prefer DELETE-with-body, but the documented surface is query-only because some SDK code generators (e.g. Python) collapse query + body parameters with the same name into a single kwarg.
846
- # @param account_id
847
- # @param destination_id
848
- # @param ad_account_id
849
- # @param campaign_ids Comma-separated list of campaign IDs.
850
- # @param [Hash] opts the optional parameters
851
- # @return [RemoveConversionAssociations200Response]
852
- describe 'remove_conversion_associations test' do
853
- it 'should work' do
854
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
855
- end
856
- end
857
-
858
- # unit tests for reserve_rf_prediction
859
- # Reserve a Reach & Frequency prediction (Meta)
860
- # Locks the quoted price + inventory until the returned `expiresAt` and mints a NEW prediction id — pass that RESERVED id (not the original) as `rfPredictionId` on POST /v1/ads/create. Release an unused reservation via DELETE. Meta only.
861
- # @param prediction_id
862
- # @param reserve_rf_prediction_request
863
- # @param [Hash] opts the optional parameters
864
- # @return [ReserveRfPrediction201Response]
865
- describe 'reserve_rf_prediction test' do
866
- it 'should work' do
867
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
868
- end
869
- end
870
-
871
- # unit tests for search_ad_interests
872
- # Search targeting interests
873
- # Deprecated alias for `GET /v1/ads/targeting/search?dimension=interest`. Kept for backward compatibility, it returns the legacy `{ interests: [...] }` shape rather than the normalized `{ results: [...] }`. New integrations should use `GET /v1/ads/targeting/search` with `dimension=interest`.
874
- # @param q Search query
875
- # @param account_id Social account ID
876
- # @param [Hash] opts the optional parameters
877
- # @return [SearchAdInterests200Response]
878
- describe 'search_ad_interests test' do
879
- it 'should work' do
880
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
881
- end
882
- end
883
-
884
- # unit tests for search_ad_targeting
885
- # Search targeting options
886
- # Resolve a human-readable query into the platform's opaque targeting ids used in the `TargetingSpec` (`countries`/`regions`/`cities`/`zips`/`metros` geo keys, and `interests`/`behaviors` entity ids) on `POST /v1/ads/create`, `POST /v1/ads/targeting/reach-estimate`, and `saved_targeting` audiences. The `dimension` param selects what is searched, `geo` (locations, further scoped by `geoType`), `interest`, `behavior`, or `income`. Availability of each dimension varies by platform (e.g. behaviours are Meta/TikTok only). Results are normalized across platforms into a single shape, so the same client code consumes Meta, TikTok, LinkedIn, X, Pinterest, and Google results. TikTok geo searches return every matching level in one list (`type` is `country`, `region`, `city`, `district`, or `metro` for DMA areas) — `geoType` is not applied. Results are scoped to the advertiser's targetable markets, and every id is usable in `regions`/`cities`/`metros` keys on `POST /v1/ads/create`. For geo queries, `q` should contain only the locality name (e.g. `\"Amsterdam\"`, not `\"Amsterdam, NL\"`). Use `countryCode` to disambiguate.
887
- # @param account_id Social account ID (a connected account on the target ad platform).
888
- # @param q Search query. For geo, the locality name only (no region/country suffix).
889
- # @param [Hash] opts the optional parameters
890
- # @option opts [String] :dimension What to search. `geo` resolves locations (scope further with `geoType`), `interest`/`behavior` resolve audience entities, `income` resolves income-tier options. Defaults to `interest` for backward compatibility with the deprecated /v1/ads/interests alias.
891
- # @option opts [String] :geo_type Only used when `dimension=geo`. The kind of location to resolve. Defaults to `city`.
892
- # @option opts [String] :country_code ISO 3166-1 alpha-2 country code (e.g. NL) to scope a geo search.
893
- # @option opts [Integer] :limit Maximum results to return.
894
- # @return [SearchAdTargeting200Response]
895
- describe 'search_ad_targeting test' do
896
- it 'should work' do
897
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
898
- end
899
- end
900
-
901
- # unit tests for send_conversions
902
- # Send conversion events
903
- # Relay one or more conversion events to the target ad platform's native Conversions API. Platform is inferred from the provided `accountId`. Requires the Ads add-on. Supported platforms: - Meta (`metaads`) via Graph API - Google Ads (`googleads`) via Data Manager API `ingestEvents` - LinkedIn (`linkedinads`) via `/rest/conversionEvents` - TikTok (`tiktokads`) via the Offline Events API `/offline/batch/` — OFFLINE conversions only `destinationId` semantics differ per platform: - Meta: pixel (dataset) ID, e.g. `123456789012345` - Google: conversion action resource name, e.g. `customers/1234567890/conversionActions/987654321` - LinkedIn: conversion rule ID or URN, e.g. `104012` or `urn:lla:llaPartnerConversion:104012` - TikTok: Offline Event Set ID, e.g. `7057103914977558530` TikTok notes: this path sends OFFLINE conversions (in-store / CRM / call-center), not web-pixel events. Each event must carry an email or phone (TikTok requires at least one). The connected TikTok ads account must have granted the Offline Events permission; older grants must reconnect. Callers can list valid destinations via `GET /v1/accounts/{accountId}/conversion-destinations`. All PII (email, phone, names, external IDs) is hashed with SHA-256 server-side per each platform's normalization spec, including Google's Gmail-specific dot/plus-suffix stripping. Send plaintext. LinkedIn `externalIds` are passed through as plaintext per LinkedIn's spec; only emails and phones are hashed. For LinkedIn, the connected account must have been authorized after the Conversions API rollout (i.e. the OAuth grant must include `rw_conversions`). Older accounts must reconnect. Batching is handled automatically. Meta caps at 1000 events per request and rejects the entire batch if any event is malformed. Google caps at 2000. LinkedIn caps at 5000 and is also all-or-nothing per chunk. Dedup: pass a stable `eventId` on every event. Meta and LinkedIn use it to dedupe against browser-side pixel/Insight Tag events; Google maps it to `transactionId`. Per-platform `eventName` semantics: - Meta: free-form. Standard names (Purchase, Lead, ...) match Meta's built-in events; custom strings are accepted. - Google: ignored. The conversion action's category determines the event type. Send the standard name closest to your action for documentation, but the platform will not branch on it. - LinkedIn: ignored. The conversion rule's `type` (LEAD, PURCHASE, etc.) is locked to the destination at rule-creation time. Send the standard name for documentation; LinkedIn does not branch on it.
904
- # @param send_conversions_request
905
- # @param [Hash] opts the optional parameters
906
- # @return [SendConversions200Response]
907
- describe 'send_conversions test' do
908
- it 'should work' do
909
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
910
- end
911
- end
912
-
913
- # unit tests for send_whats_app_conversion
914
- # Send WhatsApp conversion event
915
- # Forward a WhatsApp Business Messaging conversion event (`LeadSubmitted`, `Purchase`, `AddToCart`, `InitiateCheckout`, `ViewContent`) to Meta's Conversions API with `action_source = business_messaging` and `messaging_channel = whatsapp`. The endpoint looks up the originating CTWA click ID (`ctwa_clid`) captured on the first inbound message of the conversation and replays it on every event so Meta can attribute the conversion back to the Click-to-WhatsApp ad that drove the chat. Configuration prerequisite on the WhatsApp account metadata: - `metaCapiDatasetId`: the Meta dataset ID linked to the WABA. Provision one with `POST /v1/whatsapp/dataset`. The WABA ID (already set automatically at connect time) is forwarded as `user_data.whatsapp_business_account_id`, which is the per-channel attribution identifier Meta requires for WhatsApp events. No Facebook Page ID is needed (that field is the Messenger-branch identifier). Identify the conversation by either `conversationId` (preferred) or `phoneE164` (digits only, no `+`). At least one is required. If the conversation has no captured `ctwa_clid`, the request returns 422 because there is nothing to attribute. Token and dataset coupling: the WhatsApp account's accessToken must have access to the configured `metaCapiDatasetId`. By default a WABA's system-user token is scoped to the WABA's own Business Manager and cannot post to a pixel owned by a different Business; Meta returns code 100 in that case. Either share the dataset with the WhatsApp app's Business in BM, or use a dataset already in the same Business as the WABA.
916
- # @param send_whats_app_conversion_request
917
- # @param [Hash] opts the optional parameters
918
- # @return [SendWhatsAppConversion200Response]
919
- describe 'send_whats_app_conversion test' do
920
- it 'should work' do
921
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
922
- end
923
- end
924
-
925
- # unit tests for update_ad
926
- # Update ad
927
- # Patch one or more fields on an ad. Status, budget, targeting, and creative changes are propagated to the platform. Per-platform support: - **Meta** (Facebook + Instagram): all fields supported. - **TikTok**: status, budget, targeting (via `/v2/adgroup/update/`), and creative (via `/v2/ad/update/` patch-style — `headline` is ignored, `body` becomes `ad_text`). - **Pinterest / X / LinkedIn / Google**: status + budget only. Sending `targeting` or `creative` returns 501 with code `unsupported_platform_operation`.
928
- # @param ad_id
929
- # @param update_ad_request
930
- # @param [Hash] opts the optional parameters
931
- # @return [UpdateAd200Response]
932
- describe 'update_ad test' do
933
- it 'should work' do
934
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
935
- end
936
- end
937
-
938
- # unit tests for update_ad_account
939
- # Update ad account settings
940
- # 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.
941
- # @param update_ad_account_request
942
- # @param [Hash] opts the optional parameters
943
- # @return [UpdateAdAccount200Response]
944
- describe 'update_ad_account test' do
945
- it 'should work' do
946
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
947
- end
948
- end
949
-
950
- # unit tests for update_ad_creative
951
- # Rename a creative (Meta)
952
- # 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`). Meta only.
953
- # @param creative_id Platform creative id
954
- # @param update_ad_creative_request
955
- # @param [Hash] opts the optional parameters
956
- # @return [UpdateAdCreative200Response]
957
- describe 'update_ad_creative test' do
958
- it 'should work' do
959
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
960
- end
961
- end
962
-
963
- # unit tests for update_ad_status
964
- # Pause or resume a single ad
965
- # Ad-scoped pause/resume — touches ONLY this ad, never its parent ad set or campaign (so sibling ads keep running). Thin wrapper over the `status` field of PUT /v1/ads/{adId}, for callers that want a URL symmetric to /v1/ads/campaigns/{campaignId}/status and /v1/ads/ad-sets/{adSetId}/status. `{adId}` accepts the same identifier dialects as GET/PUT /v1/ads/{adId} (Zernio hex `_id`, Meta numeric `platformAdId`, or the creative's effective story/media IDs). `platform` is inferred from the ad, so it's not required in the body. Ads in terminal statuses (rejected, completed, cancelled) and no-op flips (already in the target state) are skipped.
966
- # @param ad_id Zernio `_id` (hex), Meta `platformAdId` (numeric), or one of the creative's effective story/media IDs.
967
- # @param update_ad_status_request
968
- # @param [Hash] opts the optional parameters
969
- # @return [UpdateAdStatus200Response]
970
- describe 'update_ad_status test' do
971
- it 'should work' do
972
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
973
- end
974
- end
975
-
976
- # unit tests for update_ad_tracking_tags
977
- # Set ad tracking tags
978
- # Unified update. Send only the fields for the ad's platform: - Meta: `urlTags` (array of {key,value}). Meta creatives are immutable, so this rebuilds the creative and repoints the ad. By DEFAULT we PRESERVE the existing creative verbatim (re-post its object_story_spec + the new url_tags, reusing the image), so you send `urlTags` ALONE — no need to read back headline/body/CTA. `creative` (headline, body, callToAction, linkUrl, imageUrl) is OPTIONAL and only needed to rebuild explicitly, or for SHARE / page-post / dark / asset_feed creatives whose object_story_spec Meta strips (those return 422 asking for `creative`). - Google: `trackingUrlTemplate` and/or `finalUrlSuffix` (full template strings; account quota applies). - LinkedIn: `dynamicValueParameters` and/or `customValueParameters` (campaign-level Dynamic UTM).
979
- # @param ad_id
980
- # @param update_ad_tracking_tags_request
981
- # @param [Hash] opts the optional parameters
982
- # @return [nil]
983
- describe 'update_ad_tracking_tags test' do
984
- it 'should work' do
985
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
986
- end
987
- end
988
-
989
- # unit tests for update_conversion_destination
990
- # Update a conversion destination
991
- # Partial-update a conversion rule. LinkedIn-only today. Whitelisted fields: `name`, `enabled`, attribution windows, `valueType`, `value`, `attributionType`. The rule's `type` and parent ad account are intentionally not exposed for update — recreate the rule if those need to change.
992
- # @param account_id
993
- # @param destination_id
994
- # @param update_conversion_destination_request
995
- # @param [Hash] opts the optional parameters
996
- # @return [GetConversionDestination200Response]
997
- describe 'update_conversion_destination test' do
998
- it 'should work' do
999
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
1000
- end
1001
- end
1002
-
1003
- # unit tests for upload_ad_image
1004
- # Upload an ad image from base64 (Meta)
1005
- # 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. Meta only.
1006
- # @param upload_ad_image_request
1007
- # @param [Hash] opts the optional parameters
1008
- # @return [UploadAdImage201Response]
1009
- describe 'upload_ad_image test' do
1010
- it 'should work' do
1011
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
1012
- end
1013
- end
1014
-
1015
- end