Class: Zernio::AdCreativesApi

Inherits:
Object
  • Object
show all
Defined in:
lib/zernio-sdk/api/ad_creatives_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ AdCreativesApi

Returns a new instance of AdCreativesApi.



19
20
21
# File 'lib/zernio-sdk/api/ad_creatives_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/zernio-sdk/api/ad_creatives_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create_ad_creative(create_ad_creative_request, opts = {}) ⇒ CreateAdCreative201Response

Create a standalone creative 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. creativeFeatures configures Advantage+ enhancements. promotion is not supported and any object is rejected with 400.

Parameters:

Returns:



27
28
29
30
# File 'lib/zernio-sdk/api/ad_creatives_api.rb', line 27

def create_ad_creative(create_ad_creative_request, opts = {})
  data, _status_code, _headers = create_ad_creative_with_http_info(create_ad_creative_request, opts)
  data
end

#create_ad_creative_with_http_info(create_ad_creative_request, opts = {}) ⇒ Array<(CreateAdCreative201Response, Integer, Hash)>

Create a standalone creative 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. `creativeFeatures` configures Advantage+ enhancements. `promotion` is not supported and any object is rejected with 400.

Parameters:

Returns:

  • (Array<(CreateAdCreative201Response, Integer, Hash)>)

    CreateAdCreative201Response data, response status code and response headers



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/zernio-sdk/api/ad_creatives_api.rb', line 37

def create_ad_creative_with_http_info(create_ad_creative_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AdCreativesApi.create_ad_creative ...'
  end
  # verify the required parameter 'create_ad_creative_request' is set
  if @api_client.config.client_side_validation && create_ad_creative_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_ad_creative_request' when calling AdCreativesApi.create_ad_creative"
  end
  # resource path
  local_var_path = '/v1/ads/creatives'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(create_ad_creative_request)

  # return_type
  return_type = opts[:debug_return_type] || 'CreateAdCreative201Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"AdCreativesApi.create_ad_creative",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AdCreativesApi#create_ad_creative\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_ad_creative(creative_id, account_id, opts = {}) ⇒ DeleteAdCreative200Response

Delete a creative Deletes a creative from the library. Meta only allows deleting creatives not referenced by any ad; otherwise its 400 surfaces verbatim.

Parameters:

  • creative_id (String)

    Platform creative id

  • account_id (String)

    Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



96
97
98
99
# File 'lib/zernio-sdk/api/ad_creatives_api.rb', line 96

def delete_ad_creative(creative_id, , opts = {})
  data, _status_code, _headers = delete_ad_creative_with_http_info(creative_id, , opts)
  data
end

#delete_ad_creative_with_http_info(creative_id, account_id, opts = {}) ⇒ Array<(DeleteAdCreative200Response, Integer, Hash)>

Delete a creative Deletes a creative from the library. Meta only allows deleting creatives not referenced by any ad; otherwise its 400 surfaces verbatim.

Parameters:

  • creative_id (String)

    Platform creative id

  • account_id (String)

    Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(DeleteAdCreative200Response, Integer, Hash)>)

    DeleteAdCreative200Response data, response status code and response headers



107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/zernio-sdk/api/ad_creatives_api.rb', line 107

