late-sdk 0.0.770 → 0.0.772
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 +7 -0
- data/docs/AdCampaignsApi.md +72 -0
- data/docs/AnalyticsApi.md +2 -2
- data/docs/AttachCampaignAssets201Response.md +24 -0
- data/docs/AttachCampaignAssetsRequest.md +24 -0
- data/docs/AttachCampaignAssetsRequestSitelinksInner.md +24 -0
- data/docs/AttachCampaignAssetsRequestStructuredSnippetsInner.md +20 -0
- data/docs/CreateInboxConversationRequest.md +3 -1
- data/docs/CreateInboxConversationRequestTemplateButtonParamsInner.md +22 -0
- data/docs/CreateStandaloneAdRequest.md +4 -0
- data/docs/CreateStandaloneAdRequestStructuredSnippetsInner.md +20 -0
- data/docs/MessagesApi.md +1 -1
- data/docs/PostAnalytics.md +4 -0
- data/docs/TargetingSpec.md +2 -2
- data/lib/zernio-sdk/api/ad_campaigns_api.rb +74 -0
- data/lib/zernio-sdk/api/analytics_api.rb +3 -3
- data/lib/zernio-sdk/api/messages_api.rb +2 -2
- data/lib/zernio-sdk/models/ad_tree_campaign_optimization_goal.rb +1 -0
- data/lib/zernio-sdk/models/attach_campaign_assets201_response.rb +180 -0
- data/lib/zernio-sdk/models/attach_campaign_assets_request.rb +283 -0
- data/lib/zernio-sdk/models/attach_campaign_assets_request_sitelinks_inner.rb +282 -0
- data/lib/zernio-sdk/models/attach_campaign_assets_request_structured_snippets_inner.rb +234 -0
- data/lib/zernio-sdk/models/create_inbox_conversation_request.rb +33 -2
- data/lib/zernio-sdk/models/create_inbox_conversation_request_template_button_params_inner.rb +270 -0
- data/lib/zernio-sdk/models/create_standalone_ad_request.rb +81 -1
- data/lib/zernio-sdk/models/create_standalone_ad_request_structured_snippets_inner.rb +235 -0
- data/lib/zernio-sdk/models/post_analytics.rb +21 -1
- data/lib/zernio-sdk/models/targeting_spec.rb +2 -0
- data/lib/zernio-sdk/version.rb +1 -1
- data/lib/zernio-sdk.rb +6 -0
- data/openapi.yaml +167 -10
- data/spec/api/ad_campaigns_api_spec.rb +13 -0
- data/spec/api/analytics_api_spec.rb +1 -1
- data/spec/api/messages_api_spec.rb +1 -1
- data/spec/models/attach_campaign_assets201_response_spec.rb +54 -0
- data/spec/models/attach_campaign_assets_request_sitelinks_inner_spec.rb +54 -0
- data/spec/models/attach_campaign_assets_request_spec.rb +54 -0
- data/spec/models/attach_campaign_assets_request_structured_snippets_inner_spec.rb +46 -0
- data/spec/models/create_inbox_conversation_request_spec.rb +6 -0
- data/spec/models/create_inbox_conversation_request_template_button_params_inner_spec.rb +52 -0
- data/spec/models/create_standalone_ad_request_spec.rb +12 -0
- data/spec/models/create_standalone_ad_request_structured_snippets_inner_spec.rb +46 -0
- data/spec/models/post_analytics_spec.rb +12 -0
- data/zernio-sdk-0.0.772.gem +0 -0
- metadata +26 -2
- data/zernio-sdk-0.0.770.gem +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a624e7747a9cc05325e7b597a2832f12bf29df06dc60df2b0683bfe6e6d6e4c4
|
|
4
|
+
data.tar.gz: 72fc9d4ccc9fb86df390dfe3b1073c079deb91d3f3e8d003fe7cf4606ca44f22
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1d7064ca8eb30b6fc42471286636fb6ed945201e4c9fe58b1fce8f7341a56181e12d01b8bda9cc4dc3ec70fbc0cc243a6ed0fb6e7277e7472bd770684b977e8d
|
|
7
|
+
data.tar.gz: c1f4d33a4abb18a7c1f73f11186f74437a1212be6b73f0cfd8852da23e4b7c5e51203c9830cd4550da55b1e45bc38bcabf680962c0329ec24869e70f24fba8da
|
data/README.md
CHANGED
|
@@ -132,6 +132,7 @@ Class | Method | HTTP request | Description
|
|
|
132
132
|
*Zernio::AdAudiencesApi* | [**list_ad_audiences**](docs/AdAudiencesApi.md#list_ad_audiences) | **GET** /v1/ads/audiences | List custom audiences
|
|
133
133
|
*Zernio::AdAudiencesApi* | [**replace_ad_audience_companies**](docs/AdAudiencesApi.md#replace_ad_audience_companies) | **POST** /v1/ads/audiences/{audienceId}/companies | Replace audience companies
|
|
134
134
|
*Zernio::AdAudiencesApi* | [**update_ad_audience**](docs/AdAudiencesApi.md#update_ad_audience) | **PUT** /v1/ads/audiences/{audienceId} | Update an audience
|
|
135
|
+
*Zernio::AdCampaignsApi* | [**attach_campaign_assets**](docs/AdCampaignsApi.md#attach_campaign_assets) | **POST** /v1/ads/campaigns/{campaignId}/assets | Attach extension assets to a Google Search campaign
|
|
135
136
|
*Zernio::AdCampaignsApi* | [**boost_post**](docs/AdCampaignsApi.md#boost_post) | **POST** /v1/ads/boost | Boost post as ad
|
|
136
137
|
*Zernio::AdCampaignsApi* | [**bulk_update_ad_campaign_status**](docs/AdCampaignsApi.md#bulk_update_ad_campaign_status) | **POST** /v1/ads/campaigns/bulk-status | Pause or resume many campaigns
|
|
137
138
|
*Zernio::AdCampaignsApi* | [**create_ad_campaign**](docs/AdCampaignsApi.md#create_ad_campaign) | **POST** /v1/ads/campaigns | Create a standalone campaign
|
|
@@ -736,6 +737,10 @@ Class | Method | HTTP request | Description
|
|
|
736
737
|
- [Zernio::AssignGoogleBusinessLocation200Response](docs/AssignGoogleBusinessLocation200Response.md)
|
|
737
738
|
- [Zernio::AssignGoogleBusinessLocation200ResponseAccount](docs/AssignGoogleBusinessLocation200ResponseAccount.md)
|
|
738
739
|
- [Zernio::AssignGoogleBusinessLocationRequest](docs/AssignGoogleBusinessLocationRequest.md)
|
|
740
|
+
- [Zernio::AttachCampaignAssets201Response](docs/AttachCampaignAssets201Response.md)
|
|
741
|
+
- [Zernio::AttachCampaignAssetsRequest](docs/AttachCampaignAssetsRequest.md)
|
|
742
|
+
- [Zernio::AttachCampaignAssetsRequestSitelinksInner](docs/AttachCampaignAssetsRequestSitelinksInner.md)
|
|
743
|
+
- [Zernio::AttachCampaignAssetsRequestStructuredSnippetsInner](docs/AttachCampaignAssetsRequestStructuredSnippetsInner.md)
|
|
739
744
|
- [Zernio::AttachNumberToSipTrunk200Response](docs/AttachNumberToSipTrunk200Response.md)
|
|
740
745
|
- [Zernio::AttachNumberToSipTrunkRequest](docs/AttachNumberToSipTrunkRequest.md)
|
|
741
746
|
- [Zernio::BatchGetGoogleBusinessReviews200Response](docs/BatchGetGoogleBusinessReviews200Response.md)
|
|
@@ -906,6 +911,7 @@ Class | Method | HTTP request | Description
|
|
|
906
911
|
- [Zernio::CreateInboxConversation429Response](docs/CreateInboxConversation429Response.md)
|
|
907
912
|
- [Zernio::CreateInboxConversationRequest](docs/CreateInboxConversationRequest.md)
|
|
908
913
|
- [Zernio::CreateInboxConversationRequestHeaderMedia](docs/CreateInboxConversationRequestHeaderMedia.md)
|
|
914
|
+
- [Zernio::CreateInboxConversationRequestTemplateButtonParamsInner](docs/CreateInboxConversationRequestTemplateButtonParamsInner.md)
|
|
909
915
|
- [Zernio::CreateInviteToken201Response](docs/CreateInviteToken201Response.md)
|
|
910
916
|
- [Zernio::CreateInviteTokenRequest](docs/CreateInviteTokenRequest.md)
|
|
911
917
|
- [Zernio::CreateLeadForm200Response](docs/CreateLeadForm200Response.md)
|
|
@@ -971,6 +977,7 @@ Class | Method | HTTP request | Description
|
|
|
971
977
|
- [Zernio::CreateStandaloneAdRequestPromotedObject](docs/CreateStandaloneAdRequestPromotedObject.md)
|
|
972
978
|
- [Zernio::CreateStandaloneAdRequestRegionsInner](docs/CreateStandaloneAdRequestRegionsInner.md)
|
|
973
979
|
- [Zernio::CreateStandaloneAdRequestSitelinksInner](docs/CreateStandaloneAdRequestSitelinksInner.md)
|
|
980
|
+
- [Zernio::CreateStandaloneAdRequestStructuredSnippetsInner](docs/CreateStandaloneAdRequestStructuredSnippetsInner.md)
|
|
974
981
|
- [Zernio::CreateStandaloneAdRequestTracking](docs/CreateStandaloneAdRequestTracking.md)
|
|
975
982
|
- [Zernio::CreateStandaloneAdRequestTranslationsInner](docs/CreateStandaloneAdRequestTranslationsInner.md)
|
|
976
983
|
- [Zernio::CreateStandaloneAdRequestVideo](docs/CreateStandaloneAdRequestVideo.md)
|
data/docs/AdCampaignsApi.md
CHANGED
|
@@ -4,6 +4,7 @@ All URIs are relative to *https://zernio.com/api*
|
|
|
4
4
|
|
|
5
5
|
| Method | HTTP request | Description |
|
|
6
6
|
| ------ | ------------ | ----------- |
|
|
7
|
+
| [**attach_campaign_assets**](AdCampaignsApi.md#attach_campaign_assets) | **POST** /v1/ads/campaigns/{campaignId}/assets | Attach extension assets to a Google Search campaign |
|
|
7
8
|
| [**boost_post**](AdCampaignsApi.md#boost_post) | **POST** /v1/ads/boost | Boost post as ad |
|
|
8
9
|
| [**bulk_update_ad_campaign_status**](AdCampaignsApi.md#bulk_update_ad_campaign_status) | **POST** /v1/ads/campaigns/bulk-status | Pause or resume many campaigns |
|
|
9
10
|
| [**create_ad_campaign**](AdCampaignsApi.md#create_ad_campaign) | **POST** /v1/ads/campaigns | Create a standalone campaign |
|
|
@@ -28,6 +29,77 @@ All URIs are relative to *https://zernio.com/api*
|
|
|
28
29
|
| [**update_ad_status**](AdCampaignsApi.md#update_ad_status) | **PUT** /v1/ads/{adId}/status | Pause or resume a single ad |
|
|
29
30
|
|
|
30
31
|
|
|
32
|
+
## attach_campaign_assets
|
|
33
|
+
|
|
34
|
+
> <AttachCampaignAssets201Response> attach_campaign_assets(campaign_id, attach_campaign_assets_request)
|
|
35
|
+
|
|
36
|
+
Attach extension assets to a Google Search campaign
|
|
37
|
+
|
|
38
|
+
Attach sitelinks, callouts and/or structured snippets to an already-existing Google Search campaign — the same builders POST /v1/ads/create uses, but without rebuilding the hierarchy. At least one of sitelinks, callouts or structuredSnippets is required. Google-only. Other platforms have no equivalent extension surface and return 501. Approval status is Google-async; poll `asset.policy_summary` after review. Assets stay in the account library even if the campaign is later deleted.
|
|
39
|
+
|
|
40
|
+
### Examples
|
|
41
|
+
|
|
42
|
+
```ruby
|
|
43
|
+
require 'time'
|
|
44
|
+
require 'zernio-sdk'
|
|
45
|
+
# setup authorization
|
|
46
|
+
Zernio.configure do |config|
|
|
47
|
+
# Configure Bearer authorization (JWT): bearerAuth
|
|
48
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
api_instance = Zernio::AdCampaignsApi.new
|
|
52
|
+
campaign_id = 'campaign_id_example' # String | Numeric Google platform campaign id.
|
|
53
|
+
attach_campaign_assets_request = Zernio::AttachCampaignAssetsRequest.new({account_id: 'account_id_example'}) # AttachCampaignAssetsRequest |
|
|
54
|
+
|
|
55
|
+
begin
|
|
56
|
+
# Attach extension assets to a Google Search campaign
|
|
57
|
+
result = api_instance.attach_campaign_assets(campaign_id, attach_campaign_assets_request)
|
|
58
|
+
p result
|
|
59
|
+
rescue Zernio::ApiError => e
|
|
60
|
+
puts "Error when calling AdCampaignsApi->attach_campaign_assets: #{e}"
|
|
61
|
+
end
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
#### Using the attach_campaign_assets_with_http_info variant
|
|
65
|
+
|
|
66
|
+
This returns an Array which contains the response data, status code and headers.
|
|
67
|
+
|
|
68
|
+
> <Array(<AttachCampaignAssets201Response>, Integer, Hash)> attach_campaign_assets_with_http_info(campaign_id, attach_campaign_assets_request)
|
|
69
|
+
|
|
70
|
+
```ruby
|
|
71
|
+
begin
|
|
72
|
+
# Attach extension assets to a Google Search campaign
|
|
73
|
+
data, status_code, headers = api_instance.attach_campaign_assets_with_http_info(campaign_id, attach_campaign_assets_request)
|
|
74
|
+
p status_code # => 2xx
|
|
75
|
+
p headers # => { ... }
|
|
76
|
+
p data # => <AttachCampaignAssets201Response>
|
|
77
|
+
rescue Zernio::ApiError => e
|
|
78
|
+
puts "Error when calling AdCampaignsApi->attach_campaign_assets_with_http_info: #{e}"
|
|
79
|
+
end
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Parameters
|
|
83
|
+
|
|
84
|
+
| Name | Type | Description | Notes |
|
|
85
|
+
| ---- | ---- | ----------- | ----- |
|
|
86
|
+
| **campaign_id** | **String** | Numeric Google platform campaign id. | |
|
|
87
|
+
| **attach_campaign_assets_request** | [**AttachCampaignAssetsRequest**](AttachCampaignAssetsRequest.md) | | |
|
|
88
|
+
|
|
89
|
+
### Return type
|
|
90
|
+
|
|
91
|
+
[**AttachCampaignAssets201Response**](AttachCampaignAssets201Response.md)
|
|
92
|
+
|
|
93
|
+
### Authorization
|
|
94
|
+
|
|
95
|
+
[bearerAuth](../README.md#bearerAuth)
|
|
96
|
+
|
|
97
|
+
### HTTP request headers
|
|
98
|
+
|
|
99
|
+
- **Content-Type**: application/json
|
|
100
|
+
- **Accept**: application/json
|
|
101
|
+
|
|
102
|
+
|
|
31
103
|
## boost_post
|
|
32
104
|
|
|
33
105
|
> <UpdateAd200Response> boost_post(boost_post_request, opts)
|
data/docs/AnalyticsApi.md
CHANGED
|
@@ -61,7 +61,7 @@ opts = {
|
|
|
61
61
|
to_date: Date.parse('2013-10-20'), # Date | Inclusive upper bound (YYYY-MM-DD). Defaults to today if omitted.
|
|
62
62
|
limit: 56, # Integer | Page size (default 50)
|
|
63
63
|
page: 56, # Integer | Page number (default 1)
|
|
64
|
-
sort_by: 'date', # String | Sort by date, engagement, or a specific metric
|
|
64
|
+
sort_by: 'date', # String | Sort by date, engagement, or a specific metric. Instagram-only metrics (follows, reposts, reels_skip_rate, ig_reels_*) sort posts with no value as 0.
|
|
65
65
|
order: 'asc' # String | Sort order
|
|
66
66
|
}
|
|
67
67
|
|
|
@@ -105,7 +105,7 @@ end
|
|
|
105
105
|
| **to_date** | **Date** | Inclusive upper bound (YYYY-MM-DD). Defaults to today if omitted. | [optional] |
|
|
106
106
|
| **limit** | **Integer** | Page size (default 50) | [optional][default to 50] |
|
|
107
107
|
| **page** | **Integer** | Page number (default 1) | [optional][default to 1] |
|
|
108
|
-
| **sort_by** | **String** | Sort by date, engagement, or a specific metric | [optional][default to 'date'] |
|
|
108
|
+
| **sort_by** | **String** | Sort by date, engagement, or a specific metric. Instagram-only metrics (follows, reposts, reels_skip_rate, ig_reels_*) sort posts with no value as 0. | [optional][default to 'date'] |
|
|
109
109
|
| **order** | **String** | Sort order | [optional][default to 'desc'] |
|
|
110
110
|
|
|
111
111
|
### Return type
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Zernio::AttachCampaignAssets201Response
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **campaign_id** | **String** | | [optional] |
|
|
8
|
+
| **sitelink_asset_resource_names** | **Array<String>** | | [optional] |
|
|
9
|
+
| **callout_asset_resource_names** | **Array<String>** | | [optional] |
|
|
10
|
+
| **structured_snippet_asset_resource_names** | **Array<String>** | | [optional] |
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```ruby
|
|
15
|
+
require 'zernio-sdk'
|
|
16
|
+
|
|
17
|
+
instance = Zernio::AttachCampaignAssets201Response.new(
|
|
18
|
+
campaign_id: null,
|
|
19
|
+
sitelink_asset_resource_names: null,
|
|
20
|
+
callout_asset_resource_names: null,
|
|
21
|
+
structured_snippet_asset_resource_names: null
|
|
22
|
+
)
|
|
23
|
+
```
|
|
24
|
+
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Zernio::AttachCampaignAssetsRequest
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **account_id** | **String** | Zernio Google Ads SocialAccount id — resolves the customer id + refresh token. | |
|
|
8
|
+
| **sitelinks** | [**Array<AttachCampaignAssetsRequestSitelinksInner>**](AttachCampaignAssetsRequestSitelinksInner.md) | See POST /v1/ads/create sitelinks — same shape. | [optional] |
|
|
9
|
+
| **callouts** | **Array<String>** | | [optional] |
|
|
10
|
+
| **structured_snippets** | [**Array<AttachCampaignAssetsRequestStructuredSnippetsInner>**](AttachCampaignAssetsRequestStructuredSnippetsInner.md) | | [optional] |
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```ruby
|
|
15
|
+
require 'zernio-sdk'
|
|
16
|
+
|
|
17
|
+
instance = Zernio::AttachCampaignAssetsRequest.new(
|
|
18
|
+
account_id: null,
|
|
19
|
+
sitelinks: null,
|
|
20
|
+
callouts: null,
|
|
21
|
+
structured_snippets: null
|
|
22
|
+
)
|
|
23
|
+
```
|
|
24
|
+
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Zernio::AttachCampaignAssetsRequestSitelinksInner
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **text** | **String** | | |
|
|
8
|
+
| **link_url** | **String** | | |
|
|
9
|
+
| **description1** | **String** | | [optional] |
|
|
10
|
+
| **description2** | **String** | | [optional] |
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```ruby
|
|
15
|
+
require 'zernio-sdk'
|
|
16
|
+
|
|
17
|
+
instance = Zernio::AttachCampaignAssetsRequestSitelinksInner.new(
|
|
18
|
+
text: null,
|
|
19
|
+
link_url: null,
|
|
20
|
+
description1: null,
|
|
21
|
+
description2: null
|
|
22
|
+
)
|
|
23
|
+
```
|
|
24
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Zernio::AttachCampaignAssetsRequestStructuredSnippetsInner
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **header** | **String** | | |
|
|
8
|
+
| **values** | **Array<String>** | | |
|
|
9
|
+
|
|
10
|
+
## Example
|
|
11
|
+
|
|
12
|
+
```ruby
|
|
13
|
+
require 'zernio-sdk'
|
|
14
|
+
|
|
15
|
+
instance = Zernio::AttachCampaignAssetsRequestStructuredSnippetsInner.new(
|
|
16
|
+
header: null,
|
|
17
|
+
values: null
|
|
18
|
+
)
|
|
19
|
+
```
|
|
20
|
+
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
| **category** | **String** | WhatsApp only (Meta Direct Send). Combined with message and without templateName, starts the conversation with a business-initiated UTILITY message and no pre-approved template; Meta matches or auto-creates a template asynchronously. The WhatsApp Business Account must be eligible for Direct Send, otherwise the send fails with an error telling you to use an approved message template instead. Cannot be combined with templateName (templates are already categorized at creation). Utility messages only; marketing content is not allowed under this category. Accepted on the JSON body only, not on multipart requests. | [optional] |
|
|
14
14
|
| **link_preview** | **Boolean** | WhatsApp only. Set false to send the Direct Send (category: 'utility') text message without a link-preview thumbnail for the first URL in the text. Defaults to true, which is how every WhatsApp text has been sent to date. Does not apply to template sends. Accepted on the JSON body only, not on multipart requests. | [optional][default to true] |
|
|
15
15
|
| **template_language** | **String** | WhatsApp only. Template language code (e.g. en_US). | [optional] |
|
|
16
|
-
| **template_params** | **Array<String>** | WhatsApp only. Template variable values as one flat array, in the order the variables appear across the whole template: text-header variables first, then body variables, then one value per dynamic URL button (in button order). Works with positional placeholders ({{1}}, {{2}}, ...) and with named placeholders ({{name}}, {{company}} - how Meta Business Manager creates templates), where values fill the named slots in order of appearance. Example - a body with {{1}}, {{2}} plus a URL button https://example.com/{{1}} takes three values: [body1, body2, buttonSuffix]. Media headers (image, video, document) are filled automatically from the approved template and take no value here (use headerMedia to override the header asset per send). | [optional] |
|
|
16
|
+
| **template_params** | **Array<String>** | WhatsApp only. Template variable values as one flat array, in the order the variables appear across the whole template: text-header variables first, then body variables, then one value per dynamic URL button (in button order). Works with positional placeholders ({{1}}, {{2}}, ...) and with named placeholders ({{name}}, {{company}} - how Meta Business Manager creates templates), where values fill the named slots in order of appearance. Example - a body with {{1}}, {{2}} plus a URL button https://example.com/{{1}} takes three values: [body1, body2, buttonSuffix]. Media headers (image, video, document) are filled automatically from the approved template and take no value here (use headerMedia to override the header asset per send). Buttons that are not dynamic-URL buttons (copy-code, flow) take no value here either; use templateButtonParams. | [optional] |
|
|
17
|
+
| **template_button_params** | [**Array<CreateInboxConversationRequestTemplateButtonParamsInner>**](CreateInboxConversationRequestTemplateButtonParamsInner.md) | WhatsApp only. Values for template buttons that carry one at send time, each addressed by the button's position in the approved template. This is the only way to send a copy-code button's payload (a Pix payment code, a coupon) or a flow token, because templateParams is a flat array of text variables and covers dynamic URL buttons only. Supplying a button here overrides whatever templateParams would have derived for that same index, so the send never carries one button twice; repeating an index within this array is rejected with 400. Each index must name a button of the matching kind on the approved template, which is also checked before the send and returns 400 (INVALID_TEMPLATE_BUTTON_PARAM) rather than a Meta rejection. | [optional] |
|
|
17
18
|
| **header_media** | [**CreateInboxConversationRequestHeaderMedia**](CreateInboxConversationRequestHeaderMedia.md) | | [optional] |
|
|
18
19
|
|
|
19
20
|
## Example
|
|
@@ -32,6 +33,7 @@ instance = Zernio::CreateInboxConversationRequest.new(
|
|
|
32
33
|
link_preview: null,
|
|
33
34
|
template_language: null,
|
|
34
35
|
template_params: null,
|
|
36
|
+
template_button_params: null,
|
|
35
37
|
header_media: null
|
|
36
38
|
)
|
|
37
39
|
```
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Zernio::CreateInboxConversationRequestTemplateButtonParamsInner
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **index** | **Integer** | Zero-based position of the button in the approved template's buttons. | |
|
|
8
|
+
| **sub_type** | **String** | The button kind, which decides how the value is sent: copy_code sends it as the coupon_code payload, flow as the flow token, url as the dynamic suffix appended to the button's base URL. | |
|
|
9
|
+
| **value** | **String** | The value to send (e.g. the Pix copy-and-paste code for a copy_code button). | |
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```ruby
|
|
14
|
+
require 'zernio-sdk'
|
|
15
|
+
|
|
16
|
+
instance = Zernio::CreateInboxConversationRequestTemplateButtonParamsInner.new(
|
|
17
|
+
index: null,
|
|
18
|
+
sub_type: null,
|
|
19
|
+
value: null
|
|
20
|
+
)
|
|
21
|
+
```
|
|
22
|
+
|
|
@@ -75,6 +75,8 @@
|
|
|
75
75
|
| **additional_headlines** | **Array<String>** | Google Search RSA only. Extra headlines. | [optional] |
|
|
76
76
|
| **additional_descriptions** | **Array<String>** | Google Search RSA only. Extra descriptions. | [optional] |
|
|
77
77
|
| **sitelinks** | [**Array<CreateStandaloneAdRequestSitelinksInner>**](CreateStandaloneAdRequestSitelinksInner.md) | Google Search only. Sitelink assets to create and attach at the campaign level. Each entry becomes an Asset (with sitelink_asset + Asset.final_urls) plus a CampaignAsset link (field_type SITELINK). Approval is async — Google reviews assets after creation; poll asset.policy_summary later to read the verdict. Google requires at least two sitelinks to surface them on an ad; four or more is Google's own recommendation for maximum visibility. The response's creative.sitelinks[] echoes each input plus its Google resourceName. | [optional] |
|
|
78
|
+
| **callouts** | **Array<String>** | Google Search only. Short callout texts (max 25 chars each) that appear as non-clickable annotations under the ad, e.g. \"Free shipping\", \"24/7 support\". Each becomes one Asset (`callout_asset`) plus a CampaignAsset link with field_type CALLOUT. Response's creative.callouts[] echoes each input plus its Google resourceName. | [optional] |
|
|
79
|
+
| **structured_snippets** | [**Array<CreateStandaloneAdRequestStructuredSnippetsInner>**](CreateStandaloneAdRequestStructuredSnippetsInner.md) | Google Search only. Structured snippets — one header from Google's predefined list plus 3-10 values (max 25 chars each). Each becomes one Asset (`structured_snippet_asset`) plus a CampaignAsset link with field_type STRUCTURED_SNIPPET. | [optional] |
|
|
78
80
|
| **advantage_audience** | **Integer** | Meta only. Controls the Advantage audience feature (targeting_automation). 0 = disabled (default), 1 = enabled. Meta Marketing API requires this field on all ad set creation requests. | [optional] |
|
|
79
81
|
| **attribution_spec** | [**Array<CreateStandaloneAdRequestAttributionSpecInner>**](CreateStandaloneAdRequestAttributionSpecInner.md) | Meta only. Conversion attribution window for the ad set — maps 1:1 to Meta's ad-set `attribution_spec`. Only honored for conversion goals (`conversions`, `lead_generation`, `app_promotion`); ignored for awareness/traffic/engagement. Omit to use Meta's default (`7-day click` + `1-day view`). Meta enforces the valid combinations: `VIEW_THROUGH` only allows `windowDays: 1` (7d/28d view windows were removed Jan 2026); `ENGAGED_VIDEO_VIEW` only `1` and only alongside `VIEW_THROUGH: 1`; `CLICK_THROUGH: 28` only on certain objectives. Invalid combos surface as a Meta 400. Example: `[{ \"eventType\": \"CLICK_THROUGH\", \"windowDays\": 7 }, { \"eventType\": \"VIEW_THROUGH\", \"windowDays\": 1 }]` | [optional] |
|
|
80
82
|
| **gender** | **String** | Restrict the audience by gender. 'male' targets men only, 'female' targets women only, 'all' (default) targets everyone. Applied on Meta, TikTok and Pinterest. Ignored on Google, LinkedIn and X. | [optional][default to 'all'] |
|
|
@@ -168,6 +170,8 @@ instance = Zernio::CreateStandaloneAdRequest.new(
|
|
|
168
170
|
additional_headlines: null,
|
|
169
171
|
additional_descriptions: null,
|
|
170
172
|
sitelinks: null,
|
|
173
|
+
callouts: null,
|
|
174
|
+
structured_snippets: null,
|
|
171
175
|
advantage_audience: null,
|
|
172
176
|
attribution_spec: null,
|
|
173
177
|
gender: null,
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Zernio::CreateStandaloneAdRequestStructuredSnippetsInner
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **header** | **String** | One of Google's 13 predefined snippet headers. | |
|
|
8
|
+
| **values** | **Array<String>** | | |
|
|
9
|
+
|
|
10
|
+
## Example
|
|
11
|
+
|
|
12
|
+
```ruby
|
|
13
|
+
require 'zernio-sdk'
|
|
14
|
+
|
|
15
|
+
instance = Zernio::CreateStandaloneAdRequestStructuredSnippetsInner.new(
|
|
16
|
+
header: null,
|
|
17
|
+
values: null
|
|
18
|
+
)
|
|
19
|
+
```
|
|
20
|
+
|
data/docs/MessagesApi.md
CHANGED
|
@@ -100,7 +100,7 @@ end
|
|
|
100
100
|
|
|
101
101
|
Create conversation
|
|
102
102
|
|
|
103
|
-
Initiate a new direct message conversation with a specified user. If a conversation already exists with the recipient, the message is added to the existing thread. Supported platforms: X/Twitter, Bluesky, Reddit, WhatsApp, SMS, and Slack. Other platforms return PLATFORM_NOT_SUPPORTED. Slack: pass a workspace member id as participantId (list them with GET /v1/accounts/{accountId}/slack-members). Zernio opens the DM channel with that member and sends the message; the thread then behaves like any other Slack conversation in the inbox. The member must belong to the connected workspace. WhatsApp: this is the endpoint for sending an approved template message to a phone number. Provide templateName, templateLanguage, and templateParams (variable values for the text header, body and dynamic URL buttons, in that order), with the recipient phone in participantId. A template is required because WhatsApp does not permit freeform messages to open a conversation; a missing template returns TEMPLATE_REQUIRED. Templates with media headers (image, video, document) are handled automatically: Zernio reads the approved template definition and fills the header at send time with the template's approved sample asset. To send a DIFFERENT asset per message (e.g. a distinct invoice PDF for each recipient), pass the headerMedia field with a public link (or a Meta media id); it overrides the sample for that send. Calling this for a number you already have a thread with simply sends the template into that thread, which also makes it the way to re-engage a contact after the 24-hour customer-service window has closed. Once the recipient replies (opening the 24h window), send freeform messages with the send-message endpoint (POST /v1/inbox/conversations/{conversationId}/messages). Template fields are accepted on the JSON body only, not on multipart requests. Alternatively, WhatsApp Business Accounts eligible for Meta Direct Send can open a conversation with a business-initiated utility text message and no template: pass category: 'utility' together with message (and no templateName). See the category field below. DM eligibility (X/Twitter): Before sending, the endpoint checks if the recipient accepts DMs from your account (via the receives_your_dm field). If not, a 422 error with code DM_NOT_ALLOWED is returned. You can skip this check with skipDmCheck: true if you have already verified eligibility. X API tier requirement: DM write endpoints require X API Pro tier ($5,000/month) or Enterprise access. This applies to BYOK (Bring Your Own Key) users who provide their own X API credentials. Rate limits (X/Twitter only): X's DM API enforces 200 requests per 15 minutes, 1,000 per 24 hours per connected X account, and 15,000 per 24 hours per X developer app (shared across all DM endpoints). These limits do NOT apply to other platforms. WhatsApp sends are governed by Meta's per-number messaging tiers (unique business-initiated conversations per 24 hours) and per-number throughput instead.
|
|
103
|
+
Initiate a new direct message conversation with a specified user. If a conversation already exists with the recipient, the message is added to the existing thread. Supported platforms: X/Twitter, Bluesky, Reddit, WhatsApp, SMS, and Slack. Other platforms return PLATFORM_NOT_SUPPORTED. Slack: pass a workspace member id as participantId (list them with GET /v1/accounts/{accountId}/slack-members). Zernio opens the DM channel with that member and sends the message; the thread then behaves like any other Slack conversation in the inbox. The member must belong to the connected workspace. WhatsApp: this is the endpoint for sending an approved template message to a phone number. Provide templateName, templateLanguage, and templateParams (variable values for the text header, body and dynamic URL buttons, in that order), with the recipient phone in participantId. A template is required because WhatsApp does not permit freeform messages to open a conversation; a missing template returns TEMPLATE_REQUIRED. Templates with media headers (image, video, document) are handled automatically: Zernio reads the approved template definition and fills the header at send time with the template's approved sample asset. To send a DIFFERENT asset per message (e.g. a distinct invoice PDF for each recipient), pass the headerMedia field with a public link (or a Meta media id); it overrides the sample for that send. A button that carries its own value at send time (a copy-code button holding a Pix payment code or a coupon, a flow token) is sent with templateButtonParams, addressed by the button's index; templateParams covers text variables and dynamic URL buttons only. Calling this for a number you already have a thread with simply sends the template into that thread, which also makes it the way to re-engage a contact after the 24-hour customer-service window has closed. Once the recipient replies (opening the 24h window), send freeform messages with the send-message endpoint (POST /v1/inbox/conversations/{conversationId}/messages). Template fields are accepted on the JSON body only, not on multipart requests. Alternatively, WhatsApp Business Accounts eligible for Meta Direct Send can open a conversation with a business-initiated utility text message and no template: pass category: 'utility' together with message (and no templateName). See the category field below. DM eligibility (X/Twitter): Before sending, the endpoint checks if the recipient accepts DMs from your account (via the receives_your_dm field). If not, a 422 error with code DM_NOT_ALLOWED is returned. You can skip this check with skipDmCheck: true if you have already verified eligibility. X API tier requirement: DM write endpoints require X API Pro tier ($5,000/month) or Enterprise access. This applies to BYOK (Bring Your Own Key) users who provide their own X API credentials. Rate limits (X/Twitter only): X's DM API enforces 200 requests per 15 minutes, 1,000 per 24 hours per connected X account, and 15,000 per 24 hours per X developer app (shared across all DM endpoints). These limits do NOT apply to other platforms. WhatsApp sends are governed by Meta's per-number messaging tiers (unique business-initiated conversations per 24 hours) and per-number throughput instead.
|
|
104
104
|
|
|
105
105
|
### Examples
|
|
106
106
|
|
data/docs/PostAnalytics.md
CHANGED
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
| **follows** | **Integer** | Instagram feed posts and stories only: organic accounts that started following from this post. 0 for reels and other platforms. | [optional] |
|
|
16
16
|
| **ig_reels_avg_watch_time** | **Integer** | Instagram Reels only: average watch time per play, in milliseconds. 0 for non-Reels media and other platforms. | [optional] |
|
|
17
17
|
| **ig_reels_video_view_total_time** | **Integer** | Instagram Reels only: total watch time including replays, in milliseconds. 0 for non-Reels media and other platforms. | [optional] |
|
|
18
|
+
| **reels_skip_rate** | **Float** | Instagram Reels only: the rate of initial views that skipped the reel within its first 3 seconds, as reported by Meta. Passed through exactly as Meta reports it, with no rescaling, so do not assume a 0-1 share. Meta labels the metric estimated and in development, so it can move between syncs. 0 for non-Reels media and other platforms. When a post is published to several accounts, the aggregate is weighted by views. | [optional] |
|
|
19
|
+
| **reposts** | **Integer** | Instagram only: reposts of the media by other users, minus deleted reposts. Available on feed posts, reels and stories. 0 for other platforms, including Threads, where reposts are counted in shares instead. | [optional] |
|
|
18
20
|
| **video_duration_seconds** | **Integer** | Video length in seconds. Currently Instagram Reels only; combine with igReelsAvgWatchTime (ms) to estimate retention. Null when unknown (other platforms, non-video media, or when Instagram does not expose the media URL, e.g. reels with copyrighted audio). | [optional] |
|
|
19
21
|
| **engagement_rate** | **Float** | Percentage, rounded to 2 decimals: (likes + comments + shares + saves) / (impressions or reach or views) * 100. Clicks and follows are never counted. The denominator is the FIRST of impressions, reach, views that is non-zero, so it is not the same basis on every post: a post with impressions divides by impressions, one without falls back to reach, then to views. If you need a single consistent basis (e.g. interactions / reach), compute it from the raw fields above. The engagementRate on the LinkedIn account endpoints is a different formula. | [optional] |
|
|
20
22
|
| **last_updated** | **Time** | | [optional] |
|
|
@@ -36,6 +38,8 @@ instance = Zernio::PostAnalytics.new(
|
|
|
36
38
|
follows: 0,
|
|
37
39
|
ig_reels_avg_watch_time: 0,
|
|
38
40
|
ig_reels_video_view_total_time: 0,
|
|
41
|
+
reels_skip_rate: 0,
|
|
42
|
+
reposts: 0,
|
|
39
43
|
video_duration_seconds: 30,
|
|
40
44
|
engagement_rate: 6.59,
|
|
41
45
|
last_updated: null
|
data/docs/TargetingSpec.md
CHANGED
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
| **metros** | [**Array<BoostPostRequestTargetingRegionsInner>**](BoostPostRequestTargetingRegionsInner.md) | DMA / metro-area targeting. `key` is the platform's metro ID (e.g. Meta `DMA:807`). | [optional] |
|
|
12
12
|
| **custom_locations** | [**Array<TargetingSpecCustomLocationsInner>**](TargetingSpecCustomLocationsInner.md) | Point-radius (lat/lng) targeting (Meta custom_locations / Google proximity). Honoured only where the capability map allows radius (Meta). | [optional] |
|
|
13
13
|
| **excluded_locations** | [**TargetingSpecExcludedLocations**](TargetingSpecExcludedLocations.md) | | [optional] |
|
|
14
|
-
| **age_min** | **Integer** |
|
|
15
|
-
| **age_max** | **Integer** |
|
|
14
|
+
| **age_min** | **Integer** | Minimum age. Applied on Meta, TikTok and Pinterest; ignored on Google, LinkedIn and X. Each platform clamps to its own range: Meta and Pinterest effectively cap at 65 (65 = 65+), TikTok maps up to 100. Pinterest has no under-18 bucket, so an ageMin below 18 starts at 18 there. | [optional] |
|
|
15
|
+
| **age_max** | **Integer** | Maximum age. Same per-platform application and clamping as ageMin. | [optional] |
|
|
16
16
|
| **gender** | **String** | Restrict by gender. 'all' (default) targets everyone. Applied on Meta, TikTok and Pinterest. Ignored on Google, LinkedIn and X. | [optional] |
|
|
17
17
|
| **income_tier** | **String** | Normalized household-income tier (ZIP/percentile based). Meta and TikTok express all four. Google maps only `top_10` (its INCOME_RANGE_90_UP); other tiers on Google, and any income tier on LinkedIn / X / Pinterest, are rejected. On Meta, income/zip targeting requires the relevant `specialAdCategories` to be unset (housing/employment/credit ads cannot use it). | [optional] |
|
|
18
18
|
| **languages** | **Array<String>** | Language codes restricting the audience by language. On Meta, ISO 639-1 codes (e.g. ['en']); a bare code targets all regional variants (\"en\" = all English), or use a region-qualified code (\"en_GB\", \"pt_BR\") for a specific one. Unknown codes are rejected. | [optional] |
|
|
@@ -19,6 +19,80 @@ module Zernio
|
|
|
19
19
|
def initialize(api_client = ApiClient.default)
|
|
20
20
|
@api_client = api_client
|
|
21
21
|
end
|
|
22
|
+
# Attach extension assets to a Google Search campaign
|
|
23
|
+
# Attach sitelinks, callouts and/or structured snippets to an already-existing Google Search campaign — the same builders POST /v1/ads/create uses, but without rebuilding the hierarchy. At least one of sitelinks, callouts or structuredSnippets is required. Google-only. Other platforms have no equivalent extension surface and return 501. Approval status is Google-async; poll `asset.policy_summary` after review. Assets stay in the account library even if the campaign is later deleted.
|
|
24
|
+
# @param campaign_id [String] Numeric Google platform campaign id.
|
|
25
|
+
# @param attach_campaign_assets_request [AttachCampaignAssetsRequest]
|
|
26
|
+
# @param [Hash] opts the optional parameters
|
|
27
|
+
# @return [AttachCampaignAssets201Response]
|
|
28
|
+
def attach_campaign_assets(campaign_id, attach_campaign_assets_request, opts = {})
|
|
29
|
+
data, _status_code, _headers = attach_campaign_assets_with_http_info(campaign_id, attach_campaign_assets_request, opts)
|
|
30
|
+
data
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Attach extension assets to a Google Search campaign
|
|
34
|
+
# Attach sitelinks, callouts and/or structured snippets to an already-existing Google Search campaign — the same builders POST /v1/ads/create uses, but without rebuilding the hierarchy. At least one of sitelinks, callouts or structuredSnippets is required. Google-only. Other platforms have no equivalent extension surface and return 501. Approval status is Google-async; poll `asset.policy_summary` after review. Assets stay in the account library even if the campaign is later deleted.
|
|
35
|
+
# @param campaign_id [String] Numeric Google platform campaign id.
|
|
36
|
+
# @param attach_campaign_assets_request [AttachCampaignAssetsRequest]
|
|
37
|
+
# @param [Hash] opts the optional parameters
|
|
38
|
+
# @return [Array<(AttachCampaignAssets201Response, Integer, Hash)>] AttachCampaignAssets201Response data, response status code and response headers
|
|
39
|
+
def attach_campaign_assets_with_http_info(campaign_id, attach_campaign_assets_request, opts = {})
|
|
40
|
+
if @api_client.config.debugging
|
|
41
|
+
@api_client.config.logger.debug 'Calling API: AdCampaignsApi.attach_campaign_assets ...'
|
|
42
|
+
end
|
|
43
|
+
# verify the required parameter 'campaign_id' is set
|
|
44
|
+
if @api_client.config.client_side_validation && campaign_id.nil?
|
|
45
|
+
fail ArgumentError, "Missing the required parameter 'campaign_id' when calling AdCampaignsApi.attach_campaign_assets"
|
|
46
|
+
end
|
|
47
|
+
# verify the required parameter 'attach_campaign_assets_request' is set
|
|
48
|
+
if @api_client.config.client_side_validation && attach_campaign_assets_request.nil?
|
|
49
|
+
fail ArgumentError, "Missing the required parameter 'attach_campaign_assets_request' when calling AdCampaignsApi.attach_campaign_assets"
|
|
50
|
+
end
|
|
51
|
+
# resource path
|
|
52
|
+
local_var_path = '/v1/ads/campaigns/{campaignId}/assets'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s))
|
|
53
|
+
|
|
54
|
+
# query parameters
|
|
55
|
+
query_params = opts[:query_params] || {}
|
|
56
|
+
|
|
57
|
+
# header parameters
|
|
58
|
+
header_params = opts[:header_params] || {}
|
|
59
|
+
# HTTP header 'Accept' (if needed)
|
|
60
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
61
|
+
# HTTP header 'Content-Type'
|
|
62
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
63
|
+
if !content_type.nil?
|
|
64
|
+
header_params['Content-Type'] = content_type
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# form parameters
|
|
68
|
+
form_params = opts[:form_params] || {}
|
|
69
|
+
|
|
70
|
+
# http body (model)
|
|
71
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(attach_campaign_assets_request)
|
|
72
|
+
|
|
73
|
+
# return_type
|
|
74
|
+
return_type = opts[:debug_return_type] || 'AttachCampaignAssets201Response'
|
|
75
|
+
|
|
76
|
+
# auth_names
|
|
77
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
78
|
+
|
|
79
|
+
new_options = opts.merge(
|
|
80
|
+
:operation => :"AdCampaignsApi.attach_campaign_assets",
|
|
81
|
+
:header_params => header_params,
|
|
82
|
+
:query_params => query_params,
|
|
83
|
+
:form_params => form_params,
|
|
84
|
+
:body => post_body,
|
|
85
|
+
:auth_names => auth_names,
|
|
86
|
+
:return_type => return_type
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
90
|
+
if @api_client.config.debugging
|
|
91
|
+
@api_client.config.logger.debug "API called: AdCampaignsApi#attach_campaign_assets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
92
|
+
end
|
|
93
|
+
return data, status_code, headers
|
|
94
|
+
end
|
|
95
|
+
|
|
22
96
|
# Boost post as ad
|
|
23
97
|
# Creates a paid ad from an existing published post, keeping the post's engagement. By default it provisions the whole hierarchy (campaign, ad set, ad). **Attach shape (Meta).** Send `adSetId` to put the ad under an EXISTING ad set instead, so that ad set keeps its learning phase. It then owns `budget`, `schedule` and `targeting`, and sending any of those alongside `adSetId` is a 400 rather than a silent drop. `budget` is required only without `adSetId`. `instagramAccountId`, `destinationType` and `adSetId` are Meta-only and return 400 on other platforms. **Retries.** Boosts are NOT idempotent and can take minutes when Meta requires re-hosting an Instagram video, so do not retry on client timeout. Send an Idempotency-Key header to make retries safe: same key and body replays the original 201, and distinct keys always create distinct ads. Without the header, an identical request is treated as a retry: while one is in flight it returns 409, and within 10 minutes of a completed boost it returns the already-created ad instead of creating another. To intentionally duplicate an ad, send distinct Idempotency-Keys (or vary the body, e.g. the name).
|
|
24
98
|
# @param boost_post_request [BoostPostRequest]
|
|
@@ -31,7 +31,7 @@ module Zernio
|
|
|
31
31
|
# @option opts [Date] :to_date Inclusive upper bound (YYYY-MM-DD). Defaults to today if omitted.
|
|
32
32
|
# @option opts [Integer] :limit Page size (default 50) (default to 50)
|
|
33
33
|
# @option opts [Integer] :page Page number (default 1) (default to 1)
|
|
34
|
-
# @option opts [String] :sort_by Sort by date, engagement, or a specific metric (default to 'date')
|
|
34
|
+
# @option opts [String] :sort_by Sort by date, engagement, or a specific metric. Instagram-only metrics (follows, reposts, reels_skip_rate, ig_reels_*) sort posts with no value as 0. (default to 'date')
|
|
35
35
|
# @option opts [String] :order Sort order (default to 'desc')
|
|
36
36
|
# @return [GetAnalytics200Response]
|
|
37
37
|
def get_analytics(opts = {})
|
|
@@ -51,7 +51,7 @@ module Zernio
|
|
|
51
51
|
# @option opts [Date] :to_date Inclusive upper bound (YYYY-MM-DD). Defaults to today if omitted.
|
|
52
52
|
# @option opts [Integer] :limit Page size (default 50) (default to 50)
|
|
53
53
|
# @option opts [Integer] :page Page number (default 1) (default to 1)
|
|
54
|
-
# @option opts [String] :sort_by Sort by date, engagement, or a specific metric (default to 'date')
|
|
54
|
+
# @option opts [String] :sort_by Sort by date, engagement, or a specific metric. Instagram-only metrics (follows, reposts, reels_skip_rate, ig_reels_*) sort posts with no value as 0. (default to 'date')
|
|
55
55
|
# @option opts [String] :order Sort order (default to 'desc')
|
|
56
56
|
# @return [Array<(GetAnalytics200Response, Integer, Hash)>] GetAnalytics200Response data, response status code and response headers
|
|
57
57
|
def get_analytics_with_http_info(opts = {})
|
|
@@ -74,7 +74,7 @@ module Zernio
|
|
|
74
74
|
fail ArgumentError, 'invalid value for "opts[:"page"]" when calling AnalyticsApi.get_analytics, must be greater than or equal to 1.'
|
|
75
75
|
end
|
|
76
76
|
|
|
77
|
-
allowable_values = ["date", "engagement", "impressions", "reach", "likes", "comments", "shares", "saves", "clicks", "views", "follows"]
|
|
77
|
+
allowable_values = ["date", "engagement", "impressions", "reach", "likes", "comments", "shares", "saves", "clicks", "views", "follows", "ig_reels_avg_watch_time", "ig_reels_video_view_total_time", "reposts", "reels_skip_rate"]
|
|
78
78
|
if @api_client.config.client_side_validation && opts[:'sort_by'] && !allowable_values.include?(opts[:'sort_by'])
|
|
79
79
|
fail ArgumentError, "invalid value for \"sort_by\", must be one of #{allowable_values}"
|
|
80
80
|
end
|
|
@@ -100,7 +100,7 @@ module Zernio
|
|
|
100
100
|
end
|
|
101
101
|
|
|
102
102
|
# Create conversation
|
|
103
|
-
# Initiate a new direct message conversation with a specified user. If a conversation already exists with the recipient, the message is added to the existing thread. Supported platforms: X/Twitter, Bluesky, Reddit, WhatsApp, SMS, and Slack. Other platforms return PLATFORM_NOT_SUPPORTED. Slack: pass a workspace member id as participantId (list them with GET /v1/accounts/{accountId}/slack-members). Zernio opens the DM channel with that member and sends the message; the thread then behaves like any other Slack conversation in the inbox. The member must belong to the connected workspace. WhatsApp: this is the endpoint for sending an approved template message to a phone number. Provide templateName, templateLanguage, and templateParams (variable values for the text header, body and dynamic URL buttons, in that order), with the recipient phone in participantId. A template is required because WhatsApp does not permit freeform messages to open a conversation; a missing template returns TEMPLATE_REQUIRED. Templates with media headers (image, video, document) are handled automatically: Zernio reads the approved template definition and fills the header at send time with the template's approved sample asset. To send a DIFFERENT asset per message (e.g. a distinct invoice PDF for each recipient), pass the headerMedia field with a public link (or a Meta media id); it overrides the sample for that send. Calling this for a number you already have a thread with simply sends the template into that thread, which also makes it the way to re-engage a contact after the 24-hour customer-service window has closed. Once the recipient replies (opening the 24h window), send freeform messages with the send-message endpoint (POST /v1/inbox/conversations/{conversationId}/messages). Template fields are accepted on the JSON body only, not on multipart requests. Alternatively, WhatsApp Business Accounts eligible for Meta Direct Send can open a conversation with a business-initiated utility text message and no template: pass category: 'utility' together with message (and no templateName). See the category field below. DM eligibility (X/Twitter): Before sending, the endpoint checks if the recipient accepts DMs from your account (via the receives_your_dm field). If not, a 422 error with code DM_NOT_ALLOWED is returned. You can skip this check with skipDmCheck: true if you have already verified eligibility. X API tier requirement: DM write endpoints require X API Pro tier ($5,000/month) or Enterprise access. This applies to BYOK (Bring Your Own Key) users who provide their own X API credentials. Rate limits (X/Twitter only): X's DM API enforces 200 requests per 15 minutes, 1,000 per 24 hours per connected X account, and 15,000 per 24 hours per X developer app (shared across all DM endpoints). These limits do NOT apply to other platforms. WhatsApp sends are governed by Meta's per-number messaging tiers (unique business-initiated conversations per 24 hours) and per-number throughput instead.
|
|
103
|
+
# Initiate a new direct message conversation with a specified user. If a conversation already exists with the recipient, the message is added to the existing thread. Supported platforms: X/Twitter, Bluesky, Reddit, WhatsApp, SMS, and Slack. Other platforms return PLATFORM_NOT_SUPPORTED. Slack: pass a workspace member id as participantId (list them with GET /v1/accounts/{accountId}/slack-members). Zernio opens the DM channel with that member and sends the message; the thread then behaves like any other Slack conversation in the inbox. The member must belong to the connected workspace. WhatsApp: this is the endpoint for sending an approved template message to a phone number. Provide templateName, templateLanguage, and templateParams (variable values for the text header, body and dynamic URL buttons, in that order), with the recipient phone in participantId. A template is required because WhatsApp does not permit freeform messages to open a conversation; a missing template returns TEMPLATE_REQUIRED. Templates with media headers (image, video, document) are handled automatically: Zernio reads the approved template definition and fills the header at send time with the template's approved sample asset. To send a DIFFERENT asset per message (e.g. a distinct invoice PDF for each recipient), pass the headerMedia field with a public link (or a Meta media id); it overrides the sample for that send. A button that carries its own value at send time (a copy-code button holding a Pix payment code or a coupon, a flow token) is sent with templateButtonParams, addressed by the button's index; templateParams covers text variables and dynamic URL buttons only. Calling this for a number you already have a thread with simply sends the template into that thread, which also makes it the way to re-engage a contact after the 24-hour customer-service window has closed. Once the recipient replies (opening the 24h window), send freeform messages with the send-message endpoint (POST /v1/inbox/conversations/{conversationId}/messages). Template fields are accepted on the JSON body only, not on multipart requests. Alternatively, WhatsApp Business Accounts eligible for Meta Direct Send can open a conversation with a business-initiated utility text message and no template: pass category: 'utility' together with message (and no templateName). See the category field below. DM eligibility (X/Twitter): Before sending, the endpoint checks if the recipient accepts DMs from your account (via the receives_your_dm field). If not, a 422 error with code DM_NOT_ALLOWED is returned. You can skip this check with skipDmCheck: true if you have already verified eligibility. X API tier requirement: DM write endpoints require X API Pro tier ($5,000/month) or Enterprise access. This applies to BYOK (Bring Your Own Key) users who provide their own X API credentials. Rate limits (X/Twitter only): X's DM API enforces 200 requests per 15 minutes, 1,000 per 24 hours per connected X account, and 15,000 per 24 hours per X developer app (shared across all DM endpoints). These limits do NOT apply to other platforms. WhatsApp sends are governed by Meta's per-number messaging tiers (unique business-initiated conversations per 24 hours) and per-number throughput instead.
|
|
104
104
|
# @param create_inbox_conversation_request [CreateInboxConversationRequest]
|
|
105
105
|
# @param [Hash] opts the optional parameters
|
|
106
106
|
# @return [CreateInboxConversation201Response]
|
|
@@ -110,7 +110,7 @@ module Zernio
|
|
|
110
110
|
end
|
|
111
111
|
|
|
112
112
|
# Create conversation
|
|
113
|
-
# Initiate a new direct message conversation with a specified user. If a conversation already exists with the recipient, the message is added to the existing thread. Supported platforms: X/Twitter, Bluesky, Reddit, WhatsApp, SMS, and Slack. Other platforms return PLATFORM_NOT_SUPPORTED. Slack: pass a workspace member id as participantId (list them with GET /v1/accounts/{accountId}/slack-members). Zernio opens the DM channel with that member and sends the message; the thread then behaves like any other Slack conversation in the inbox. The member must belong to the connected workspace. WhatsApp: this is the endpoint for sending an approved template message to a phone number. Provide templateName, templateLanguage, and templateParams (variable values for the text header, body and dynamic URL buttons, in that order), with the recipient phone in participantId. A template is required because WhatsApp does not permit freeform messages to open a conversation; a missing template returns TEMPLATE_REQUIRED. Templates with media headers (image, video, document) are handled automatically: Zernio reads the approved template definition and fills the header at send time with the template's approved sample asset. To send a DIFFERENT asset per message (e.g. a distinct invoice PDF for each recipient), pass the headerMedia field with a public link (or a Meta media id); it overrides the sample for that send. Calling this for a number you already have a thread with simply sends the template into that thread, which also makes it the way to re-engage a contact after the 24-hour customer-service window has closed. Once the recipient replies (opening the 24h window), send freeform messages with the send-message endpoint (POST /v1/inbox/conversations/{conversationId}/messages). Template fields are accepted on the JSON body only, not on multipart requests. Alternatively, WhatsApp Business Accounts eligible for Meta Direct Send can open a conversation with a business-initiated utility text message and no template: pass category: 'utility' together with message (and no templateName). See the category field below. DM eligibility (X/Twitter): Before sending, the endpoint checks if the recipient accepts DMs from your account (via the receives_your_dm field). If not, a 422 error with code DM_NOT_ALLOWED is returned. You can skip this check with skipDmCheck: true if you have already verified eligibility. X API tier requirement: DM write endpoints require X API Pro tier ($5,000/month) or Enterprise access. This applies to BYOK (Bring Your Own Key) users who provide their own X API credentials. Rate limits (X/Twitter only): X's DM API enforces 200 requests per 15 minutes, 1,000 per 24 hours per connected X account, and 15,000 per 24 hours per X developer app (shared across all DM endpoints). These limits do NOT apply to other platforms. WhatsApp sends are governed by Meta's per-number messaging tiers (unique business-initiated conversations per 24 hours) and per-number throughput instead.
|
|
113
|
+
# Initiate a new direct message conversation with a specified user. If a conversation already exists with the recipient, the message is added to the existing thread. Supported platforms: X/Twitter, Bluesky, Reddit, WhatsApp, SMS, and Slack. Other platforms return PLATFORM_NOT_SUPPORTED. Slack: pass a workspace member id as participantId (list them with GET /v1/accounts/{accountId}/slack-members). Zernio opens the DM channel with that member and sends the message; the thread then behaves like any other Slack conversation in the inbox. The member must belong to the connected workspace. WhatsApp: this is the endpoint for sending an approved template message to a phone number. Provide templateName, templateLanguage, and templateParams (variable values for the text header, body and dynamic URL buttons, in that order), with the recipient phone in participantId. A template is required because WhatsApp does not permit freeform messages to open a conversation; a missing template returns TEMPLATE_REQUIRED. Templates with media headers (image, video, document) are handled automatically: Zernio reads the approved template definition and fills the header at send time with the template's approved sample asset. To send a DIFFERENT asset per message (e.g. a distinct invoice PDF for each recipient), pass the headerMedia field with a public link (or a Meta media id); it overrides the sample for that send. A button that carries its own value at send time (a copy-code button holding a Pix payment code or a coupon, a flow token) is sent with templateButtonParams, addressed by the button's index; templateParams covers text variables and dynamic URL buttons only. Calling this for a number you already have a thread with simply sends the template into that thread, which also makes it the way to re-engage a contact after the 24-hour customer-service window has closed. Once the recipient replies (opening the 24h window), send freeform messages with the send-message endpoint (POST /v1/inbox/conversations/{conversationId}/messages). Template fields are accepted on the JSON body only, not on multipart requests. Alternatively, WhatsApp Business Accounts eligible for Meta Direct Send can open a conversation with a business-initiated utility text message and no template: pass category: 'utility' together with message (and no templateName). See the category field below. DM eligibility (X/Twitter): Before sending, the endpoint checks if the recipient accepts DMs from your account (via the receives_your_dm field). If not, a 422 error with code DM_NOT_ALLOWED is returned. You can skip this check with skipDmCheck: true if you have already verified eligibility. X API tier requirement: DM write endpoints require X API Pro tier ($5,000/month) or Enterprise access. This applies to BYOK (Bring Your Own Key) users who provide their own X API credentials. Rate limits (X/Twitter only): X's DM API enforces 200 requests per 15 minutes, 1,000 per 24 hours per connected X account, and 15,000 per 24 hours per X developer app (shared across all DM endpoints). These limits do NOT apply to other platforms. WhatsApp sends are governed by Meta's per-number messaging tiers (unique business-initiated conversations per 24 hours) and per-number throughput instead.
|
|
114
114
|
# @param create_inbox_conversation_request [CreateInboxConversationRequest]
|
|
115
115
|
# @param [Hash] opts the optional parameters
|
|
116
116
|
# @return [Array<(CreateInboxConversation201Response, Integer, Hash)>] CreateInboxConversation201Response data, response status code and response headers
|