zernio-sdk 0.0.741 → 0.0.743
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.
- checksums.yaml +4 -4
- data/README.md +5 -0
- data/docs/AdCreativesApi.md +70 -0
- data/docs/CreateCallAdRequest.md +2 -0
- data/docs/CreateMessagingAdRequest.md +2 -0
- data/docs/CtwaAdRequestBody.md +2 -0
- data/docs/CtwaAdRequestBodyCreativesInner.md +3 -1
- data/docs/CtwaAdRequestBodyCreativesInnerWelcomeMessage.md +20 -0
- data/docs/CtwaAdRequestBodyWelcomeMessage.md +20 -0
- data/docs/GetAdMedia200Response.md +22 -0
- data/docs/GetAdMedia200ResponseMediaInner.md +28 -0
- data/lib/zernio-sdk/api/ad_creatives_api.rb +63 -0
- data/lib/zernio-sdk/models/create_call_ad_request.rb +10 -1
- data/lib/zernio-sdk/models/create_messaging_ad_request.rb +10 -1
- data/lib/zernio-sdk/models/ctwa_ad_request_body.rb +10 -1
- data/lib/zernio-sdk/models/ctwa_ad_request_body_creatives_inner.rb +13 -4
- data/lib/zernio-sdk/models/ctwa_ad_request_body_creatives_inner_welcome_message.rb +211 -0
- data/lib/zernio-sdk/models/ctwa_ad_request_body_welcome_message.rb +211 -0
- data/lib/zernio-sdk/models/get_ad_media200_response.rb +168 -0
- data/lib/zernio-sdk/models/get_ad_media200_response_media_inner.rb +231 -0
- data/lib/zernio-sdk/version.rb +1 -1
- data/lib/zernio-sdk.rb +4 -0
- data/openapi.yaml +66 -0
- data/spec/api/ad_creatives_api_spec.rb +12 -0
- data/spec/models/create_call_ad_request_spec.rb +6 -0
- data/spec/models/create_messaging_ad_request_spec.rb +6 -0
- data/spec/models/ctwa_ad_request_body_creatives_inner_spec.rb +6 -0
- data/spec/models/ctwa_ad_request_body_creatives_inner_welcome_message_spec.rb +42 -0
- data/spec/models/ctwa_ad_request_body_spec.rb +6 -0
- data/spec/models/ctwa_ad_request_body_welcome_message_spec.rb +42 -0
- data/spec/models/get_ad_media200_response_media_inner_spec.rb +70 -0
- data/spec/models/get_ad_media200_response_spec.rb +48 -0
- metadata +18 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 783a8fa31662d37059fd6de4d3256b55f098875de208a586283eb58f29c36178
|
|
4
|
+
data.tar.gz: e38ee3a4b70fc71efc4827c0227ad881bc828274614398c6ec1efcc3ee9795e0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 30dab517ab7ef07a8da876e66f800fffc22fafdd6368de13b587e621262d174ee53c8c00ed86a0361cb3dabb7c4aabdd908447c6a9954b177e0f6067257a004b
|
|
7
|
+
data.tar.gz: d5437671fdce4896888b5354e4a000bfcd8dbc51f7e57ae262b6602bd361e3379da9673d1995f76de3783d1af4dd890ea9cf1aa8020a8de6961665369bcc2ea5
|
data/README.md
CHANGED
|
@@ -159,6 +159,7 @@ Class | Method | HTTP request | Description
|
|
|
159
159
|
*Zernio::AdCreativesApi* | [**delete_ad_video**](docs/AdCreativesApi.md#delete_ad_video) | **DELETE** /v1/ads/videos/{videoId} | Delete an ad video
|
|
160
160
|
*Zernio::AdCreativesApi* | [**generate_ad_previews**](docs/AdCreativesApi.md#generate_ad_previews) | **POST** /v1/ads/preview | Render pre-create ad previews
|
|
161
161
|
*Zernio::AdCreativesApi* | [**get_ad_creative**](docs/AdCreativesApi.md#get_ad_creative) | **GET** /v1/ads/creatives/{creativeId} | Creative details
|
|
162
|
+
*Zernio::AdCreativesApi* | [**get_ad_media**](docs/AdCreativesApi.md#get_ad_media) | **GET** /v1/ads/{adId}/media | Direct video and image URLs for an ad
|
|
162
163
|
*Zernio::AdCreativesApi* | [**get_ad_previews**](docs/AdCreativesApi.md#get_ad_previews) | **GET** /v1/ads/{adId}/preview | Render previews of an existing ad
|
|
163
164
|
*Zernio::AdCreativesApi* | [**list_ad_catalog_product_sets**](docs/AdCreativesApi.md#list_ad_catalog_product_sets) | **GET** /v1/ads/catalogs/{catalogId}/product-sets | List a catalog's product sets
|
|
164
165
|
*Zernio::AdCreativesApi* | [**list_ad_catalogs**](docs/AdCreativesApi.md#list_ad_catalogs) | **GET** /v1/ads/catalogs | List Meta product catalogs
|
|
@@ -1000,9 +1001,11 @@ Class | Method | HTTP request | Description
|
|
|
1000
1001
|
- [Zernio::CtwaAdRequestBodyCitiesInner](docs/CtwaAdRequestBodyCitiesInner.md)
|
|
1001
1002
|
- [Zernio::CtwaAdRequestBodyCreativesInner](docs/CtwaAdRequestBodyCreativesInner.md)
|
|
1002
1003
|
- [Zernio::CtwaAdRequestBodyCreativesInnerVideo](docs/CtwaAdRequestBodyCreativesInnerVideo.md)
|
|
1004
|
+
- [Zernio::CtwaAdRequestBodyCreativesInnerWelcomeMessage](docs/CtwaAdRequestBodyCreativesInnerWelcomeMessage.md)
|
|
1003
1005
|
- [Zernio::CtwaAdRequestBodyPlacements](docs/CtwaAdRequestBodyPlacements.md)
|
|
1004
1006
|
- [Zernio::CtwaAdRequestBodyRegionsInner](docs/CtwaAdRequestBodyRegionsInner.md)
|
|
1005
1007
|
- [Zernio::CtwaAdRequestBodyVideo](docs/CtwaAdRequestBodyVideo.md)
|
|
1008
|
+
- [Zernio::CtwaAdRequestBodyWelcomeMessage](docs/CtwaAdRequestBodyWelcomeMessage.md)
|
|
1006
1009
|
- [Zernio::CtwaAdRequestBodyZipsInner](docs/CtwaAdRequestBodyZipsInner.md)
|
|
1007
1010
|
- [Zernio::CtwaMultiResponse](docs/CtwaMultiResponse.md)
|
|
1008
1011
|
- [Zernio::CtwaSingleResponse](docs/CtwaSingleResponse.md)
|
|
@@ -1135,6 +1138,8 @@ Class | Method | HTTP request | Description
|
|
|
1135
1138
|
- [Zernio::GetAdCreative200Response](docs/GetAdCreative200Response.md)
|
|
1136
1139
|
- [Zernio::GetAdInsightsReport200Response](docs/GetAdInsightsReport200Response.md)
|
|
1137
1140
|
- [Zernio::GetAdInsightsReport200ResponsePaging](docs/GetAdInsightsReport200ResponsePaging.md)
|
|
1141
|
+
- [Zernio::GetAdMedia200Response](docs/GetAdMedia200Response.md)
|
|
1142
|
+
- [Zernio::GetAdMedia200ResponseMediaInner](docs/GetAdMedia200ResponseMediaInner.md)
|
|
1138
1143
|
- [Zernio::GetAdPreviews200Response](docs/GetAdPreviews200Response.md)
|
|
1139
1144
|
- [Zernio::GetAdSetDetails200Response](docs/GetAdSetDetails200Response.md)
|
|
1140
1145
|
- [Zernio::GetAdTrackingTags200Response](docs/GetAdTrackingTags200Response.md)
|
data/docs/AdCreativesApi.md
CHANGED
|
@@ -9,6 +9,7 @@ All URIs are relative to *https://zernio.com/api*
|
|
|
9
9
|
| [**delete_ad_video**](AdCreativesApi.md#delete_ad_video) | **DELETE** /v1/ads/videos/{videoId} | Delete an ad video |
|
|
10
10
|
| [**generate_ad_previews**](AdCreativesApi.md#generate_ad_previews) | **POST** /v1/ads/preview | Render pre-create ad previews |
|
|
11
11
|
| [**get_ad_creative**](AdCreativesApi.md#get_ad_creative) | **GET** /v1/ads/creatives/{creativeId} | Creative details |
|
|
12
|
+
| [**get_ad_media**](AdCreativesApi.md#get_ad_media) | **GET** /v1/ads/{adId}/media | Direct video and image URLs for an ad |
|
|
12
13
|
| [**get_ad_previews**](AdCreativesApi.md#get_ad_previews) | **GET** /v1/ads/{adId}/preview | Render previews of an existing ad |
|
|
13
14
|
| [**list_ad_catalog_product_sets**](AdCreativesApi.md#list_ad_catalog_product_sets) | **GET** /v1/ads/catalogs/{catalogId}/product-sets | List a catalog's product sets |
|
|
14
15
|
| [**list_ad_catalogs**](AdCreativesApi.md#list_ad_catalogs) | **GET** /v1/ads/catalogs | List Meta product catalogs |
|
|
@@ -377,6 +378,75 @@ end
|
|
|
377
378
|
- **Accept**: application/json
|
|
378
379
|
|
|
379
380
|
|
|
381
|
+
## get_ad_media
|
|
382
|
+
|
|
383
|
+
> <GetAdMedia200Response> get_ad_media(ad_id)
|
|
384
|
+
|
|
385
|
+
Direct video and image URLs for an ad
|
|
386
|
+
|
|
387
|
+
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.
|
|
388
|
+
|
|
389
|
+
### Examples
|
|
390
|
+
|
|
391
|
+
```ruby
|
|
392
|
+
require 'time'
|
|
393
|
+
require 'zernio-sdk'
|
|
394
|
+
# setup authorization
|
|
395
|
+
Zernio.configure do |config|
|
|
396
|
+
# Configure Bearer authorization (JWT): bearerAuth
|
|
397
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
398
|
+
end
|
|
399
|
+
|
|
400
|
+
api_instance = Zernio::AdCreativesApi.new
|
|
401
|
+
ad_id = 'ad_id_example' # String | Zernio ad id (24-char hex) or platform ad id.
|
|
402
|
+
|
|
403
|
+
begin
|
|
404
|
+
# Direct video and image URLs for an ad
|
|
405
|
+
result = api_instance.get_ad_media(ad_id)
|
|
406
|
+
p result
|
|
407
|
+
rescue Zernio::ApiError => e
|
|
408
|
+
puts "Error when calling AdCreativesApi->get_ad_media: #{e}"
|
|
409
|
+
end
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
#### Using the get_ad_media_with_http_info variant
|
|
413
|
+
|
|
414
|
+
This returns an Array which contains the response data, status code and headers.
|
|
415
|
+
|
|
416
|
+
> <Array(<GetAdMedia200Response>, Integer, Hash)> get_ad_media_with_http_info(ad_id)
|
|
417
|
+
|
|
418
|
+
```ruby
|
|
419
|
+
begin
|
|
420
|
+
# Direct video and image URLs for an ad
|
|
421
|
+
data, status_code, headers = api_instance.get_ad_media_with_http_info(ad_id)
|
|
422
|
+
p status_code # => 2xx
|
|
423
|
+
p headers # => { ... }
|
|
424
|
+
p data # => <GetAdMedia200Response>
|
|
425
|
+
rescue Zernio::ApiError => e
|
|
426
|
+
puts "Error when calling AdCreativesApi->get_ad_media_with_http_info: #{e}"
|
|
427
|
+
end
|
|
428
|
+
```
|
|
429
|
+
|
|
430
|
+
### Parameters
|
|
431
|
+
|
|
432
|
+
| Name | Type | Description | Notes |
|
|
433
|
+
| ---- | ---- | ----------- | ----- |
|
|
434
|
+
| **ad_id** | **String** | Zernio ad id (24-char hex) or platform ad id. | |
|
|
435
|
+
|
|
436
|
+
### Return type
|
|
437
|
+
|
|
438
|
+
[**GetAdMedia200Response**](GetAdMedia200Response.md)
|
|
439
|
+
|
|
440
|
+
### Authorization
|
|
441
|
+
|
|
442
|
+
[bearerAuth](../README.md#bearerAuth)
|
|
443
|
+
|
|
444
|
+
### HTTP request headers
|
|
445
|
+
|
|
446
|
+
- **Content-Type**: Not defined
|
|
447
|
+
- **Accept**: application/json
|
|
448
|
+
|
|
449
|
+
|
|
380
450
|
## get_ad_previews
|
|
381
451
|
|
|
382
452
|
> <GetAdPreviews200Response> get_ad_previews(ad_id, opts)
|
data/docs/CreateCallAdRequest.md
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
| **body** | **String** | Primary text shown above the image / video. Single-creative shape only. Mutually exclusive with `creatives[]`. | [optional] |
|
|
12
12
|
| **image_url** | **String** | Image asset for single-creative shape. Mutually exclusive with `video` and with `creatives[]`. Required on the single-creative shape if `video` is not supplied. | [optional] |
|
|
13
13
|
| **video** | [**CtwaAdRequestBodyVideo**](CtwaAdRequestBodyVideo.md) | | [optional] |
|
|
14
|
+
| **welcome_message** | [**CtwaAdRequestBodyWelcomeMessage**](CtwaAdRequestBodyWelcomeMessage.md) | | [optional] |
|
|
14
15
|
| **creatives** | [**Array<CtwaAdRequestBodyCreativesInner>**](CtwaAdRequestBodyCreativesInner.md) | Multi-creative shape: N CTWA ads under one campaign + one ad set, sharing budget and targeting. Mutually exclusive with the top-level single-creative fields (`headline` / `body` / `imageUrl` / `video`): setting both is a 400, unlike `POST /v1/ads/create` where the top-level fields are silently ignored in multi-creative mode. Each entry must supply its own headline, body, and exactly one of `imageUrl` / `video`. | [optional] |
|
|
15
16
|
| **ad_set_id** | **String** | Attach the creatives to this EXISTING messaging ad set instead of building a campaign, so the ad set keeps its learning phase. It then owns budget, targeting and schedule, so `budgetAmount`, `budgetType`, `endDate`, `objective`, `countries`, `interests`, `audienceId` and `campaignStatus` are rejected with a 400 alongside it. Its `destination_type` must match the ad's destination. | [optional] |
|
|
16
17
|
| **budget_amount** | **Float** | Budget amount in the ad account's currency major units (e.g. dollars for USD, not cents). Must be > 0. Required unless `adSetId` is set, where the ad set owns it. | [optional] |
|
|
@@ -53,6 +54,7 @@ instance = Zernio::CreateCallAdRequest.new(
|
|
|
53
54
|
body: null,
|
|
54
55
|
image_url: null,
|
|
55
56
|
video: null,
|
|
57
|
+
welcome_message: null,
|
|
56
58
|
creatives: null,
|
|
57
59
|
ad_set_id: null,
|
|
58
60
|
budget_amount: null,
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
| **body** | **String** | Primary text shown above the image / video. Single-creative shape only. Mutually exclusive with `creatives[]`. | [optional] |
|
|
12
12
|
| **image_url** | **String** | Image asset for single-creative shape. Mutually exclusive with `video` and with `creatives[]`. Required on the single-creative shape if `video` is not supplied. | [optional] |
|
|
13
13
|
| **video** | [**CtwaAdRequestBodyVideo**](CtwaAdRequestBodyVideo.md) | | [optional] |
|
|
14
|
+
| **welcome_message** | [**CtwaAdRequestBodyWelcomeMessage**](CtwaAdRequestBodyWelcomeMessage.md) | | [optional] |
|
|
14
15
|
| **creatives** | [**Array<CtwaAdRequestBodyCreativesInner>**](CtwaAdRequestBodyCreativesInner.md) | Multi-creative shape: N CTWA ads under one campaign + one ad set, sharing budget and targeting. Mutually exclusive with the top-level single-creative fields (`headline` / `body` / `imageUrl` / `video`): setting both is a 400, unlike `POST /v1/ads/create` where the top-level fields are silently ignored in multi-creative mode. Each entry must supply its own headline, body, and exactly one of `imageUrl` / `video`. | [optional] |
|
|
15
16
|
| **ad_set_id** | **String** | Attach the creatives to this EXISTING messaging ad set instead of building a campaign, so the ad set keeps its learning phase. It then owns budget, targeting and schedule, so `budgetAmount`, `budgetType`, `endDate`, `objective`, `countries`, `interests`, `audienceId` and `campaignStatus` are rejected with a 400 alongside it. Its `destination_type` must match the ad's destination. | [optional] |
|
|
16
17
|
| **budget_amount** | **Float** | Budget amount in the ad account's currency major units (e.g. dollars for USD, not cents). Must be > 0. Required unless `adSetId` is set, where the ad set owns it. | [optional] |
|
|
@@ -52,6 +53,7 @@ instance = Zernio::CreateMessagingAdRequest.new(
|
|
|
52
53
|
body: null,
|
|
53
54
|
image_url: null,
|
|
54
55
|
video: null,
|
|
56
|
+
welcome_message: null,
|
|
55
57
|
creatives: null,
|
|
56
58
|
ad_set_id: null,
|
|
57
59
|
budget_amount: null,
|
data/docs/CtwaAdRequestBody.md
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
| **body** | **String** | Primary text shown above the image / video. Single-creative shape only. Mutually exclusive with `creatives[]`. | [optional] |
|
|
12
12
|
| **image_url** | **String** | Image asset for single-creative shape. Mutually exclusive with `video` and with `creatives[]`. Required on the single-creative shape if `video` is not supplied. | [optional] |
|
|
13
13
|
| **video** | [**CtwaAdRequestBodyVideo**](CtwaAdRequestBodyVideo.md) | | [optional] |
|
|
14
|
+
| **welcome_message** | [**CtwaAdRequestBodyWelcomeMessage**](CtwaAdRequestBodyWelcomeMessage.md) | | [optional] |
|
|
14
15
|
| **creatives** | [**Array<CtwaAdRequestBodyCreativesInner>**](CtwaAdRequestBodyCreativesInner.md) | Multi-creative shape: N CTWA ads under one campaign + one ad set, sharing budget and targeting. Mutually exclusive with the top-level single-creative fields (`headline` / `body` / `imageUrl` / `video`): setting both is a 400, unlike `POST /v1/ads/create` where the top-level fields are silently ignored in multi-creative mode. Each entry must supply its own headline, body, and exactly one of `imageUrl` / `video`. | [optional] |
|
|
15
16
|
| **ad_set_id** | **String** | Attach the creatives to this EXISTING messaging ad set instead of building a campaign, so the ad set keeps its learning phase. It then owns budget, targeting and schedule, so `budgetAmount`, `budgetType`, `endDate`, `objective`, `countries`, `interests`, `audienceId` and `campaignStatus` are rejected with a 400 alongside it. Its `destination_type` must match the ad's destination. | [optional] |
|
|
16
17
|
| **budget_amount** | **Float** | Budget amount in the ad account's currency major units (e.g. dollars for USD, not cents). Must be > 0. Required unless `adSetId` is set, where the ad set owns it. | [optional] |
|
|
@@ -51,6 +52,7 @@ instance = Zernio::CtwaAdRequestBody.new(
|
|
|
51
52
|
body: null,
|
|
52
53
|
image_url: null,
|
|
53
54
|
video: null,
|
|
55
|
+
welcome_message: null,
|
|
54
56
|
creatives: null,
|
|
55
57
|
ad_set_id: null,
|
|
56
58
|
budget_amount: null,
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
| **body** | **String** | Primary text shown above the image / video. | |
|
|
9
9
|
| **image_url** | **String** | Image asset. Mutually exclusive with this entry's `video`. Required if `video` is not supplied. | [optional] |
|
|
10
10
|
| **video** | [**CtwaAdRequestBodyCreativesInnerVideo**](CtwaAdRequestBodyCreativesInnerVideo.md) | | [optional] |
|
|
11
|
+
| **welcome_message** | [**CtwaAdRequestBodyCreativesInnerWelcomeMessage**](CtwaAdRequestBodyCreativesInnerWelcomeMessage.md) | | [optional] |
|
|
11
12
|
|
|
12
13
|
## Example
|
|
13
14
|
|
|
@@ -18,7 +19,8 @@ instance = Zernio::CtwaAdRequestBodyCreativesInner.new(
|
|
|
18
19
|
headline: null,
|
|
19
20
|
body: null,
|
|
20
21
|
image_url: null,
|
|
21
|
-
video: null
|
|
22
|
+
video: null,
|
|
23
|
+
welcome_message: null
|
|
22
24
|
)
|
|
23
25
|
```
|
|
24
26
|
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Zernio::CtwaAdRequestBodyCreativesInnerWelcomeMessage
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **text** | **String** | Greeting shown when the chat opens. Replaces Meta's default. | |
|
|
8
|
+
| **prefill_text** | **String** | Message put into the user's text input, ready to send. Replaces Meta's default. | |
|
|
9
|
+
|
|
10
|
+
## Example
|
|
11
|
+
|
|
12
|
+
```ruby
|
|
13
|
+
require 'zernio-sdk'
|
|
14
|
+
|
|
15
|
+
instance = Zernio::CtwaAdRequestBodyCreativesInnerWelcomeMessage.new(
|
|
16
|
+
text: null,
|
|
17
|
+
prefill_text: null
|
|
18
|
+
)
|
|
19
|
+
```
|
|
20
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Zernio::CtwaAdRequestBodyWelcomeMessage
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **text** | **String** | Greeting shown when the chat opens. Replaces Meta's default (\"Hi! Can we help you?\"). | |
|
|
8
|
+
| **prefill_text** | **String** | Message put into the user's text input, ready to send. Replaces Meta's default (\"Hi! I want more info.\"). Lets one ad steer the opening message toward what it promotes (e.g. a specific product). | |
|
|
9
|
+
|
|
10
|
+
## Example
|
|
11
|
+
|
|
12
|
+
```ruby
|
|
13
|
+
require 'zernio-sdk'
|
|
14
|
+
|
|
15
|
+
instance = Zernio::CtwaAdRequestBodyWelcomeMessage.new(
|
|
16
|
+
text: null,
|
|
17
|
+
prefill_text: null
|
|
18
|
+
)
|
|
19
|
+
```
|
|
20
|
+
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Zernio::GetAdMedia200Response
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **ad_id** | **String** | | [optional] |
|
|
8
|
+
| **platform** | **String** | 'facebook' or 'instagram' — only Meta is supported for now. | [optional] |
|
|
9
|
+
| **media** | [**Array<GetAdMedia200ResponseMediaInner>**](GetAdMedia200ResponseMediaInner.md) | | [optional] |
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```ruby
|
|
14
|
+
require 'zernio-sdk'
|
|
15
|
+
|
|
16
|
+
instance = Zernio::GetAdMedia200Response.new(
|
|
17
|
+
ad_id: null,
|
|
18
|
+
platform: null,
|
|
19
|
+
media: null
|
|
20
|
+
)
|
|
21
|
+
```
|
|
22
|
+
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Zernio::GetAdMedia200ResponseMediaInner
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **type** | **String** | | [optional] |
|
|
8
|
+
| **url** | **String** | Direct file URL (signed; short-lived — see description). | [optional] |
|
|
9
|
+
| **thumbnail_url** | **String** | Video poster URL (videos only). | [optional] |
|
|
10
|
+
| **video_id** | **String** | Meta video id (videos only), reusable as video.id on the create endpoints. | [optional] |
|
|
11
|
+
| **length** | **Float** | Video length in seconds (videos only). | [optional] |
|
|
12
|
+
| **index** | **Integer** | 0-based position for carousel children or asset_feed_spec entries. | [optional] |
|
|
13
|
+
|
|
14
|
+
## Example
|
|
15
|
+
|
|
16
|
+
```ruby
|
|
17
|
+
require 'zernio-sdk'
|
|
18
|
+
|
|
19
|
+
instance = Zernio::GetAdMedia200ResponseMediaInner.new(
|
|
20
|
+
type: null,
|
|
21
|
+
url: null,
|
|
22
|
+
thumbnail_url: null,
|
|
23
|
+
video_id: null,
|
|
24
|
+
length: null,
|
|
25
|
+
index: null
|
|
26
|
+
)
|
|
27
|
+
```
|
|
28
|
+
|
|
@@ -375,6 +375,69 @@ module Zernio
|
|
|
375
375
|
return data, status_code, headers
|
|
376
376
|
end
|
|
377
377
|
|
|
378
|
+
# Direct video and image URLs for an ad
|
|
379
|
+
# 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.
|
|
380
|
+
# @param ad_id [String] Zernio ad id (24-char hex) or platform ad id.
|
|
381
|
+
# @param [Hash] opts the optional parameters
|
|
382
|
+
# @return [GetAdMedia200Response]
|
|
383
|
+
def get_ad_media(ad_id, opts = {})
|
|
384
|
+
data, _status_code, _headers = get_ad_media_with_http_info(ad_id, opts)
|
|
385
|
+
data
|
|
386
|
+
end
|
|
387
|
+
|
|
388
|
+
# Direct video and image URLs for an ad
|
|
389
|
+
# 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.
|
|
390
|
+
# @param ad_id [String] Zernio ad id (24-char hex) or platform ad id.
|
|
391
|
+
# @param [Hash] opts the optional parameters
|
|
392
|
+
# @return [Array<(GetAdMedia200Response, Integer, Hash)>] GetAdMedia200Response data, response status code and response headers
|
|
393
|
+
def get_ad_media_with_http_info(ad_id, opts = {})
|
|
394
|
+
if @api_client.config.debugging
|
|
395
|
+
@api_client.config.logger.debug 'Calling API: AdCreativesApi.get_ad_media ...'
|
|
396
|
+
end
|
|
397
|
+
# verify the required parameter 'ad_id' is set
|
|
398
|
+
if @api_client.config.client_side_validation && ad_id.nil?
|
|
399
|
+
fail ArgumentError, "Missing the required parameter 'ad_id' when calling AdCreativesApi.get_ad_media"
|
|
400
|
+
end
|
|
401
|
+
# resource path
|
|
402
|
+
local_var_path = '/v1/ads/{adId}/media'.sub('{' + 'adId' + '}', CGI.escape(ad_id.to_s))
|
|
403
|
+
|
|
404
|
+
# query parameters
|
|
405
|
+
query_params = opts[:query_params] || {}
|
|
406
|
+
|
|
407
|
+
# header parameters
|
|
408
|
+
header_params = opts[:header_params] || {}
|
|
409
|
+
# HTTP header 'Accept' (if needed)
|
|
410
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
411
|
+
|
|
412
|
+
# form parameters
|
|
413
|
+
form_params = opts[:form_params] || {}
|
|
414
|
+
|
|
415
|
+
# http body (model)
|
|
416
|
+
post_body = opts[:debug_body]
|
|
417
|
+
|
|
418
|
+
# return_type
|
|
419
|
+
return_type = opts[:debug_return_type] || 'GetAdMedia200Response'
|
|
420
|
+
|
|
421
|
+
# auth_names
|
|
422
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
423
|
+
|
|
424
|
+
new_options = opts.merge(
|
|
425
|
+
:operation => :"AdCreativesApi.get_ad_media",
|
|
426
|
+
:header_params => header_params,
|
|
427
|
+
:query_params => query_params,
|
|
428
|
+
:form_params => form_params,
|
|
429
|
+
:body => post_body,
|
|
430
|
+
:auth_names => auth_names,
|
|
431
|
+
:return_type => return_type
|
|
432
|
+
)
|
|
433
|
+
|
|
434
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
435
|
+
if @api_client.config.debugging
|
|
436
|
+
@api_client.config.logger.debug "API called: AdCreativesApi#get_ad_media\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
437
|
+
end
|
|
438
|
+
return data, status_code, headers
|
|
439
|
+
end
|
|
440
|
+
|
|
378
441
|
# Render previews of an existing ad
|
|
379
442
|
# 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.
|
|
380
443
|
# @param ad_id [String] Zernio ad id (24-char hex).
|
|
@@ -35,6 +35,8 @@ module Zernio
|
|
|
35
35
|
|
|
36
36
|
attr_accessor :video
|
|
37
37
|
|
|
38
|
+
attr_accessor :welcome_message
|
|
39
|
+
|
|
38
40
|
# Multi-creative shape: N CTWA ads under one campaign + one ad set, sharing budget and targeting. Mutually exclusive with the top-level single-creative fields (`headline` / `body` / `imageUrl` / `video`): setting both is a 400, unlike `POST /v1/ads/create` where the top-level fields are silently ignored in multi-creative mode. Each entry must supply its own headline, body, and exactly one of `imageUrl` / `video`.
|
|
39
41
|
attr_accessor :creatives
|
|
40
42
|
|
|
@@ -147,6 +149,7 @@ module Zernio
|
|
|
147
149
|
:'body' => :'body',
|
|
148
150
|
:'image_url' => :'imageUrl',
|
|
149
151
|
:'video' => :'video',
|
|
152
|
+
:'welcome_message' => :'welcomeMessage',
|
|
150
153
|
:'creatives' => :'creatives',
|
|
151
154
|
:'ad_set_id' => :'adSetId',
|
|
152
155
|
:'budget_amount' => :'budgetAmount',
|
|
@@ -198,6 +201,7 @@ module Zernio
|
|
|
198
201
|
:'body' => :'String',
|
|
199
202
|
:'image_url' => :'String',
|
|
200
203
|
:'video' => :'CtwaAdRequestBodyVideo',
|
|
204
|
+
:'welcome_message' => :'CtwaAdRequestBodyWelcomeMessage',
|
|
201
205
|
:'creatives' => :'Array<CtwaAdRequestBodyCreativesInner>',
|
|
202
206
|
:'ad_set_id' => :'String',
|
|
203
207
|
:'budget_amount' => :'Float',
|
|
@@ -292,6 +296,10 @@ module Zernio
|
|
|
292
296
|
self.video = attributes[:'video']
|
|
293
297
|
end
|
|
294
298
|
|
|
299
|
+
if attributes.key?(:'welcome_message')
|
|
300
|
+
self.welcome_message = attributes[:'welcome_message']
|
|
301
|
+
end
|
|
302
|
+
|
|
295
303
|
if attributes.key?(:'creatives')
|
|
296
304
|
if (value = attributes[:'creatives']).is_a?(Array)
|
|
297
305
|
self.creatives = value
|
|
@@ -814,6 +822,7 @@ module Zernio
|
|
|
814
822
|
body == o.body &&
|
|
815
823
|
image_url == o.image_url &&
|
|
816
824
|
video == o.video &&
|
|
825
|
+
welcome_message == o.welcome_message &&
|
|
817
826
|
creatives == o.creatives &&
|
|
818
827
|
ad_set_id == o.ad_set_id &&
|
|
819
828
|
budget_amount == o.budget_amount &&
|
|
@@ -853,7 +862,7 @@ module Zernio
|
|
|
853
862
|
# Calculates hash code according to all attributes.
|
|
854
863
|
# @return [Integer] Hash code
|
|
855
864
|
def hash
|
|
856
|
-
[account_id, ad_account_id, name, headline, body, image_url, video, creatives, ad_set_id, budget_amount, budget_type, currency, end_date, countries, cities, regions, zips, metros, custom_locations, age_min, age_max, interests, audience_id, placements, advantage_audience, objective, status, campaign_status, bid_strategy, bid_amount, roas_average_floor, dsa_beneficiary, dsa_payor, phone_number, link_url].hash
|
|
865
|
+
[account_id, ad_account_id, name, headline, body, image_url, video, welcome_message, creatives, ad_set_id, budget_amount, budget_type, currency, end_date, countries, cities, regions, zips, metros, custom_locations, age_min, age_max, interests, audience_id, placements, advantage_audience, objective, status, campaign_status, bid_strategy, bid_amount, roas_average_floor, dsa_beneficiary, dsa_payor, phone_number, link_url].hash
|
|
857
866
|
end
|
|
858
867
|
|
|
859
868
|
# Builds the object from hash
|
|
@@ -35,6 +35,8 @@ module Zernio
|
|
|
35
35
|
|
|
36
36
|
attr_accessor :video
|
|
37
37
|
|
|
38
|
+
attr_accessor :welcome_message
|
|
39
|
+
|
|
38
40
|
# Multi-creative shape: N CTWA ads under one campaign + one ad set, sharing budget and targeting. Mutually exclusive with the top-level single-creative fields (`headline` / `body` / `imageUrl` / `video`): setting both is a 400, unlike `POST /v1/ads/create` where the top-level fields are silently ignored in multi-creative mode. Each entry must supply its own headline, body, and exactly one of `imageUrl` / `video`.
|
|
39
41
|
attr_accessor :creatives
|
|
40
42
|
|
|
@@ -144,6 +146,7 @@ module Zernio
|
|
|
144
146
|
:'body' => :'body',
|
|
145
147
|
:'image_url' => :'imageUrl',
|
|
146
148
|
:'video' => :'video',
|
|
149
|
+
:'welcome_message' => :'welcomeMessage',
|
|
147
150
|
:'creatives' => :'creatives',
|
|
148
151
|
:'ad_set_id' => :'adSetId',
|
|
149
152
|
:'budget_amount' => :'budgetAmount',
|
|
@@ -194,6 +197,7 @@ module Zernio
|
|
|
194
197
|
:'body' => :'String',
|
|
195
198
|
:'image_url' => :'String',
|
|
196
199
|
:'video' => :'CtwaAdRequestBodyVideo',
|
|
200
|
+
:'welcome_message' => :'CtwaAdRequestBodyWelcomeMessage',
|
|
197
201
|
:'creatives' => :'Array<CtwaAdRequestBodyCreativesInner>',
|
|
198
202
|
:'ad_set_id' => :'String',
|
|
199
203
|
:'budget_amount' => :'Float',
|
|
@@ -287,6 +291,10 @@ module Zernio
|
|
|
287
291
|
self.video = attributes[:'video']
|
|
288
292
|
end
|
|
289
293
|
|
|
294
|
+
if attributes.key?(:'welcome_message')
|
|
295
|
+
self.welcome_message = attributes[:'welcome_message']
|
|
296
|
+
end
|
|
297
|
+
|
|
290
298
|
if attributes.key?(:'creatives')
|
|
291
299
|
if (value = attributes[:'creatives']).is_a?(Array)
|
|
292
300
|
self.creatives = value
|
|
@@ -790,6 +798,7 @@ module Zernio
|
|
|
790
798
|
body == o.body &&
|
|
791
799
|
image_url == o.image_url &&
|
|
792
800
|
video == o.video &&
|
|
801
|
+
welcome_message == o.welcome_message &&
|
|
793
802
|
creatives == o.creatives &&
|
|
794
803
|
ad_set_id == o.ad_set_id &&
|
|
795
804
|
budget_amount == o.budget_amount &&
|
|
@@ -828,7 +837,7 @@ module Zernio
|
|
|
828
837
|
# Calculates hash code according to all attributes.
|
|
829
838
|
# @return [Integer] Hash code
|
|
830
839
|
def hash
|
|
831
|
-
[account_id, ad_account_id, name, headline, body, image_url, video, creatives, ad_set_id, budget_amount, budget_type, currency, end_date, countries, cities, regions, zips, metros, custom_locations, age_min, age_max, interests, audience_id, placements, advantage_audience, objective, status, campaign_status, bid_strategy, bid_amount, roas_average_floor, dsa_beneficiary, dsa_payor, destination].hash
|
|
840
|
+
[account_id, ad_account_id, name, headline, body, image_url, video, welcome_message, creatives, ad_set_id, budget_amount, budget_type, currency, end_date, countries, cities, regions, zips, metros, custom_locations, age_min, age_max, interests, audience_id, placements, advantage_audience, objective, status, campaign_status, bid_strategy, bid_amount, roas_average_floor, dsa_beneficiary, dsa_payor, destination].hash
|
|
832
841
|
end
|
|
833
842
|
|
|
834
843
|
# Builds the object from hash
|
|
@@ -36,6 +36,8 @@ module Zernio
|
|
|
36
36
|
|
|
37
37
|
attr_accessor :video
|
|
38
38
|
|
|
39
|
+
attr_accessor :welcome_message
|
|
40
|
+
|
|
39
41
|
# Multi-creative shape: N CTWA ads under one campaign + one ad set, sharing budget and targeting. Mutually exclusive with the top-level single-creative fields (`headline` / `body` / `imageUrl` / `video`): setting both is a 400, unlike `POST /v1/ads/create` where the top-level fields are silently ignored in multi-creative mode. Each entry must supply its own headline, body, and exactly one of `imageUrl` / `video`.
|
|
40
42
|
attr_accessor :creatives
|
|
41
43
|
|
|
@@ -142,6 +144,7 @@ module Zernio
|
|
|
142
144
|
:'body' => :'body',
|
|
143
145
|
:'image_url' => :'imageUrl',
|
|
144
146
|
:'video' => :'video',
|
|
147
|
+
:'welcome_message' => :'welcomeMessage',
|
|
145
148
|
:'creatives' => :'creatives',
|
|
146
149
|
:'ad_set_id' => :'adSetId',
|
|
147
150
|
:'budget_amount' => :'budgetAmount',
|
|
@@ -191,6 +194,7 @@ module Zernio
|
|
|
191
194
|
:'body' => :'String',
|
|
192
195
|
:'image_url' => :'String',
|
|
193
196
|
:'video' => :'CtwaAdRequestBodyVideo',
|
|
197
|
+
:'welcome_message' => :'CtwaAdRequestBodyWelcomeMessage',
|
|
194
198
|
:'creatives' => :'Array<CtwaAdRequestBodyCreativesInner>',
|
|
195
199
|
:'ad_set_id' => :'String',
|
|
196
200
|
:'budget_amount' => :'Float',
|
|
@@ -276,6 +280,10 @@ module Zernio
|
|
|
276
280
|
self.video = attributes[:'video']
|
|
277
281
|
end
|
|
278
282
|
|
|
283
|
+
if attributes.key?(:'welcome_message')
|
|
284
|
+
self.welcome_message = attributes[:'welcome_message']
|
|
285
|
+
end
|
|
286
|
+
|
|
279
287
|
if attributes.key?(:'creatives')
|
|
280
288
|
if (value = attributes[:'creatives']).is_a?(Array)
|
|
281
289
|
self.creatives = value
|
|
@@ -756,6 +764,7 @@ module Zernio
|
|
|
756
764
|
body == o.body &&
|
|
757
765
|
image_url == o.image_url &&
|
|
758
766
|
video == o.video &&
|
|
767
|
+
welcome_message == o.welcome_message &&
|
|
759
768
|
creatives == o.creatives &&
|
|
760
769
|
ad_set_id == o.ad_set_id &&
|
|
761
770
|
budget_amount == o.budget_amount &&
|
|
@@ -793,7 +802,7 @@ module Zernio
|
|
|
793
802
|
# Calculates hash code according to all attributes.
|
|
794
803
|
# @return [Integer] Hash code
|
|
795
804
|
def hash
|
|
796
|
-
[account_id, ad_account_id, name, headline, body, image_url, video, creatives, ad_set_id, budget_amount, budget_type, currency, end_date, countries, cities, regions, zips, metros, custom_locations, age_min, age_max, interests, audience_id, placements, advantage_audience, objective, status, campaign_status, bid_strategy, bid_amount, roas_average_floor, dsa_beneficiary, dsa_payor].hash
|
|
805
|
+
[account_id, ad_account_id, name, headline, body, image_url, video, welcome_message, creatives, ad_set_id, budget_amount, budget_type, currency, end_date, countries, cities, regions, zips, metros, custom_locations, age_min, age_max, interests, audience_id, placements, advantage_audience, objective, status, campaign_status, bid_strategy, bid_amount, roas_average_floor, dsa_beneficiary, dsa_payor].hash
|
|
797
806
|
end
|
|
798
807
|
|
|
799
808
|
# Builds the object from hash
|
|
@@ -26,13 +26,16 @@ module Zernio
|
|
|
26
26
|
|
|
27
27
|
attr_accessor :video
|
|
28
28
|
|
|
29
|
+
attr_accessor :welcome_message
|
|
30
|
+
|
|
29
31
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
30
32
|
def self.attribute_map
|
|
31
33
|
{
|
|
32
34
|
:'headline' => :'headline',
|
|
33
35
|
:'body' => :'body',
|
|
34
36
|
:'image_url' => :'imageUrl',
|
|
35
|
-
:'video' => :'video'
|
|
37
|
+
:'video' => :'video',
|
|
38
|
+
:'welcome_message' => :'welcomeMessage'
|
|
36
39
|
}
|
|
37
40
|
end
|
|
38
41
|
|
|
@@ -52,7 +55,8 @@ module Zernio
|
|
|
52
55
|
:'headline' => :'String',
|
|
53
56
|
:'body' => :'String',
|
|
54
57
|
:'image_url' => :'String',
|
|
55
|
-
:'video' => :'CtwaAdRequestBodyCreativesInnerVideo'
|
|
58
|
+
:'video' => :'CtwaAdRequestBodyCreativesInnerVideo',
|
|
59
|
+
:'welcome_message' => :'CtwaAdRequestBodyCreativesInnerWelcomeMessage'
|
|
56
60
|
}
|
|
57
61
|
end
|
|
58
62
|
|
|
@@ -97,6 +101,10 @@ module Zernio
|
|
|
97
101
|
if attributes.key?(:'video')
|
|
98
102
|
self.video = attributes[:'video']
|
|
99
103
|
end
|
|
104
|
+
|
|
105
|
+
if attributes.key?(:'welcome_message')
|
|
106
|
+
self.welcome_message = attributes[:'welcome_message']
|
|
107
|
+
end
|
|
100
108
|
end
|
|
101
109
|
|
|
102
110
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -179,7 +187,8 @@ module Zernio
|
|
|
179
187
|
headline == o.headline &&
|
|
180
188
|
body == o.body &&
|
|
181
189
|
image_url == o.image_url &&
|
|
182
|
-
video == o.video
|
|
190
|
+
video == o.video &&
|
|
191
|
+
welcome_message == o.welcome_message
|
|
183
192
|
end
|
|
184
193
|
|
|
185
194
|
# @see the `==` method
|
|
@@ -191,7 +200,7 @@ module Zernio
|
|
|
191
200
|
# Calculates hash code according to all attributes.
|
|
192
201
|
# @return [Integer] Hash code
|
|
193
202
|
def hash
|
|
194
|
-
[headline, body, image_url, video].hash
|
|
203
|
+
[headline, body, image_url, video, welcome_message].hash
|
|
195
204
|
end
|
|
196
205
|
|
|
197
206
|
# Builds the object from hash
|