def delete_ad_creative_with_http_info(creative_id, , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AdCreativesApi.delete_ad_creative ...'
  end
  # verify the required parameter 'creative_id' is set
  if @api_client.config.client_side_validation && creative_id.nil?
    fail ArgumentError, "Missing the required parameter 'creative_id' when calling AdCreativesApi.delete_ad_creative"
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling AdCreativesApi.delete_ad_creative"
  end
  # resource path
  local_var_path = '/v1/ads/creatives/{creativeId}'.sub('{' + 'creativeId' + '}', CGI.escape(creative_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'accountId'] = 

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'DeleteAdCreative200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"AdCreativesApi.delete_ad_creative",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AdCreativesApi#delete_ad_creative\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_ad_video(video_id, account_id, ad_account_id, opts = {}) ⇒ DeleteAdVideo200Response

Delete an ad video Removes a video from the ad account's video library. Meta's canonical DELETE /{video_id} fails with code 10 / subcode 1363055 for videos uploaded via /act_X/advideos even with ads_management; this endpoint uses the working account-scoped shape DELETE /act_X/advideos?video_id=<id> and returns Meta's {success: true} verbatim. Deleting a video that lives in a different ad account, or that Meta has already removed, returns Meta's error verbatim as a 4xx.

Parameters:

  • video_id (String)

    Meta ad video id (numeric).

  • account_id (String)

    Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.

  • ad_account_id (String)

    Meta ad account id (act_<n>) that owns the video.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



167
168
169
170
# File 'lib/zernio-sdk/api/ad_creatives_api.rb', line 167

def delete_ad_video(video_id, , , opts = {})
  data, _status_code, _headers = delete_ad_video_with_http_info(video_id, , , opts)
  data
end

#delete_ad_video_with_http_info(video_id, account_id, ad_account_id, opts = {}) ⇒ Array<(DeleteAdVideo200Response, Integer, Hash)>

Delete an ad video Removes a video from the ad account's video library. Meta's canonical `DELETE /video_id` fails with code 10 / subcode 1363055 for videos uploaded via `/act_X/advideos` even with `ads_management`; this endpoint uses the working account-scoped shape `DELETE /act_X/advideos?video_id=<id>` and returns Meta's `true` verbatim. Deleting a video that lives in a different ad account, or that Meta has already removed, returns Meta's error verbatim as a 4xx.

Parameters:

  • video_id (String)

    Meta ad video id (numeric).

  • account_id (String)

    Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.

  • ad_account_id (String)

    Meta ad account id (act_<n>) that owns the video.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(DeleteAdVideo200Response, Integer, Hash)>)

    DeleteAdVideo200Response data, response status code and response headers



179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
# File 'lib/zernio-sdk/api/ad_creatives_api.rb', line 179

def delete_ad_video_with_http_info(video_id, , , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AdCreativesApi.delete_ad_video ...'
  end
  # verify the required parameter 'video_id' is set
  if @api_client.config.client_side_validation && video_id.nil?
    fail ArgumentError, "Missing the required parameter 'video_id' when calling AdCreativesApi.delete_ad_video"
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling AdCreativesApi.delete_ad_video"
  end
  # verify the required parameter 'ad_account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'ad_account_id' when calling AdCreativesApi.delete_ad_video"
  end
  # resource path
  local_var_path = '/v1/ads/videos/{videoId}'.sub('{' + 'videoId' + '}', CGI.escape(video_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'accountId'] = 
  query_params[:'adAccountId'] = 

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'DeleteAdVideo200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"AdCreativesApi.delete_ad_video",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AdCreativesApi#delete_ad_video\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#generate_ad_previews(generate_ad_previews_request, opts = {}) ⇒ GenerateAdPreviews200Response

Render pre-create ad previews 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.

Parameters:

Returns:



242
243
244
245
# File 'lib/zernio-sdk/api/ad_creatives_api.rb', line 242

def generate_ad_previews(generate_ad_previews_request, opts = {})
  data, _status_code, _headers = generate_ad_previews_with_http_info(generate_ad_previews_request, opts)
  data
end

#generate_ad_previews_with_http_info(generate_ad_previews_request, opts = {}) ⇒ Array<(GenerateAdPreviews200Response, Integer, Hash)>

Render pre-create ad previews 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.

Parameters:

Returns:



252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
# File 'lib/zernio-sdk/api/ad_creatives_api.rb', line 252

def generate_ad_previews_with_http_info(generate_ad_previews_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AdCreativesApi.generate_ad_previews ...'
  end
  # verify the required parameter 'generate_ad_previews_request' is set
  if @api_client.config.client_side_validation && generate_ad_previews_request.nil?
    fail ArgumentError, "Missing the required parameter 'generate_ad_previews_request' when calling AdCreativesApi.generate_ad_previews"
  end
  # resource path
  local_var_path = '/v1/ads/preview'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(generate_ad_previews_request)

  # return_type
  return_type = opts[:debug_return_type] || 'GenerateAdPreviews200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"AdCreativesApi.generate_ad_previews",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AdCreativesApi#generate_ad_previews\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_ad_creative(creative_id, account_id, opts = {}) ⇒ GetAdCreative200Response

Creative details One creative's details, verbatim from Meta. fields is a raw-passthrough override of the default projection.

Parameters:

  • creative_id (String)

    Platform creative id

  • account_id (String)

    Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :fields (String)

    Comma-separated Graph field override. Supports nested {} projections and Graph field modifiers, so a nested edge can be paged explicitly: without a .limit() modifier the expansion runs at the Meta default page size and the tail is dropped silently.

Returns:



312
313
314
315
# File 'lib/zernio-sdk/api/ad_creatives_api.rb', line 312

def get_ad_creative(creative_id, , opts = {})
  data, _status_code, _headers = get_ad_creative_with_http_info(creative_id, , opts)
  data
end

#get_ad_creative_with_http_info(creative_id, account_id, opts = {}) ⇒ Array<(GetAdCreative200Response, Integer, Hash)>

Creative details One creative's details, verbatim from Meta. `fields` is a raw-passthrough override of the default projection.

Parameters:

  • creative_id (String)

    Platform creative id

  • account_id (String)

    Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :fields (String)

    Comma-separated Graph field override. Supports nested {} projections and Graph field modifiers, so a nested edge can be paged explicitly: without a .limit() modifier the expansion runs at the Meta default page size and the tail is dropped silently.

Returns:

  • (Array<(GetAdCreative200Response, Integer, Hash)>)

    GetAdCreative200Response data, response status code and response headers



324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
# File 'lib/zernio-sdk/api/ad_creatives_api.rb', line 324

def get_ad_creative_with_http_info(creative_id, , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AdCreativesApi.get_ad_creative ...'
  end
  # verify the required parameter 'creative_id' is set
  if @api_client.config.client_side_validation && creative_id.nil?
    fail ArgumentError, "Missing the required parameter 'creative_id' when calling AdCreativesApi.get_ad_creative"
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling AdCreativesApi.get_ad_creative"
  end
  # resource path
  local_var_path = '/v1/ads/creatives/{creativeId}'.sub('{' + 'creativeId' + '}', CGI.escape(creative_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'accountId'] = 
  query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetAdCreative200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"AdCreativesApi.get_ad_creative",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AdCreativesApi#get_ad_creative\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_ad_media(ad_id, opts = {}) ⇒ GetAdMedia200Response

Direct video and image URLs for an ad Returns the direct signed URLs for every video and image asset used by an ad's live creative, normalised across shapes: single image/video, carousel, Reels/Story (object_story_spec.video_data) and dynamic creative (asset_feed_spec). Video items include Meta's poster thumbnail and the video's Meta id when available. Reads Meta live rather than the stored creative blob because Meta's signed fbcdn URLs carry an oe=<hex> expiration (image_url ~24 h, video source ~12 d). Treat URLs as short-lived: re-fetch this endpoint before serving or downloading assets instead of caching URLs beyond that window.

Parameters:

  • ad_id (String)

    Zernio ad id (24-char hex) or platform ad id.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



383
384
385
386
# File 'lib/zernio-sdk/api/ad_creatives_api.rb', line 383

def get_ad_media(ad_id, opts = {})
  data, _status_code, _headers = get_ad_media_with_http_info(ad_id, opts)
  data
end

#get_ad_media_with_http_info(ad_id, opts = {}) ⇒ Array<(GetAdMedia200Response, Integer, Hash)>

Direct video and image URLs for an ad Returns the direct signed URLs for every video and image asset used by an ad's live creative, normalised across shapes: single image/video, carousel, Reels/Story (`object_story_spec.video_data`) and dynamic creative (`asset_feed_spec`). Video items include Meta's poster thumbnail and the video's Meta id when available. Reads Meta live rather than the stored creative blob because Meta's signed fbcdn URLs carry an `oe=<hex>` expiration (image_url ~24 h, video source ~12 d). Treat URLs as short-lived: re-fetch this endpoint before serving or downloading assets instead of caching URLs beyond that window.

Parameters:

  • ad_id (String)

    Zernio ad id (24-char hex) or platform ad id.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(GetAdMedia200Response, Integer, Hash)>)

    GetAdMedia200Response data, response status code and response headers



393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
# File 'lib/zernio-sdk/api/ad_creatives_api.rb', line 393

def get_ad_media_with_http_info(ad_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AdCreativesApi.get_ad_media ...'
  end
  # verify the required parameter 'ad_id' is set
  if @api_client.config.client_side_validation && ad_id.nil?
    fail ArgumentError, "Missing the required parameter 'ad_id' when calling AdCreativesApi.get_ad_media"
  end
  # resource path
  local_var_path = '/v1/ads/{adId}/media'.sub('{' + 'adId' + '}', CGI.escape(ad_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetAdMedia200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"AdCreativesApi.get_ad_media",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AdCreativesApi#get_ad_media\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_ad_previews(ad_id, opts = {}) ⇒ GetAdPreviews200Response

Render previews of an existing ad 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.

Parameters:

  • ad_id (String)

    Zernio ad id (24-char hex).

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :formats (String)

    Comma-separated Meta ad_format values (max 10), one preview per format. Defaults to DESKTOP_FEED_STANDARD.

Returns:



447
448
449
450
# File 'lib/zernio-sdk/api/ad_creatives_api.rb', line 447

def get_ad_previews(ad_id, opts = {})
  data, _status_code, _headers = get_ad_previews_with_http_info(ad_id, opts)
  data
end

#get_ad_previews_with_http_info(ad_id, opts = {}) ⇒ Array<(GetAdPreviews200Response, Integer, Hash)>

Render previews of an existing ad 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.

Parameters:

  • ad_id (String)

    Zernio ad id (24-char hex).

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :formats (String)

    Comma-separated Meta ad_format values (max 10), one preview per format. Defaults to DESKTOP_FEED_STANDARD.

Returns:

  • (Array<(GetAdPreviews200Response, Integer, Hash)>)

    GetAdPreviews200Response data, response status code and response headers



458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
# File 'lib/zernio-sdk/api/ad_creatives_api.rb', line 458

def get_ad_previews_with_http_info(ad_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AdCreativesApi.get_ad_previews ...'
  end
  # verify the required parameter 'ad_id' is set
  if @api_client.config.client_side_validation && ad_id.nil?
    fail ArgumentError, "Missing the required parameter 'ad_id' when calling AdCreativesApi.get_ad_previews"
  end
  # resource path
  local_var_path = '/v1/ads/{adId}/preview'.sub('{' + 'adId' + '}', CGI.escape(ad_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'formats'] = opts[:'formats'] if !opts[:'formats'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetAdPreviews200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"AdCreativesApi.get_ad_previews",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AdCreativesApi#get_ad_previews\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_ad_creatives(account_id, ad_account_id, opts = {}) ⇒ ListAdCreatives200Response

Creative library 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.

Parameters:

  • account_id (String)

    Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.

  • ad_account_id (String)

    Meta ad account id (act_<n>).

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :fields (String)

    Comma-separated Graph field override. Supports nested {} projections and Graph field modifiers, so a nested edge can be paged explicitly: without a .limit() modifier the expansion runs at the Meta default page size and the tail is dropped silently.

  • :limit (Integer)

    Rows per page (default to 25)

  • :after (String)

    Cursor from paging.after of the previous page.

Returns:



516
517
518
519
# File 'lib/zernio-sdk/api/ad_creatives_api.rb', line 516

def list_ad_creatives(, , opts = {})
  data, _status_code, _headers = list_ad_creatives_with_http_info(, , opts)
  data
end

#list_ad_creatives_with_http_info(account_id, ad_account_id, opts = {}) ⇒ Array<(ListAdCreatives200Response, Integer, Hash)>

Creative library 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`.

Parameters:

  • account_id (String)

    Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.

  • ad_account_id (String)

    Meta ad account id (act_<n>).

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :fields (String)

    Comma-separated Graph field override. Supports nested {} projections and Graph field modifiers, so a nested edge can be paged explicitly: without a .limit() modifier the expansion runs at the Meta default page size and the tail is dropped silently.

  • :limit (Integer)

    Rows per page (default to 25)

  • :after (String)

    Cursor from paging.after of the previous page.

Returns:

  • (Array<(ListAdCreatives200Response, Integer, Hash)>)

    ListAdCreatives200Response data, response status code and response headers



530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
# File 'lib/zernio-sdk/api/ad_creatives_api.rb', line 530

def list_ad_creatives_with_http_info(, , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AdCreativesApi.list_ad_creatives ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling AdCreativesApi.list_ad_creatives"
  end
  # verify the required parameter 'ad_account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'ad_account_id' when calling AdCreativesApi.list_ad_creatives"
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AdCreativesApi.list_ad_creatives, must be smaller than or equal to 100.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AdCreativesApi.list_ad_creatives, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/v1/ads/creatives'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'accountId'] = 
  query_params[:'adAccountId'] = 
  query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListAdCreatives200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"AdCreativesApi.list_ad_creatives",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AdCreativesApi#list_ad_creatives\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_ad_images(account_id, ad_account_id, opts = {}) ⇒ ListAdImages200Response

Ad image library 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).

Parameters:

  • account_id (String)

    Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.

  • ad_account_id (String)

    Meta ad account id (act_<n>).

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :fields (String)

    Comma-separated Graph field override. Supports nested {} projections and Graph field modifiers, so a nested edge can be paged explicitly: without a .limit() modifier the expansion runs at the Meta default page size and the tail is dropped silently.

  • :limit (Integer)

    Rows per page (default to 25)

  • :after (String)

    Cursor from paging.after of the previous page.

Returns:



604
605
606
607
# File 'lib/zernio-sdk/api/ad_creatives_api.rb', line 604

def list_ad_images(, , opts = {})
  data, _status_code, _headers = list_ad_images_with_http_info(, , opts)
  data
end

#list_ad_images_with_http_info(account_id, ad_account_id, opts = {}) ⇒ Array<(ListAdImages200Response, Integer, Hash)>

Ad image library 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).

Parameters:

  • account_id (String)

    Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.

  • ad_account_id (String)

    Meta ad account id (act_<n>).

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :fields (String)

    Comma-separated Graph field override. Supports nested {} projections and Graph field modifiers, so a nested edge can be paged explicitly: without a .limit() modifier the expansion runs at the Meta default page size and the tail is dropped silently.

  • :limit (Integer)

    Rows per page (default to 25)

  • :after (String)

    Cursor from paging.after of the previous page.

Returns:

  • (Array<(ListAdImages200Response, Integer, Hash)>)

    ListAdImages200Response data, response status code and response headers



618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
# File 'lib/zernio-sdk/api/ad_creatives_api.rb', line 618

def list_ad_images_with_http_info(, , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AdCreativesApi.list_ad_images ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling AdCreativesApi.list_ad_images"
  end
  # verify the required parameter 'ad_account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'ad_account_id' when calling AdCreativesApi.list_ad_images"
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AdCreativesApi.list_ad_images, must be smaller than or equal to 100.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AdCreativesApi.list_ad_images, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/v1/ads/images'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'accountId'] = 
  query_params[:'adAccountId'] = 
  query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListAdImages200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"AdCreativesApi.list_ad_images",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AdCreativesApi#list_ad_images\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_ad_videos(account_id, ad_account_id, opts = {}) ⇒ ListAdVideos200Response

Ad video library Lists the ad account's video library (Meta's /act_X/advideos), rows returned verbatim. The default projection covers id, title, status, poster frames, length and source (the playable MP4); fields is a raw-passthrough override. Any id here is reusable as video.id on the create endpoints, so N ads that differ only in copy share one upload. source lets you PLAY a video before picking it, which a poster frame alone can't settle when several videos share a first frame. It is a signed CDN URL that EXPIRES, so treat it as good for preview at selection time only. Never persist it; re-list to get a fresh one. This is the only way to reach a video uploaded OUTSIDE Zernio (Ads Manager, another tool); videos we uploaded also come back as creative.videoId on GET /v1/ads. Meta transcodes asynchronously, so a row is only usable once status.video_status reads ready. Upload a new video via POST /v1/ads/videos, or inline via video.url on POST /v1/ads/create.

Parameters:

  • account_id (String)

    Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.

  • ad_account_id (String)

    Meta ad account id (act_<n>).

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :fields (String)

    Comma-separated Graph field override. Supports nested {} projections and Graph field modifiers, so a nested edge can be paged explicitly: without a .limit() modifier the expansion runs at the Meta default page size and the tail is dropped silently.

  • :limit (Integer)

    Rows per page (default to 25)

  • :after (String)

    Cursor from paging.after of the previous page.

Returns:



692
693
694
695
# File 'lib/zernio-sdk/api/ad_creatives_api.rb', line 692

def list_ad_videos(, , opts = {})
  data, _status_code, _headers = list_ad_videos_with_http_info(, , opts)
  data
end

#list_ad_videos_with_http_info(account_id, ad_account_id, opts = {}) ⇒ Array<(ListAdVideos200Response, Integer, Hash)>

Ad video library Lists the ad account's video library (Meta's `/act_X/advideos`), rows returned verbatim. The default projection covers id, title, status, poster frames, length and `source` (the playable MP4); `fields` is a raw-passthrough override. Any `id` here is reusable as `video.id` on the create endpoints, so N ads that differ only in copy share one upload. `source` lets you PLAY a video before picking it, which a poster frame alone can't settle when several videos share a first frame. It is a signed CDN URL that EXPIRES, so treat it as good for preview at selection time only. Never persist it; re-list to get a fresh one. This is the only way to reach a video uploaded OUTSIDE Zernio (Ads Manager, another tool); videos we uploaded also come back as `creative.videoId` on GET /v1/ads. Meta transcodes asynchronously, so a row is only usable once `status.video_status` reads `ready`. Upload a new video via POST /v1/ads/videos, or inline via `video.url` on POST /v1/ads/create.

Parameters:

  • account_id (String)

    Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.

  • ad_account_id (String)

    Meta ad account id (act_<n>).

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :fields (String)

    Comma-separated Graph field override. Supports nested {} projections and Graph field modifiers, so a nested edge can be paged explicitly: without a .limit() modifier the expansion runs at the Meta default page size and the tail is dropped silently.

  • :limit (Integer)

    Rows per page (default to 25)

  • :after (String)

    Cursor from paging.after of the previous page.

Returns:

  • (Array<(ListAdVideos200Response, Integer, Hash)>)

    ListAdVideos200Response data, response status code and response headers



706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
# File 'lib/zernio-sdk/api/ad_creatives_api.rb', line 706

def list_ad_videos_with_http_info(, , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AdCreativesApi.list_ad_videos ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling AdCreativesApi.list_ad_videos"
  end
  # verify the required parameter 'ad_account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'ad_account_id' when calling AdCreativesApi.list_ad_videos"
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AdCreativesApi.list_ad_videos, must be smaller than or equal to 100.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AdCreativesApi.list_ad_videos, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/v1/ads/videos'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'accountId'] = 
  query_params[:'adAccountId'] = 
  query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListAdVideos200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"AdCreativesApi.list_ad_videos",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AdCreativesApi#list_ad_videos\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_ads_tik_tok_identities(account_id, ad_account_id, opts = {}) ⇒ ListAdsTikTokIdentities200Response

List TikTok ad identities The identities an ad on this TikTok advertiser may run as (the profile shown on the ad): the advertiser's own TikTok accounts (TT_USER), Business Center authorized accounts (BC_AUTH_TT) and custom brand identities (CUSTOMIZED_USER). Pass the chosen identityId on POST /v1/ads/create or POST /v1/ads/boost. Spark-post identities (AUTH_CODE) are not listed; a Spark code creates its own.

Parameters:

  • account_id (String)

    A tiktok or tiktokads account ID

  • ad_account_id (String)

    TikTok advertiser ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



777
778
779
780
# File 'lib/zernio-sdk/api/ad_creatives_api.rb', line 777

def list_ads_tik_tok_identities(, , opts = {})
  data, _status_code, _headers = list_ads_tik_tok_identities_with_http_info(, , opts)
  data
end

#list_ads_tik_tok_identities_with_http_info(account_id, ad_account_id, opts = {}) ⇒ Array<(ListAdsTikTokIdentities200Response, Integer, Hash)>

List TikTok ad identities The identities an ad on this TikTok advertiser may run as (the profile shown on the ad): the advertiser's own TikTok accounts (TT_USER), Business Center authorized accounts (BC_AUTH_TT) and custom brand identities (CUSTOMIZED_USER). Pass the chosen `identityId` on POST /v1/ads/create or POST /v1/ads/boost. Spark-post identities (AUTH_CODE) are not listed; a Spark code creates its own.

Parameters:

  • account_id (String)

    A tiktok or tiktokads account ID

  • ad_account_id (String)

    TikTok advertiser ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
# File 'lib/zernio-sdk/api/ad_creatives_api.rb', line 788

def list_ads_tik_tok_identities_with_http_info(, , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AdCreativesApi.list_ads_tik_tok_identities ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling AdCreativesApi.list_ads_tik_tok_identities"
  end
  # verify the required parameter 'ad_account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'ad_account_id' when calling AdCreativesApi.list_ads_tik_tok_identities"
  end
  # resource path
  local_var_path = '/v1/ads/tiktok-identities'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'accountId'] = 
  query_params[:'adAccountId'] = 

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListAdsTikTokIdentities200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"AdCreativesApi.list_ads_tik_tok_identities",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AdCreativesApi#list_ads_tik_tok_identities\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_partnership_ad_content(account_id, opts = {}) ⇒ ListPartnershipAdContent200Response

List partnership ad content Private beta. Lists creator Instagram posts available to the advertiser for Partnership Ads. Supply creatorUsername or postUrl. Requires instagram_branded_content_ads_brand permission and an advertiser Instagram Business Account.

Parameters:

  • account_id (String)

    Zernio SocialAccount ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :creator_username (String)

    Creator username. Required unless postUrl is supplied.

  • :post_url (String)

    Instagram post permalink. Required unless creatorUsername is supplied.

  • :only_allowlisted (Boolean)

    Return only creators with account-level permission.

Returns:



850
851
852
853
# File 'lib/zernio-sdk/api/ad_creatives_api.rb', line 850

def list_partnership_ad_content(, opts = {})
  data, _status_code, _headers = list_partnership_ad_content_with_http_info(, opts)
  data
end

#list_partnership_ad_content_with_http_info(account_id, opts = {}) ⇒ Array<(ListPartnershipAdContent200Response, Integer, Hash)>

List partnership ad content Private beta. Lists creator Instagram posts available to the advertiser for Partnership Ads. Supply creatorUsername or postUrl. Requires instagram_branded_content_ads_brand permission and an advertiser Instagram Business Account.

Parameters:

  • account_id (String)

    Zernio SocialAccount ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :creator_username (String)

    Creator username. Required unless postUrl is supplied.

  • :post_url (String)

    Instagram post permalink. Required unless creatorUsername is supplied.

  • :only_allowlisted (Boolean)

    Return only creators with account-level permission.

Returns:



863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
# File 'lib/zernio-sdk/api/ad_creatives_api.rb', line 863

def list_partnership_ad_content_with_http_info(, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AdCreativesApi.list_partnership_ad_content ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling AdCreativesApi.list_partnership_ad_content"
  end
  pattern = Regexp.new(/^[a-fA-F0-9]{24}$/)
  if @api_client.config.client_side_validation &&  !~ pattern
    fail ArgumentError, "invalid value for 'account_id' when calling AdCreativesApi.list_partnership_ad_content, must conform to the pattern #{pattern}."
  end

  # resource path
  local_var_path = '/v1/ads/partnership-content'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'accountId'] = 
  query_params[:'creatorUsername'] = opts[:'creator_username'] if !opts[:'creator_username'].nil?
  query_params[:'postUrl'] = opts[:'post_url'] if !opts[:'post_url'].nil?
  query_params[:'onlyAllowlisted'] = opts[:'only_allowlisted'] if !opts[:'only_allowlisted'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListPartnershipAdContent200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"AdCreativesApi.list_partnership_ad_content",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AdCreativesApi#list_partnership_ad_content\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_partnership_ad_permissions(account_id, opts = {}) ⇒ ListPartnershipAdPermissions200Response

List partnership permissions Private beta. Lists granted or pending creator permissions for the advertiser Instagram Business Account. Requires instagram_branded_content_ads_brand permission.

Parameters:

  • account_id (String)

    Zernio SocialAccount ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :creator_username (String)

    Filter by creator username.

Returns:



926
927
928
929
# File 'lib/zernio-sdk/api/ad_creatives_api.rb', line 926

def list_partnership_ad_permissions(, opts = {})
  data, _status_code, _headers = list_partnership_ad_permissions_with_http_info(, opts)
  data
end

#list_partnership_ad_permissions_with_http_info(account_id, opts = {}) ⇒ Array<(ListPartnershipAdPermissions200Response, Integer, Hash)>

List partnership permissions Private beta. Lists granted or pending creator permissions for the advertiser Instagram Business Account. Requires instagram_branded_content_ads_brand permission.

Parameters:

  • account_id (String)

    Zernio SocialAccount ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :creator_username (String)

    Filter by creator username.

Returns:



937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
# File 'lib/zernio-sdk/api/ad_creatives_api.rb', line 937

def list_partnership_ad_permissions_with_http_info(, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AdCreativesApi.list_partnership_ad_permissions ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling AdCreativesApi.list_partnership_ad_permissions"
  end
  pattern = Regexp.new(/^[a-fA-F0-9]{24}$/)
  if @api_client.config.client_side_validation &&  !~ pattern
    fail ArgumentError, "invalid value for 'account_id' when calling AdCreativesApi.list_partnership_ad_permissions, must conform to the pattern #{pattern}."
  end

  # resource path
  local_var_path = '/v1/ads/partnership-permissions'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'accountId'] = 
  query_params[:'creatorUsername'] = opts[:'creator_username'] if !opts[:'creator_username'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListPartnershipAdPermissions200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"AdCreativesApi.list_partnership_ad_permissions",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AdCreativesApi#list_partnership_ad_permissions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#set_partnership_ad_permission(set_partnership_ad_permission_request, opts = {}) ⇒ SetPartnershipAdPermission200Response

Set partnership permission Private beta. Requests permission from a creator or revokes it when revoke is true. Requests require the creator to approve in Instagram. Requires instagram_branded_content_ads_brand permission.

Parameters:

Returns:



997
998
999
1000
# File 'lib/zernio-sdk/api/ad_creatives_api.rb', line 997

def set_partnership_ad_permission(set_partnership_ad_permission_request, opts = {})
  data, _status_code, _headers = set_partnership_ad_permission_with_http_info(set_partnership_ad_permission_request, opts)
  data
end

#set_partnership_ad_permission_with_http_info(set_partnership_ad_permission_request, opts = {}) ⇒ Array<(SetPartnershipAdPermission200Response, Integer, Hash)>

Set partnership permission Private beta. Requests permission from a creator or revokes it when revoke is true. Requests require the creator to approve in Instagram. Requires instagram_branded_content_ads_brand permission.

Parameters:

Returns:



1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
# File 'lib/zernio-sdk/api/ad_creatives_api.rb', line 1007

def set_partnership_ad_permission_with_http_info(set_partnership_ad_permission_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AdCreativesApi.set_partnership_ad_permission ...'
  end
  # verify the required parameter 'set_partnership_ad_permission_request' is set
  if @api_client.config.client_side_validation && set_partnership_ad_permission_request.nil?
    fail ArgumentError, "Missing the required parameter 'set_partnership_ad_permission_request' when calling AdCreativesApi.set_partnership_ad_permission"
  end
  # resource path
  local_var_path = '/v1/ads/partnership-permissions'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(set_partnership_ad_permission_request)

  # return_type
  return_type = opts[:debug_return_type] || 'SetPartnershipAdPermission200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"AdCreativesApi.set_partnership_ad_permission",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AdCreativesApi#set_partnership_ad_permission\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_ad_creative(creative_id, update_ad_creative_request, opts = {}) ⇒ UpdateAdCreative200Response

Rename a creative 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).

Parameters:

  • creative_id (String)

    Platform creative id

  • update_ad_creative_request (UpdateAdCreativeRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1066
1067
1068
1069
# File 'lib/zernio-sdk/api/ad_creatives_api.rb', line 1066

def update_ad_creative(creative_id, update_ad_creative_request, opts = {})
  data, _status_code, _headers = update_ad_creative_with_http_info(creative_id, update_ad_creative_request, opts)
  data
end

#update_ad_creative_with_http_info(creative_id, update_ad_creative_request, opts = {}) ⇒ Array<(UpdateAdCreative200Response, Integer, Hash)>

Rename a creative 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`).

Parameters:

  • creative_id (String)

    Platform creative id

  • update_ad_creative_request (UpdateAdCreativeRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(UpdateAdCreative200Response, Integer, Hash)>)

    UpdateAdCreative200Response data, response status code and response headers



1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
# File 'lib/zernio-sdk/api/ad_creatives_api.rb', line 1077

def update_ad_creative_with_http_info(creative_id, update_ad_creative_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AdCreativesApi.update_ad_creative ...'
  end
  # verify the required parameter 'creative_id' is set
  if @api_client.config.client_side_validation && creative_id.nil?
    fail ArgumentError, "Missing the required parameter 'creative_id' when calling AdCreativesApi.update_ad_creative"
  end
  # verify the required parameter 'update_ad_creative_request' is set
  if @api_client.config.client_side_validation && update_ad_creative_request.nil?
    fail ArgumentError, "Missing the required parameter 'update_ad_creative_request' when calling AdCreativesApi.update_ad_creative"
  end
  # resource path
  local_var_path = '/v1/ads/creatives/{creativeId}'.sub('{' + 'creativeId' + '}', CGI.escape(creative_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(update_ad_creative_request)

  # return_type
  return_type = opts[:debug_return_type] || 'UpdateAdCreative200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"AdCreativesApi.update_ad_creative",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AdCreativesApi#update_ad_creative\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#upload_ad_image(upload_ad_image_request, opts = {}) ⇒ UploadAdImage201Response

Upload an ad image from base64 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.

Parameters:

  • upload_ad_image_request (UploadAdImageRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1139
1140
1141
1142
# File 'lib/zernio-sdk/api/ad_creatives_api.rb', line 1139

def upload_ad_image(upload_ad_image_request, opts = {})
  data, _status_code, _headers = upload_ad_image_with_http_info(upload_ad_image_request, opts)
  data
end

#upload_ad_image_with_http_info(upload_ad_image_request, opts = {}) ⇒ Array<(UploadAdImage201Response, Integer, Hash)>

Upload an ad image from base64 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.

Parameters:

  • upload_ad_image_request (UploadAdImageRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(UploadAdImage201Response, Integer, Hash)>)

    UploadAdImage201Response data, response status code and response headers



1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
# File 'lib/zernio-sdk/api/ad_creatives_api.rb', line 1149

def upload_ad_image_with_http_info(upload_ad_image_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AdCreativesApi.upload_ad_image ...'
  end
  # verify the required parameter 'upload_ad_image_request' is set
  if @api_client.config.client_side_validation && upload_ad_image_request.nil?
    fail ArgumentError, "Missing the required parameter 'upload_ad_image_request' when calling AdCreativesApi.upload_ad_image"
  end
  # resource path
  local_var_path = '/v1/ads/images'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(upload_ad_image_request)

  # return_type
  return_type = opts[:debug_return_type] || 'UploadAdImage201Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"AdCreativesApi.upload_ad_image",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AdCreativesApi#upload_ad_image\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#upload_ad_video(upload_ad_video_request, opts = {}) ⇒ UploadAdVideo201Response

Upload an ad video Standalone ad-video upload (parallel to POST /v1/ads/images), so a video creative can be rendered via POST /v1/ads/preview or attached via video.id on POST /v1/ads/create before an ad exists. Accepts either an https videoUrl we download server-side (SSRF-guarded) or raw videoBase64 bytes; exactly one is required. videoBase64 is capped by Vercel's body limit, around 4.5 MB payload in practice, so larger videos must come via videoUrl. Returns the Meta video.id (reusable wherever video.id is accepted) plus Meta's auto-generated poster URL when available. The endpoint waits until Meta reports the video ready (chunked upload + transcode can take minutes; the handler runs up to 800 s).

Parameters:

  • upload_ad_video_request (UploadAdVideoRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1207
1208
1209
1210
# File 'lib/zernio-sdk/api/ad_creatives_api.rb', line 1207

def upload_ad_video(upload_ad_video_request, opts = {})
  data, _status_code, _headers = upload_ad_video_with_http_info(upload_ad_video_request, opts)
  data
end

#upload_ad_video_with_http_info(upload_ad_video_request, opts = {}) ⇒ Array<(UploadAdVideo201Response, Integer, Hash)>

Upload an ad video Standalone ad-video upload (parallel to POST /v1/ads/images), so a video creative can be rendered via POST /v1/ads/preview or attached via `video.id` on POST /v1/ads/create before an ad exists. Accepts either an https `videoUrl` we download server-side (SSRF-guarded) or raw `videoBase64` bytes; exactly one is required. `videoBase64` is capped by Vercel's body limit, around 4.5 MB payload in practice, so larger videos must come via `videoUrl`. Returns the Meta `video.id` (reusable wherever `video.id` is accepted) plus Meta's auto-generated poster URL when available. The endpoint waits until Meta reports the video ready (chunked upload + transcode can take minutes; the handler runs up to 800 s).

Parameters:

  • upload_ad_video_request (UploadAdVideoRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(UploadAdVideo201Response, Integer, Hash)>)

    UploadAdVideo201Response data, response status code and response headers



1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
# File 'lib/zernio-sdk/api/ad_creatives_api.rb', line 1217

def upload_ad_video_with_http_info(upload_ad_video_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AdCreativesApi.upload_ad_video ...'
  end
  # verify the required parameter 'upload_ad_video_request' is set
  if @api_client.config.client_side_validation && upload_ad_video_request.nil?
    fail ArgumentError, "Missing the required parameter 'upload_ad_video_request' when calling AdCreativesApi.upload_ad_video"
  end
  # resource path
  local_var_path = '/v1/ads/videos'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(upload_ad_video_request)

  # return_type
  return_type = opts[:debug_return_type] || 'UploadAdVideo201Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"AdCreativesApi.upload_ad_video",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AdCreativesApi#upload_ad_video\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end