late-sdk 0.0.915 → 0.0.917
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 -1
- data/docs/ConnectApi.md +17 -13
- data/docs/CreateInboxConversationRequest.md +2 -0
- data/docs/CreateInboxConversationRequestTemplateCardsInner.md +24 -0
- data/docs/CreateInboxConversationRequestTemplateCardsInnerButtonsInner.md +22 -0
- data/docs/CreateInboxConversationRequestTemplateCardsInnerHeaderMedia.md +22 -0
- data/docs/MessagesApi.md +1 -1
- data/docs/SelectFacebookPage200Response.md +1 -1
- data/docs/SelectFacebookPageRequest.md +39 -16
- data/docs/SelectFacebookPageRequestOneOf.md +26 -0
- data/docs/SelectFacebookPageRequestOneOf1.md +20 -0
- data/docs/SelectFacebookPageRequestOneOfNot.md +18 -0
- data/docs/{SelectFacebookPageRequestUserProfile.md → SelectFacebookPageRequestOneOfUserProfile.md} +2 -2
- data/lib/zernio-sdk/api/connect_api.rb +20 -25
- data/lib/zernio-sdk/api/messages_api.rb +2 -2
- data/lib/zernio-sdk/models/create_inbox_conversation400_response.rb +2 -2
- data/lib/zernio-sdk/models/create_inbox_conversation_request.rb +32 -1
- data/lib/zernio-sdk/models/create_inbox_conversation_request_template_cards_inner.rb +235 -0
- data/lib/zernio-sdk/models/create_inbox_conversation_request_template_cards_inner_buttons_inner.rb +270 -0
- data/lib/zernio-sdk/models/create_inbox_conversation_request_template_cards_inner_header_media.rb +210 -0
- data/lib/zernio-sdk/models/select_facebook_page200_response.rb +1 -1
- data/lib/zernio-sdk/models/select_facebook_page_request.rb +78 -229
- data/lib/zernio-sdk/models/select_facebook_page_request_one_of.rb +255 -0
- data/lib/zernio-sdk/models/select_facebook_page_request_one_of1.rb +203 -0
- data/lib/zernio-sdk/models/select_facebook_page_request_one_of_not.rb +150 -0
- data/lib/zernio-sdk/models/{select_facebook_page_request_user_profile.rb → select_facebook_page_request_one_of_user_profile.rb} +4 -4
- data/lib/zernio-sdk/version.rb +1 -1
- data/lib/zernio-sdk.rb +7 -1
- data/openapi.yaml +126 -41
- data/spec/api/connect_api_spec.rb +7 -6
- data/spec/api/messages_api_spec.rb +1 -1
- data/spec/models/create_inbox_conversation400_response_spec.rb +1 -1
- data/spec/models/create_inbox_conversation_request_spec.rb +6 -0
- data/spec/models/create_inbox_conversation_request_template_cards_inner_buttons_inner_spec.rb +52 -0
- data/spec/models/create_inbox_conversation_request_template_cards_inner_header_media_spec.rb +52 -0
- data/spec/models/create_inbox_conversation_request_template_cards_inner_spec.rb +54 -0
- data/spec/models/select_facebook_page_request_one_of1_spec.rb +42 -0
- data/spec/models/select_facebook_page_request_one_of_not_spec.rb +36 -0
- data/spec/models/select_facebook_page_request_one_of_spec.rb +60 -0
- data/spec/models/{select_facebook_page_request_user_profile_spec.rb → select_facebook_page_request_one_of_user_profile_spec.rb} +6 -6
- data/spec/models/select_facebook_page_request_spec.rb +5 -33
- data/zernio-sdk-0.0.917.gem +0 -0
- metadata +30 -6
- data/zernio-sdk-0.0.915.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: a2e2abc4e0d2a3a3ae3834d34c3df0cb0e6132c8833acc68e77fd070d9c1bb8a
|
|
4
|
+
data.tar.gz: 79442e8b80568ed9fc7d3e57d919f4cd1ff26c9c994c8b47b591529135ae0742
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 105850d51e71d95900c5ed568f12d3bb195c1d38774dc8f412b6126b66b49e96b3592a77392d115e562e91d044fcfdc0c221fc2674c180bf268695c9e348398b
|
|
7
|
+
data.tar.gz: 531ed2631d928f4022a4393b39c3321bfc15c23866c4a0eb5ea32f58e830b8da320fec99a9139c4b15e7c6fed43b670c27ff195699d93b8fc5cb628102f7d641
|
data/README.md
CHANGED
|
@@ -1120,6 +1120,9 @@ Class | Method | HTTP request | Description
|
|
|
1120
1120
|
- [Zernio::CreateInboxConversationRequestHeaderLocation](docs/CreateInboxConversationRequestHeaderLocation.md)
|
|
1121
1121
|
- [Zernio::CreateInboxConversationRequestHeaderMedia](docs/CreateInboxConversationRequestHeaderMedia.md)
|
|
1122
1122
|
- [Zernio::CreateInboxConversationRequestTemplateButtonParamsInner](docs/CreateInboxConversationRequestTemplateButtonParamsInner.md)
|
|
1123
|
+
- [Zernio::CreateInboxConversationRequestTemplateCardsInner](docs/CreateInboxConversationRequestTemplateCardsInner.md)
|
|
1124
|
+
- [Zernio::CreateInboxConversationRequestTemplateCardsInnerButtonsInner](docs/CreateInboxConversationRequestTemplateCardsInnerButtonsInner.md)
|
|
1125
|
+
- [Zernio::CreateInboxConversationRequestTemplateCardsInnerHeaderMedia](docs/CreateInboxConversationRequestTemplateCardsInnerHeaderMedia.md)
|
|
1123
1126
|
- [Zernio::CreateInviteToken201Response](docs/CreateInviteToken201Response.md)
|
|
1124
1127
|
- [Zernio::CreateInviteTokenRequest](docs/CreateInviteTokenRequest.md)
|
|
1125
1128
|
- [Zernio::CreateLeadForm200Response](docs/CreateLeadForm200Response.md)
|
|
@@ -2221,7 +2224,10 @@ Class | Method | HTTP request | Description
|
|
|
2221
2224
|
- [Zernio::SelectFacebookPage200ResponseAccount](docs/SelectFacebookPage200ResponseAccount.md)
|
|
2222
2225
|
- [Zernio::SelectFacebookPage409Response](docs/SelectFacebookPage409Response.md)
|
|
2223
2226
|
- [Zernio::SelectFacebookPageRequest](docs/SelectFacebookPageRequest.md)
|
|
2224
|
-
- [Zernio::
|
|
2227
|
+
- [Zernio::SelectFacebookPageRequestOneOf](docs/SelectFacebookPageRequestOneOf.md)
|
|
2228
|
+
- [Zernio::SelectFacebookPageRequestOneOf1](docs/SelectFacebookPageRequestOneOf1.md)
|
|
2229
|
+
- [Zernio::SelectFacebookPageRequestOneOfNot](docs/SelectFacebookPageRequestOneOfNot.md)
|
|
2230
|
+
- [Zernio::SelectFacebookPageRequestOneOfUserProfile](docs/SelectFacebookPageRequestOneOfUserProfile.md)
|
|
2225
2231
|
- [Zernio::SelectGoogleBusinessLocation200Response](docs/SelectGoogleBusinessLocation200Response.md)
|
|
2226
2232
|
- [Zernio::SelectGoogleBusinessLocation200ResponseAccount](docs/SelectGoogleBusinessLocation200ResponseAccount.md)
|
|
2227
2233
|
- [Zernio::SelectGoogleBusinessLocationRequest](docs/SelectGoogleBusinessLocationRequest.md)
|
data/docs/ConnectApi.md
CHANGED
|
@@ -135,7 +135,7 @@ end
|
|
|
135
135
|
|
|
136
136
|
Complete Meta business login
|
|
137
137
|
|
|
138
|
-
Facebook Login for Business redirect target. Meta supplies the single-use authorization code and the authenticated state returned by connectAds. The state expires after 30 minutes and binds the user, profile, Page selection and ad-account scope. No bearer token is sent by the browser. Success reconnects only metaads and redirects to the original redirect_url. Invalid state returns 400; inaccessible profiles or missing ads access cannot connect. No token is returned to the browser.
|
|
138
|
+
Facebook Login for Business redirect target. Meta supplies the single-use authorization code and the authenticated state returned by connectAds. The state expires after 30 minutes and binds the user, profile, Page selection and ad-account scope. No bearer token is sent by the browser. Success reconnects only metaads and redirects to the original redirect_url. Invalid state returns 400; inaccessible profiles or missing ads access cannot connect. Dashboard logins with several Pages redirect to the Facebook Page picker with an encrypted selectionToken valid for ten minutes. Listing and selecting require the initiating user and current profile access. No plaintext platform token is returned to the browser.
|
|
139
139
|
|
|
140
140
|
### Examples
|
|
141
141
|
|
|
@@ -415,7 +415,7 @@ end
|
|
|
415
415
|
|
|
416
416
|
Connect ads for a platform
|
|
417
417
|
|
|
418
|
-
Unified ads connection endpoint. Creates a dedicated ads SocialAccount for the specified platform. **Meta business login (opt-in).** Set `loginMode=business` for `facebook` or `instagram` to use Facebook Login for Business and a Business Integration System User token. No posting account is created or required. This mode always returns an authUrl; it returns 503 when the server has no META_ADS_CONFIG_ID. Complete the dialog in a browser. The callback creates or reconnects only the metaads account, preserving its ID, history and scopedAdAccountIds. Non-empty successful subscription results replace subscribedAdAccountIds to remove stale grants; an empty result leaves routing unchanged. A reconnect must grant every previously scoped ad account (or every previous grant for an unscoped connection). Missing or unverifiable grants return 409 before changing the account. Pass `pageId` to select a granted Page for creatives and lead forms.
|
|
418
|
+
Unified ads connection endpoint. Creates a dedicated ads SocialAccount for the specified platform. **Meta business login (opt-in).** Set `loginMode=business` for `facebook` or `instagram` to use Facebook Login for Business and a Business Integration System User token. No posting account is created or required. This mode always returns an authUrl; it returns 503 when the server has no META_ADS_CONFIG_ID. Complete the dialog in a browser. The callback creates or reconnects only the metaads account, preserving its ID, history and scopedAdAccountIds. Non-empty successful subscription results replace subscribedAdAccountIds to remove stale grants; an empty result leaves routing unchanged. A reconnect must grant every previously scoped ad account (or every previous grant for an unscoped connection). Missing or unverifiable grants return 409 before changing the account. Pass `pageId` to select a granted Page for creatives and lead forms. API integrations otherwise reuse the previous Page or sole granted Page. Multiple Pages without a selection return 400 with available Page IDs for API integrations; restart with pageId. Dashboard session logins use the sole current grant automatically or open the existing Facebook Page picker for several grants, including reconnects. Selection completes the Meta Ads connection. With no Pages granted the callback returns 400 with instructions to connect again and grant a Page. Success redirects with connected=metaads, profileId and accountId. Business login reports metadata.tokenType=system-user in GET /v1/accounts. An absent Meta expires_in leaves tokenExpiresAt absent; no personal-token re-exchange occurs. Subsequent classic requests can change the ad-account scope using the business token; force=true requires loginMode=business to reconnect that connection. **Same-token platforms (facebook, instagram, linkedin, pinterest).** The ads SocialAccount (metaads, linkedinads, pinterestads) reuses the OAuth token of the parent posting account, but only when an active parent exists and, for facebook and instagram, its stored token carries ads_management and ads_read (linkedin and pinterest need no extra scope). In that case no extra OAuth happens and the response is alreadyConnected: true. When no such parent exists, or the scopes are missing, the endpoint returns an authUrl and a full OAuth round trip is required. When a parent exists but carries no token usable for ad accounts, the call fails with 400 RECONNECT_REQUIRED. Independently of the branch, the call can return 403 ADS_ADDON_REQUIRED without the ads add-on and 402 PAYMENT_REQUIRED when the billing gate is closed. Meta Ads prerequisite: connecting Meta Ads (via facebook or instagram) requires a Facebook Page. Not because the ad account is read through a Page, but because both parent posting accounts are: the facebook flow only offers Pages you manage, and the instagram flow with loginMethod=facebook_login only offers Instagram accounts linked to one of those Pages. Without a Page there is no parent account to inherit a token from. A user who manages no Facebook Page cannot complete this connection, and the facebook flow ends with error=no_facebook_pages. **Separate-token platforms (tiktok, twitter).** Starts the platform-specific marketing API OAuth flow and creates an ads SocialAccount (tiktokads, xads) with its own token. If the ads account already exists, returns alreadyConnected: true. - tiktok: accountId is OPTIONAL. With accountId, the new tiktokads account links to that posting account (parentAccountId set), so Spark Ads + standalone ads using the posting TT_USER identity become available. Without accountId, ads-only mode kicks in: the new tiktokads account has parentAccountId=null and standalone ads use a synthetic CUSTOMIZED_USER (\"Brand Identity\"); Spark Ads are unavailable because TikTok requires a posting account for them. The Brand Identity is configured separately via PATCH /v1/connect/tiktok-ads (or inline on POST /v1/ads/create via the brandIdentity field). - twitter (X Ads): accountId is REQUIRED. There's no ads-only mode, because tweets need to be authored by a real X user. **Standalone platforms (googleads).** Starts the Google Ads OAuth flow and creates a standalone ads SocialAccount (googleads) with no parent. If the account already exists, returns alreadyConnected: true. Ads accounts appear as regular SocialAccount documents with ads platform values (e.g., metaads, tiktokads) in GET /v1/accounts.
|
|
419
419
|
|
|
420
420
|
### Examples
|
|
421
421
|
|
|
@@ -2215,11 +2215,11 @@ end
|
|
|
2215
2215
|
|
|
2216
2216
|
## list_facebook_pages
|
|
2217
2217
|
|
|
2218
|
-
> <ListFacebookPages200Response> list_facebook_pages(
|
|
2218
|
+
> <ListFacebookPages200Response> list_facebook_pages(opts)
|
|
2219
2219
|
|
|
2220
2220
|
List Facebook pages
|
|
2221
2221
|
|
|
2222
|
-
Returns
|
|
2222
|
+
Returns Facebook Pages after OAuth. Classic connections require profileId and tempToken from the OAuth redirect. Use X-Connect-Token for headless connections. The dashboard business-login picker instead sends only selectionToken, an encrypted grant valid for ten minutes. This requires the initiating user and current profile access and returns only Page IDs and names. X-Connect-Token cannot authorize business selection.
|
|
2223
2223
|
|
|
2224
2224
|
### Examples
|
|
2225
2225
|
|
|
@@ -2238,12 +2238,15 @@ Zernio.configure do |config|
|
|
|
2238
2238
|
end
|
|
2239
2239
|
|
|
2240
2240
|
api_instance = Zernio::ConnectApi.new
|
|
2241
|
-
|
|
2242
|
-
|
|
2241
|
+
opts = {
|
|
2242
|
+
profile_id: 'profile_id_example', # String | Profile ID from your classic connection flow. Required with tempToken.
|
|
2243
|
+
temp_token: 'temp_token_example', # String | Temporary Facebook access token from the classic OAuth callback. Required with profileId.
|
|
2244
|
+
selection_token: 'ENCRYPTED_SELECTION_TOKEN' # String | Encrypted dashboard business-login grant. Send alone instead of profileId and tempToken. Expires after ten minutes.
|
|
2245
|
+
}
|
|
2243
2246
|
|
|
2244
2247
|
begin
|
|
2245
2248
|
# List Facebook pages
|
|
2246
|
-
result = api_instance.list_facebook_pages(
|
|
2249
|
+
result = api_instance.list_facebook_pages(opts)
|
|
2247
2250
|
p result
|
|
2248
2251
|
rescue Zernio::ApiError => e
|
|
2249
2252
|
puts "Error when calling ConnectApi->list_facebook_pages: #{e}"
|
|
@@ -2254,12 +2257,12 @@ end
|
|
|
2254
2257
|
|
|
2255
2258
|
This returns an Array which contains the response data, status code and headers.
|
|
2256
2259
|
|
|
2257
|
-
> <Array(<ListFacebookPages200Response>, Integer, Hash)> list_facebook_pages_with_http_info(
|
|
2260
|
+
> <Array(<ListFacebookPages200Response>, Integer, Hash)> list_facebook_pages_with_http_info(opts)
|
|
2258
2261
|
|
|
2259
2262
|
```ruby
|
|
2260
2263
|
begin
|
|
2261
2264
|
# List Facebook pages
|
|
2262
|
-
data, status_code, headers = api_instance.list_facebook_pages_with_http_info(
|
|
2265
|
+
data, status_code, headers = api_instance.list_facebook_pages_with_http_info(opts)
|
|
2263
2266
|
p status_code # => 2xx
|
|
2264
2267
|
p headers # => { ... }
|
|
2265
2268
|
p data # => <ListFacebookPages200Response>
|
|
@@ -2272,8 +2275,9 @@ end
|
|
|
2272
2275
|
|
|
2273
2276
|
| Name | Type | Description | Notes |
|
|
2274
2277
|
| ---- | ---- | ----------- | ----- |
|
|
2275
|
-
| **profile_id** | **String** | Profile ID from your connection flow |
|
|
2276
|
-
| **temp_token** | **String** | Temporary Facebook access token from the OAuth callback
|
|
2278
|
+
| **profile_id** | **String** | Profile ID from your classic connection flow. Required with tempToken. | [optional] |
|
|
2279
|
+
| **temp_token** | **String** | Temporary Facebook access token from the classic OAuth callback. Required with profileId. | [optional] |
|
|
2280
|
+
| **selection_token** | **String** | Encrypted dashboard business-login grant. Send alone instead of profileId and tempToken. Expires after ten minutes. | [optional] |
|
|
2277
2281
|
|
|
2278
2282
|
### Return type
|
|
2279
2283
|
|
|
@@ -2824,7 +2828,7 @@ end
|
|
|
2824
2828
|
|
|
2825
2829
|
Select Facebook page
|
|
2826
2830
|
|
|
2827
|
-
Complete
|
|
2831
|
+
Complete a classic Facebook Page connection with profileId, pageId, tempToken and userProfile. Use X-Connect-Token for headless connections. The dashboard business-login picker instead sends only selectionToken and pageId to complete a Meta Ads connection. The server verifies the initiating user, profile access, current grants and connection eligibility. The profile, platform token, ad-account scope and return URL come only from the encrypted grant. Business selection requires a session or bearer authentication for the initiating user; X-Connect-Token is not accepted. It returns redirect_url with connected=metaads on success or an eligibility error redirect.
|
|
2828
2832
|
|
|
2829
2833
|
### Examples
|
|
2830
2834
|
|
|
@@ -2843,7 +2847,7 @@ Zernio.configure do |config|
|
|
|
2843
2847
|
end
|
|
2844
2848
|
|
|
2845
2849
|
api_instance = Zernio::ConnectApi.new
|
|
2846
|
-
select_facebook_page_request = Zernio::
|
|
2850
|
+
select_facebook_page_request = Zernio::SelectFacebookPageRequestOneOf.new({profile_id: 'profile_id_example', page_id: 'page_id_example', temp_token: 'temp_token_example', user_profile: Zernio::SelectFacebookPageRequestOneOfUserProfile.new}) # SelectFacebookPageRequest |
|
|
2847
2851
|
|
|
2848
2852
|
begin
|
|
2849
2853
|
# Select Facebook page
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
| **template_language** | **String** | WhatsApp only. Template language code (e.g. en_US). | [optional] |
|
|
16
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]. For positional templates the list must cover every slot: supplying fewer values than the template's header + body + dynamic URL-button count is rejected with a 400 (code INVALID_TEMPLATE_PARAMS) naming the expected split, rather than delivering a template whose button URL was filled from the wrong value. A dynamic URL button covered by templateButtonParams needs no value here unless another uncovered dynamic URL button follows it, since the override applies after slot numbering. 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
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] |
|
|
18
|
+
| **template_cards** | [**Array<CreateInboxConversationRequestTemplateCardsInner>**](CreateInboxConversationRequestTemplateCardsInner.md) | WhatsApp only. Per-card overrides for a CAROUSEL template, each addressed by the card's card_index. Carousel card body variables restart at {{1}} per card, so they cannot be expressed in the flat templateParams slot order; use this instead. A cardIndex naming a card the approved template does not have, a duplicate cardIndex, or a params count that does not match the card body's token count is rejected with 400 (INVALID_TEMPLATE_CARD_PARAM). | [optional] |
|
|
18
19
|
| **header_media** | [**CreateInboxConversationRequestHeaderMedia**](CreateInboxConversationRequestHeaderMedia.md) | | [optional] |
|
|
19
20
|
| **header_location** | [**CreateInboxConversationRequestHeaderLocation**](CreateInboxConversationRequestHeaderLocation.md) | | [optional] |
|
|
20
21
|
|
|
@@ -35,6 +36,7 @@ instance = Zernio::CreateInboxConversationRequest.new(
|
|
|
35
36
|
template_language: null,
|
|
36
37
|
template_params: null,
|
|
37
38
|
template_button_params: null,
|
|
39
|
+
template_cards: null,
|
|
38
40
|
header_media: null,
|
|
39
41
|
header_location: null
|
|
40
42
|
)
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Zernio::CreateInboxConversationRequestTemplateCardsInner
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **card_index** | **Integer** | The card's card_index in the approved template. | |
|
|
8
|
+
| **params** | **Array<String>** | Values for this card's own body variables, in the card's own {{1}}, {{2}}, ... order (or named-slot order of appearance). | [optional] |
|
|
9
|
+
| **header_media** | [**CreateInboxConversationRequestTemplateCardsInnerHeaderMedia**](CreateInboxConversationRequestTemplateCardsInnerHeaderMedia.md) | | [optional] |
|
|
10
|
+
| **buttons** | [**Array<CreateInboxConversationRequestTemplateCardsInnerButtonsInner>**](CreateInboxConversationRequestTemplateCardsInnerButtonsInner.md) | Values for this card's own buttons, each addressed by the button's index within the card. | [optional] |
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```ruby
|
|
15
|
+
require 'zernio-sdk'
|
|
16
|
+
|
|
17
|
+
instance = Zernio::CreateInboxConversationRequestTemplateCardsInner.new(
|
|
18
|
+
card_index: null,
|
|
19
|
+
params: null,
|
|
20
|
+
header_media: null,
|
|
21
|
+
buttons: null
|
|
22
|
+
)
|
|
23
|
+
```
|
|
24
|
+
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Zernio::CreateInboxConversationRequestTemplateCardsInnerButtonsInner
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **index** | **Integer** | Zero-based position of the button within the card's buttons. | |
|
|
8
|
+
| **sub_type** | **String** | The button kind, which decides how the value is sent. | |
|
|
9
|
+
| **value** | **String** | The value to send (quick_reply payload, or the URL dynamic suffix). | |
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```ruby
|
|
14
|
+
require 'zernio-sdk'
|
|
15
|
+
|
|
16
|
+
instance = Zernio::CreateInboxConversationRequestTemplateCardsInnerButtonsInner.new(
|
|
17
|
+
index: null,
|
|
18
|
+
sub_type: null,
|
|
19
|
+
value: null
|
|
20
|
+
)
|
|
21
|
+
```
|
|
22
|
+
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Zernio::CreateInboxConversationRequestTemplateCardsInnerHeaderMedia
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **type** | **String** | Must match the card header's media type. | |
|
|
8
|
+
| **link** | **String** | Public URL of the asset to send. Must be reachable without auth. | [optional] |
|
|
9
|
+
| **id** | **String** | A Meta media id (from the media upload endpoint), as an alternative to link. | [optional] |
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```ruby
|
|
14
|
+
require 'zernio-sdk'
|
|
15
|
+
|
|
16
|
+
instance = Zernio::CreateInboxConversationRequestTemplateCardsInnerHeaderMedia.new(
|
|
17
|
+
type: null,
|
|
18
|
+
link: null,
|
|
19
|
+
id: null
|
|
20
|
+
)
|
|
21
|
+
```
|
|
22
|
+
|
data/docs/MessagesApi.md
CHANGED
|
@@ -101,7 +101,7 @@ end
|
|
|
101
101
|
|
|
102
102
|
Create conversation
|
|
103
103
|
|
|
104
|
-
Start a direct message conversation with a user. If a conversation with that recipient already exists, the message is added to the existing thread. Supported platforms: X, 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 template whose approved header format is LOCATION has no header asset to reconstruct at all: Meta only accepts the location at send time, so pass headerLocation (latitude and longitude required) whenever such a template is sent; headerMedia and headerLocation cannot both be supplied. - 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. - Template fields are accepted on the JSON body only, not on multipart requests. For a number you already have a thread with, this 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). 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).** 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 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
|
+
Start a direct message conversation with a user. If a conversation with that recipient already exists, the message is added to the existing thread. Supported platforms: X, 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 template whose approved header format is LOCATION has no header asset to reconstruct at all: Meta only accepts the location at send time, so pass headerLocation (latitude and longitude required) whenever such a template is sent; headerMedia and headerLocation cannot both be supplied. - 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. - CAROUSEL templates take per-card overrides via templateCards, each addressed by the card's card_index, because card body variables restart at {{1}} per card and cannot be expressed in the flat templateParams order. - Template fields are accepted on the JSON body only, not on multipart requests. For a number you already have a thread with, this 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). 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).** 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 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.
|
|
105
105
|
|
|
106
106
|
### Examples
|
|
107
107
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
| Name | Type | Description | Notes |
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
7
|
| **message** | **String** | | [optional] |
|
|
8
|
-
| **redirect_url** | **String** | Redirect URL
|
|
8
|
+
| **redirect_url** | **String** | Redirect URL when a custom redirect_url was provided or a business Page was selected. | [optional] |
|
|
9
9
|
| **account** | [**SelectFacebookPage200ResponseAccount**](SelectFacebookPage200ResponseAccount.md) | | [optional] |
|
|
10
10
|
|
|
11
11
|
## Example
|
|
@@ -1,26 +1,49 @@
|
|
|
1
1
|
# Zernio::SelectFacebookPageRequest
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## Class instance methods
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
| ---- | ---- | ----------- | ----- |
|
|
7
|
-
| **profile_id** | **String** | Profile ID from your connection flow | |
|
|
8
|
-
| **page_id** | **String** | The Facebook Page ID selected by the user | |
|
|
9
|
-
| **temp_token** | **String** | Temporary Facebook access token from OAuth | |
|
|
10
|
-
| **user_profile** | [**SelectFacebookPageRequestUserProfile**](SelectFacebookPageRequestUserProfile.md) | | |
|
|
11
|
-
| **redirect_url** | **String** | Optional custom redirect URL to return to after selection | [optional] |
|
|
5
|
+
### `openapi_one_of`
|
|
12
6
|
|
|
13
|
-
|
|
7
|
+
Returns the list of classes defined in oneOf.
|
|
8
|
+
|
|
9
|
+
#### Example
|
|
10
|
+
|
|
11
|
+
```ruby
|
|
12
|
+
require 'zernio-sdk'
|
|
13
|
+
|
|
14
|
+
Zernio::SelectFacebookPageRequest.openapi_one_of
|
|
15
|
+
# =>
|
|
16
|
+
# [
|
|
17
|
+
# :'SelectFacebookPageRequestOneOf',
|
|
18
|
+
# :'SelectFacebookPageRequestOneOf1'
|
|
19
|
+
# ]
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### build
|
|
23
|
+
|
|
24
|
+
Find the appropriate object from the `openapi_one_of` list and casts the data into it.
|
|
25
|
+
|
|
26
|
+
#### Example
|
|
14
27
|
|
|
15
28
|
```ruby
|
|
16
29
|
require 'zernio-sdk'
|
|
17
30
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
redirect_url: null
|
|
24
|
-
)
|
|
31
|
+
Zernio::SelectFacebookPageRequest.build(data)
|
|
32
|
+
# => #<SelectFacebookPageRequestOneOf:0x00007fdd4aab02a0>
|
|
33
|
+
|
|
34
|
+
Zernio::SelectFacebookPageRequest.build(data_that_doesnt_match)
|
|
35
|
+
# => nil
|
|
25
36
|
```
|
|
26
37
|
|
|
38
|
+
#### Parameters
|
|
39
|
+
|
|
40
|
+
| Name | Type | Description |
|
|
41
|
+
| ---- | ---- | ----------- |
|
|
42
|
+
| **data** | **Mixed** | data to be matched against the list of oneOf items |
|
|
43
|
+
|
|
44
|
+
#### Return type
|
|
45
|
+
|
|
46
|
+
- `SelectFacebookPageRequestOneOf`
|
|
47
|
+
- `SelectFacebookPageRequestOneOf1`
|
|
48
|
+
- `nil` (if no type matches)
|
|
49
|
+
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Zernio::SelectFacebookPageRequestOneOf
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **profile_id** | **String** | Profile ID from your classic connection flow. | |
|
|
8
|
+
| **page_id** | **String** | The Facebook Page ID selected by the user. | |
|
|
9
|
+
| **temp_token** | **String** | Temporary Facebook access token from OAuth. | |
|
|
10
|
+
| **user_profile** | [**SelectFacebookPageRequestOneOfUserProfile**](SelectFacebookPageRequestOneOfUserProfile.md) | | |
|
|
11
|
+
| **redirect_url** | **String** | Optional custom redirect URL to return to after selection. | [optional] |
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```ruby
|
|
16
|
+
require 'zernio-sdk'
|
|
17
|
+
|
|
18
|
+
instance = Zernio::SelectFacebookPageRequestOneOf.new(
|
|
19
|
+
profile_id: null,
|
|
20
|
+
page_id: null,
|
|
21
|
+
temp_token: null,
|
|
22
|
+
user_profile: null,
|
|
23
|
+
redirect_url: null
|
|
24
|
+
)
|
|
25
|
+
```
|
|
26
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Zernio::SelectFacebookPageRequestOneOf1
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **selection_token** | **String** | Encrypted dashboard business-login grant. Expires after ten minutes. | |
|
|
8
|
+
| **page_id** | **String** | A Page ID from the granted Pages returned by listFacebookPages. | |
|
|
9
|
+
|
|
10
|
+
## Example
|
|
11
|
+
|
|
12
|
+
```ruby
|
|
13
|
+
require 'zernio-sdk'
|
|
14
|
+
|
|
15
|
+
instance = Zernio::SelectFacebookPageRequestOneOf1.new(
|
|
16
|
+
selection_token: ENCRYPTED_SELECTION_TOKEN,
|
|
17
|
+
page_id: null
|
|
18
|
+
)
|
|
19
|
+
```
|
|
20
|
+
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Zernio::SelectFacebookPageRequestOneOfNot
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **selection_token** | **Object** | | |
|
|
8
|
+
|
|
9
|
+
## Example
|
|
10
|
+
|
|
11
|
+
```ruby
|
|
12
|
+
require 'zernio-sdk'
|
|
13
|
+
|
|
14
|
+
instance = Zernio::SelectFacebookPageRequestOneOfNot.new(
|
|
15
|
+
selection_token: null
|
|
16
|
+
)
|
|
17
|
+
```
|
|
18
|
+
|
data/docs/{SelectFacebookPageRequestUserProfile.md → SelectFacebookPageRequestOneOfUserProfile.md}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Zernio::
|
|
1
|
+
# Zernio::SelectFacebookPageRequestOneOfUserProfile
|
|
2
2
|
|
|
3
3
|
## Properties
|
|
4
4
|
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
```ruby
|
|
14
14
|
require 'zernio-sdk'
|
|
15
15
|
|
|
16
|
-
instance = Zernio::
|
|
16
|
+
instance = Zernio::SelectFacebookPageRequestOneOfUserProfile.new(
|
|
17
17
|
id: null,
|
|
18
18
|
name: null,
|
|
19
19
|
profile_picture: null
|
|
@@ -94,7 +94,7 @@ module Zernio
|
|
|
94
94
|
end
|
|
95
95
|
|
|
96
96
|
# Complete Meta business login
|
|
97
|
-
# Facebook Login for Business redirect target. Meta supplies the single-use authorization code and the authenticated state returned by connectAds. The state expires after 30 minutes and binds the user, profile, Page selection and ad-account scope. No bearer token is sent by the browser. Success reconnects only metaads and redirects to the original redirect_url. Invalid state returns 400; inaccessible profiles or missing ads access cannot connect. No token is returned to the browser.
|
|
97
|
+
# Facebook Login for Business redirect target. Meta supplies the single-use authorization code and the authenticated state returned by connectAds. The state expires after 30 minutes and binds the user, profile, Page selection and ad-account scope. No bearer token is sent by the browser. Success reconnects only metaads and redirects to the original redirect_url. Invalid state returns 400; inaccessible profiles or missing ads access cannot connect. Dashboard logins with several Pages redirect to the Facebook Page picker with an encrypted selectionToken valid for ten minutes. Listing and selecting require the initiating user and current profile access. No plaintext platform token is returned to the browser.
|
|
98
98
|
# @param state [String] Authenticated state from the initial connectAds response.
|
|
99
99
|
# @param [Hash] opts the optional parameters
|
|
100
100
|
# @option opts [String] :code Single-use authorization code returned by Meta.
|
|
@@ -106,7 +106,7 @@ module Zernio
|
|
|
106
106
|
end
|
|
107
107
|
|
|
108
108
|
# Complete Meta business login
|
|
109
|
-
# Facebook Login for Business redirect target. Meta supplies the single-use authorization code and the authenticated state returned by connectAds. The state expires after 30 minutes and binds the user, profile, Page selection and ad-account scope. No bearer token is sent by the browser. Success reconnects only metaads and redirects to the original redirect_url. Invalid state returns 400; inaccessible profiles or missing ads access cannot connect. No token is returned to the browser.
|
|
109
|
+
# Facebook Login for Business redirect target. Meta supplies the single-use authorization code and the authenticated state returned by connectAds. The state expires after 30 minutes and binds the user, profile, Page selection and ad-account scope. No bearer token is sent by the browser. Success reconnects only metaads and redirects to the original redirect_url. Invalid state returns 400; inaccessible profiles or missing ads access cannot connect. Dashboard logins with several Pages redirect to the Facebook Page picker with an encrypted selectionToken valid for ten minutes. Listing and selecting require the initiating user and current profile access. No plaintext platform token is returned to the browser.
|
|
110
110
|
# @param state [String] Authenticated state from the initial connectAds response.
|
|
111
111
|
# @param [Hash] opts the optional parameters
|
|
112
112
|
# @option opts [String] :code Single-use authorization code returned by Meta.
|
|
@@ -367,7 +367,7 @@ module Zernio
|
|
|
367
367
|
end
|
|
368
368
|
|
|
369
369
|
# Connect ads for a platform
|
|
370
|
-
# Unified ads connection endpoint. Creates a dedicated ads SocialAccount for the specified platform. **Meta business login (opt-in).** Set `loginMode=business` for `facebook` or `instagram` to use Facebook Login for Business and a Business Integration System User token. No posting account is created or required. This mode always returns an authUrl; it returns 503 when the server has no META_ADS_CONFIG_ID. Complete the dialog in a browser. The callback creates or reconnects only the metaads account, preserving its ID, history and scopedAdAccountIds. Non-empty successful subscription results replace subscribedAdAccountIds to remove stale grants; an empty result leaves routing unchanged. A reconnect must grant every previously scoped ad account (or every previous grant for an unscoped connection). Missing or unverifiable grants return 409 before changing the account. Pass `pageId` to select a granted Page for creatives and lead forms.
|
|
370
|
+
# Unified ads connection endpoint. Creates a dedicated ads SocialAccount for the specified platform. **Meta business login (opt-in).** Set `loginMode=business` for `facebook` or `instagram` to use Facebook Login for Business and a Business Integration System User token. No posting account is created or required. This mode always returns an authUrl; it returns 503 when the server has no META_ADS_CONFIG_ID. Complete the dialog in a browser. The callback creates or reconnects only the metaads account, preserving its ID, history and scopedAdAccountIds. Non-empty successful subscription results replace subscribedAdAccountIds to remove stale grants; an empty result leaves routing unchanged. A reconnect must grant every previously scoped ad account (or every previous grant for an unscoped connection). Missing or unverifiable grants return 409 before changing the account. Pass `pageId` to select a granted Page for creatives and lead forms. API integrations otherwise reuse the previous Page or sole granted Page. Multiple Pages without a selection return 400 with available Page IDs for API integrations; restart with pageId. Dashboard session logins use the sole current grant automatically or open the existing Facebook Page picker for several grants, including reconnects. Selection completes the Meta Ads connection. With no Pages granted the callback returns 400 with instructions to connect again and grant a Page. Success redirects with connected=metaads, profileId and accountId. Business login reports metadata.tokenType=system-user in GET /v1/accounts. An absent Meta expires_in leaves tokenExpiresAt absent; no personal-token re-exchange occurs. Subsequent classic requests can change the ad-account scope using the business token; force=true requires loginMode=business to reconnect that connection. **Same-token platforms (facebook, instagram, linkedin, pinterest).** The ads SocialAccount (metaads, linkedinads, pinterestads) reuses the OAuth token of the parent posting account, but only when an active parent exists and, for facebook and instagram, its stored token carries ads_management and ads_read (linkedin and pinterest need no extra scope). In that case no extra OAuth happens and the response is alreadyConnected: true. When no such parent exists, or the scopes are missing, the endpoint returns an authUrl and a full OAuth round trip is required. When a parent exists but carries no token usable for ad accounts, the call fails with 400 RECONNECT_REQUIRED. Independently of the branch, the call can return 403 ADS_ADDON_REQUIRED without the ads add-on and 402 PAYMENT_REQUIRED when the billing gate is closed. Meta Ads prerequisite: connecting Meta Ads (via facebook or instagram) requires a Facebook Page. Not because the ad account is read through a Page, but because both parent posting accounts are: the facebook flow only offers Pages you manage, and the instagram flow with loginMethod=facebook_login only offers Instagram accounts linked to one of those Pages. Without a Page there is no parent account to inherit a token from. A user who manages no Facebook Page cannot complete this connection, and the facebook flow ends with error=no_facebook_pages. **Separate-token platforms (tiktok, twitter).** Starts the platform-specific marketing API OAuth flow and creates an ads SocialAccount (tiktokads, xads) with its own token. If the ads account already exists, returns alreadyConnected: true. - tiktok: accountId is OPTIONAL. With accountId, the new tiktokads account links to that posting account (parentAccountId set), so Spark Ads + standalone ads using the posting TT_USER identity become available. Without accountId, ads-only mode kicks in: the new tiktokads account has parentAccountId=null and standalone ads use a synthetic CUSTOMIZED_USER (\"Brand Identity\"); Spark Ads are unavailable because TikTok requires a posting account for them. The Brand Identity is configured separately via PATCH /v1/connect/tiktok-ads (or inline on POST /v1/ads/create via the brandIdentity field). - twitter (X Ads): accountId is REQUIRED. There's no ads-only mode, because tweets need to be authored by a real X user. **Standalone platforms (googleads).** Starts the Google Ads OAuth flow and creates a standalone ads SocialAccount (googleads) with no parent. If the account already exists, returns alreadyConnected: true. Ads accounts appear as regular SocialAccount documents with ads platform values (e.g., metaads, tiktokads) in GET /v1/accounts.
|
|
371
371
|
# @param platform [String] Platform to connect ads for. Only platforms with ads support are accepted. In classic mode, `instagram` requires an Instagram account connected with loginMethod=facebook_login whose token carries ads_management and ads_read. With an account connected through the default instagram_login flow no ads account can be created; do not use this value for those accounts.
|
|
372
372
|
# @param profile_id [String] Your Zernio profile ID
|
|
373
373
|
# @param [Hash] opts the optional parameters
|
|
@@ -386,7 +386,7 @@ module Zernio
|
|
|
386
386
|
end
|
|
387
387
|
|
|
388
388
|
# Connect ads for a platform
|
|
389
|
-
# Unified ads connection endpoint. Creates a dedicated ads SocialAccount for the specified platform. **Meta business login (opt-in).** Set `loginMode=business` for `facebook` or `instagram` to use Facebook Login for Business and a Business Integration System User token. No posting account is created or required. This mode always returns an authUrl; it returns 503 when the server has no META_ADS_CONFIG_ID. Complete the dialog in a browser. The callback creates or reconnects only the metaads account, preserving its ID, history and scopedAdAccountIds. Non-empty successful subscription results replace subscribedAdAccountIds to remove stale grants; an empty result leaves routing unchanged. A reconnect must grant every previously scoped ad account (or every previous grant for an unscoped connection). Missing or unverifiable grants return 409 before changing the account. Pass `pageId` to select a granted Page for creatives and lead forms.
|
|
389
|
+
# Unified ads connection endpoint. Creates a dedicated ads SocialAccount for the specified platform. **Meta business login (opt-in).** Set `loginMode=business` for `facebook` or `instagram` to use Facebook Login for Business and a Business Integration System User token. No posting account is created or required. This mode always returns an authUrl; it returns 503 when the server has no META_ADS_CONFIG_ID. Complete the dialog in a browser. The callback creates or reconnects only the metaads account, preserving its ID, history and scopedAdAccountIds. Non-empty successful subscription results replace subscribedAdAccountIds to remove stale grants; an empty result leaves routing unchanged. A reconnect must grant every previously scoped ad account (or every previous grant for an unscoped connection). Missing or unverifiable grants return 409 before changing the account. Pass `pageId` to select a granted Page for creatives and lead forms. API integrations otherwise reuse the previous Page or sole granted Page. Multiple Pages without a selection return 400 with available Page IDs for API integrations; restart with pageId. Dashboard session logins use the sole current grant automatically or open the existing Facebook Page picker for several grants, including reconnects. Selection completes the Meta Ads connection. With no Pages granted the callback returns 400 with instructions to connect again and grant a Page. Success redirects with connected=metaads, profileId and accountId. Business login reports metadata.tokenType=system-user in GET /v1/accounts. An absent Meta expires_in leaves tokenExpiresAt absent; no personal-token re-exchange occurs. Subsequent classic requests can change the ad-account scope using the business token; force=true requires loginMode=business to reconnect that connection. **Same-token platforms (facebook, instagram, linkedin, pinterest).** The ads SocialAccount (metaads, linkedinads, pinterestads) reuses the OAuth token of the parent posting account, but only when an active parent exists and, for facebook and instagram, its stored token carries ads_management and ads_read (linkedin and pinterest need no extra scope). In that case no extra OAuth happens and the response is alreadyConnected: true. When no such parent exists, or the scopes are missing, the endpoint returns an authUrl and a full OAuth round trip is required. When a parent exists but carries no token usable for ad accounts, the call fails with 400 RECONNECT_REQUIRED. Independently of the branch, the call can return 403 ADS_ADDON_REQUIRED without the ads add-on and 402 PAYMENT_REQUIRED when the billing gate is closed. Meta Ads prerequisite: connecting Meta Ads (via facebook or instagram) requires a Facebook Page. Not because the ad account is read through a Page, but because both parent posting accounts are: the facebook flow only offers Pages you manage, and the instagram flow with loginMethod=facebook_login only offers Instagram accounts linked to one of those Pages. Without a Page there is no parent account to inherit a token from. A user who manages no Facebook Page cannot complete this connection, and the facebook flow ends with error=no_facebook_pages. **Separate-token platforms (tiktok, twitter).** Starts the platform-specific marketing API OAuth flow and creates an ads SocialAccount (tiktokads, xads) with its own token. If the ads account already exists, returns alreadyConnected: true. - tiktok: accountId is OPTIONAL. With accountId, the new tiktokads account links to that posting account (parentAccountId set), so Spark Ads + standalone ads using the posting TT_USER identity become available. Without accountId, ads-only mode kicks in: the new tiktokads account has parentAccountId=null and standalone ads use a synthetic CUSTOMIZED_USER (\"Brand Identity\"); Spark Ads are unavailable because TikTok requires a posting account for them. The Brand Identity is configured separately via PATCH /v1/connect/tiktok-ads (or inline on POST /v1/ads/create via the brandIdentity field). - twitter (X Ads): accountId is REQUIRED. There's no ads-only mode, because tweets need to be authored by a real X user. **Standalone platforms (googleads).** Starts the Google Ads OAuth flow and creates a standalone ads SocialAccount (googleads) with no parent. If the account already exists, returns alreadyConnected: true. Ads accounts appear as regular SocialAccount documents with ads platform values (e.g., metaads, tiktokads) in GET /v1/accounts.
|
|
390
390
|
# @param platform [String] Platform to connect ads for. Only platforms with ads support are accepted. In classic mode, `instagram` requires an Instagram account connected with loginMethod=facebook_login whose token carries ads_management and ads_read. With an account connected through the default instagram_login flow no ads account can be created; do not use this value for those accounts.
|
|
391
391
|
# @param profile_id [String] Your Zernio profile ID
|
|
392
392
|
# @param [Hash] opts the optional parameters
|
|
@@ -2189,41 +2189,36 @@ module Zernio
|
|
|
2189
2189
|
end
|
|
2190
2190
|
|
|
2191
2191
|
# List Facebook pages
|
|
2192
|
-
# Returns
|
|
2193
|
-
# @param profile_id [String] Profile ID from your connection flow
|
|
2194
|
-
# @param temp_token [String] Temporary Facebook access token from the OAuth callback redirect
|
|
2192
|
+
# Returns Facebook Pages after OAuth. Classic connections require profileId and tempToken from the OAuth redirect. Use X-Connect-Token for headless connections. The dashboard business-login picker instead sends only selectionToken, an encrypted grant valid for ten minutes. This requires the initiating user and current profile access and returns only Page IDs and names. X-Connect-Token cannot authorize business selection.
|
|
2195
2193
|
# @param [Hash] opts the optional parameters
|
|
2194
|
+
# @option opts [String] :profile_id Profile ID from your classic connection flow. Required with tempToken.
|
|
2195
|
+
# @option opts [String] :temp_token Temporary Facebook access token from the classic OAuth callback. Required with profileId.
|
|
2196
|
+
# @option opts [String] :selection_token Encrypted dashboard business-login grant. Send alone instead of profileId and tempToken. Expires after ten minutes.
|
|
2196
2197
|
# @return [ListFacebookPages200Response]
|
|
2197
|
-
def list_facebook_pages(
|
|
2198
|
-
data, _status_code, _headers = list_facebook_pages_with_http_info(
|
|
2198
|
+
def list_facebook_pages(opts = {})
|
|
2199
|
+
data, _status_code, _headers = list_facebook_pages_with_http_info(opts)
|
|
2199
2200
|
data
|
|
2200
2201
|
end
|
|
2201
2202
|
|
|
2202
2203
|
# List Facebook pages
|
|
2203
|
-
# Returns
|
|
2204
|
-
# @param profile_id [String] Profile ID from your connection flow
|
|
2205
|
-
# @param temp_token [String] Temporary Facebook access token from the OAuth callback redirect
|
|
2204
|
+
# Returns Facebook Pages after OAuth. Classic connections require profileId and tempToken from the OAuth redirect. Use X-Connect-Token for headless connections. The dashboard business-login picker instead sends only selectionToken, an encrypted grant valid for ten minutes. This requires the initiating user and current profile access and returns only Page IDs and names. X-Connect-Token cannot authorize business selection.
|
|
2206
2205
|
# @param [Hash] opts the optional parameters
|
|
2206
|
+
# @option opts [String] :profile_id Profile ID from your classic connection flow. Required with tempToken.
|
|
2207
|
+
# @option opts [String] :temp_token Temporary Facebook access token from the classic OAuth callback. Required with profileId.
|
|
2208
|
+
# @option opts [String] :selection_token Encrypted dashboard business-login grant. Send alone instead of profileId and tempToken. Expires after ten minutes.
|
|
2207
2209
|
# @return [Array<(ListFacebookPages200Response, Integer, Hash)>] ListFacebookPages200Response data, response status code and response headers
|
|
2208
|
-
def list_facebook_pages_with_http_info(
|
|
2210
|
+
def list_facebook_pages_with_http_info(opts = {})
|
|
2209
2211
|
if @api_client.config.debugging
|
|
2210
2212
|
@api_client.config.logger.debug 'Calling API: ConnectApi.list_facebook_pages ...'
|
|
2211
2213
|
end
|
|
2212
|
-
# verify the required parameter 'profile_id' is set
|
|
2213
|
-
if @api_client.config.client_side_validation && profile_id.nil?
|
|
2214
|
-
fail ArgumentError, "Missing the required parameter 'profile_id' when calling ConnectApi.list_facebook_pages"
|
|
2215
|
-
end
|
|
2216
|
-
# verify the required parameter 'temp_token' is set
|
|
2217
|
-
if @api_client.config.client_side_validation && temp_token.nil?
|
|
2218
|
-
fail ArgumentError, "Missing the required parameter 'temp_token' when calling ConnectApi.list_facebook_pages"
|
|
2219
|
-
end
|
|
2220
2214
|
# resource path
|
|
2221
2215
|
local_var_path = '/v1/connect/facebook/select-page'
|
|
2222
2216
|
|
|
2223
2217
|
# query parameters
|
|
2224
2218
|
query_params = opts[:query_params] || {}
|
|
2225
|
-
query_params[:'profileId'] = profile_id
|
|
2226
|
-
query_params[:'tempToken'] = temp_token
|
|
2219
|
+
query_params[:'profileId'] = opts[:'profile_id'] if !opts[:'profile_id'].nil?
|
|
2220
|
+
query_params[:'tempToken'] = opts[:'temp_token'] if !opts[:'temp_token'].nil?
|
|
2221
|
+
query_params[:'selectionToken'] = opts[:'selection_token'] if !opts[:'selection_token'].nil?
|
|
2227
2222
|
|
|
2228
2223
|
# header parameters
|
|
2229
2224
|
header_params = opts[:header_params] || {}
|
|
@@ -2781,7 +2776,7 @@ module Zernio
|
|
|
2781
2776
|
end
|
|
2782
2777
|
|
|
2783
2778
|
# Select Facebook page
|
|
2784
|
-
# Complete
|
|
2779
|
+
# Complete a classic Facebook Page connection with profileId, pageId, tempToken and userProfile. Use X-Connect-Token for headless connections. The dashboard business-login picker instead sends only selectionToken and pageId to complete a Meta Ads connection. The server verifies the initiating user, profile access, current grants and connection eligibility. The profile, platform token, ad-account scope and return URL come only from the encrypted grant. Business selection requires a session or bearer authentication for the initiating user; X-Connect-Token is not accepted. It returns redirect_url with connected=metaads on success or an eligibility error redirect.
|
|
2785
2780
|
# @param select_facebook_page_request [SelectFacebookPageRequest]
|
|
2786
2781
|
# @param [Hash] opts the optional parameters
|
|
2787
2782
|
# @return [SelectFacebookPage200Response]
|
|
@@ -2791,7 +2786,7 @@ module Zernio
|
|
|
2791
2786
|
end
|
|
2792
2787
|
|
|
2793
2788
|
# Select Facebook page
|
|
2794
|
-
# Complete
|
|
2789
|
+
# Complete a classic Facebook Page connection with profileId, pageId, tempToken and userProfile. Use X-Connect-Token for headless connections. The dashboard business-login picker instead sends only selectionToken and pageId to complete a Meta Ads connection. The server verifies the initiating user, profile access, current grants and connection eligibility. The profile, platform token, ad-account scope and return URL come only from the encrypted grant. Business selection requires a session or bearer authentication for the initiating user; X-Connect-Token is not accepted. It returns redirect_url with connected=metaads on success or an eligibility error redirect.
|
|
2795
2790
|
# @param select_facebook_page_request [SelectFacebookPageRequest]
|
|
2796
2791
|
# @param [Hash] opts the optional parameters
|
|
2797
2792
|
# @return [Array<(SelectFacebookPage200Response, Integer, Hash)>] SelectFacebookPage200Response data, response status code and response headers
|