Class: Zernio::ConnectApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ConnectApi

Returns a new instance of ConnectApi.



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

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



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

def api_client
  @api_client
end

Instance Method Details

#assign_google_business_location(account_id, assign_google_business_location_request, opts = {}) ⇒ AssignGoogleBusinessLocation200Response

Assign Google Business Profile location to another profile Connect a Google Business Profile location onto a DIFFERENT profile by reusing the OAuth grant from an already-connected Google Business Profile account, with no browser and no re-authorization. Built for agencies whose single Google account has manager access to many client locations and who run one profile per client: connect one location the normal way (browser OAuth), then bulk-assign the rest onto each client's profile via this endpoint. The path accountId is a SOURCE connected Google Business Profile account (the token holder); the body profileId is the TARGET profile. Returns 409 if the target profile already has a Google Business Profile connection (switch its location with PUT gmb-locations instead).

Parameters:

  • account_id (String)

    A source connected Google Business Profile account whose OAuth grant is reused.

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

    the optional parameters

Returns:



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

def assign_google_business_location(, assign_google_business_location_request, opts = {})
  data, _status_code, _headers = assign_google_business_location_with_http_info(, assign_google_business_location_request, opts)
  data
end

#assign_google_business_location_with_http_info(account_id, assign_google_business_location_request, opts = {}) ⇒ Array<(AssignGoogleBusinessLocation200Response, Integer, Hash)>

Assign Google Business Profile location to another profile Connect a Google Business Profile location onto a DIFFERENT profile by reusing the OAuth grant from an already-connected Google Business Profile account, with no browser and no re-authorization. Built for agencies whose single Google account has manager access to many client locations and who run one profile per client: connect one location the normal way (browser OAuth), then bulk-assign the rest onto each client's profile via this endpoint. The path `accountId` is a SOURCE connected Google Business Profile account (the token holder); the body `profileId` is the TARGET profile. Returns 409 if the target profile already has a Google Business Profile connection (switch its location with PUT gmb-locations instead).

Parameters:

  • account_id (String)

    A source connected Google Business Profile account whose OAuth grant is reused.

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

    the optional parameters

Returns:



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

def assign_google_business_location_with_http_info(, assign_google_business_location_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectApi.assign_google_business_location ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling ConnectApi.assign_google_business_location"
  end
  # verify the required parameter 'assign_google_business_location_request' is set
  if @api_client.config.client_side_validation && assign_google_business_location_request.nil?
    fail ArgumentError, "Missing the required parameter 'assign_google_business_location_request' when calling ConnectApi.assign_google_business_location"
  end
  # resource path
  local_var_path = '/v1/accounts/{accountId}/gmb-locations/assign'.sub('{' + 'accountId' + '}', CGI.escape(.to_s))

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

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

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

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

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

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

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

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

#complete_meta_ads_business_login(state, opts = {}) ⇒ nil

Complete Meta business login 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.

Parameters:

  • state (String)

    Authenticated state from the initial connectAds response.

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

    the optional parameters

Options Hash (opts):

  • :code (String)

    Single-use authorization code returned by Meta.

  • :error (String)

    Meta authorization error when the user declines the dialog.

Returns:

  • (nil)


103
104
105
106
# File 'lib/zernio-sdk/api/connect_api.rb', line 103

def (state, opts = {})
  (state, opts)
  nil
end

#complete_meta_ads_business_login_with_http_info(state, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Complete Meta business login 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.

Parameters:

  • state (String)

    Authenticated state from the initial connectAds response.

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

    the optional parameters

Options Hash (opts):

  • :code (String)

    Single-use authorization code returned by Meta.

  • :error (String)

    Meta authorization error when the user declines the dialog.

Returns:

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

    nil, response status code and response headers



115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# File 'lib/zernio-sdk/api/connect_api.rb', line 115

def (state, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectApi.complete_meta_ads_business_login ...'
  end
  # verify the required parameter 'state' is set
  if @api_client.config.client_side_validation && state.nil?
    fail ArgumentError, "Missing the required parameter 'state' when calling ConnectApi.complete_meta_ads_business_login"
  end
  # resource path
  local_var_path = '/v1/connect/meta-ads/callback'

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

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

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

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

  # return_type
  return_type = opts[:debug_return_type]

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

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

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

#complete_telegram_connect(code, opts = {}) ⇒ CompleteTelegramConnect200Response

Check Telegram status Poll this endpoint to check if a Telegram access code has been used to connect a channel/group. Recommended polling interval: 3 seconds. Status values: pending (waiting for user), connected (channel/group linked), expired (generate a new code).

Parameters:

  • code (String)

    The access code to check status for

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

    the optional parameters

Returns:



171
172
173
174
# File 'lib/zernio-sdk/api/connect_api.rb', line 171

def complete_telegram_connect(code, opts = {})
  data, _status_code, _headers = complete_telegram_connect_with_http_info(code, opts)
  data
end

#complete_telegram_connect_with_http_info(code, opts = {}) ⇒ Array<(CompleteTelegramConnect200Response, Integer, Hash)>

Check Telegram status Poll this endpoint to check if a Telegram access code has been used to connect a channel/group. Recommended polling interval: 3 seconds. Status values: pending (waiting for user), connected (channel/group linked), expired (generate a new code).

Parameters:

  • code (String)

    The access code to check status for

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

    the optional parameters

Returns:



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

def complete_telegram_connect_with_http_info(code, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectApi.complete_telegram_connect ...'
  end
  # verify the required parameter 'code' is set
  if @api_client.config.client_side_validation && code.nil?
    fail ArgumentError, "Missing the required parameter 'code' when calling ConnectApi.complete_telegram_connect"
  end
  # resource path
  local_var_path = '/v1/connect/telegram'

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

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

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

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

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

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

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

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

#complete_whats_app_phone_selection(complete_whats_app_phone_selection_request, opts = {}) ⇒ CompleteWhatsAppPhoneSelection200Response

Complete number selection Bind a specific WhatsApp phone number to the Zernio profile after the user picks one from listWhatsAppPhoneNumbers. Exchanges the short-lived OAuth token for a long-lived token, subscribes the WABA to webhooks, and creates the SocialAccount.

Parameters:

Options Hash (opts):

  • :x_connect_token (String)

    Alternative auth for API users' end customers

Returns:



236
237
238
239
# File 'lib/zernio-sdk/api/connect_api.rb', line 236

def complete_whats_app_phone_selection(complete_whats_app_phone_selection_request, opts = {})
  data, _status_code, _headers = complete_whats_app_phone_selection_with_http_info(complete_whats_app_phone_selection_request, opts)
  data
end

#complete_whats_app_phone_selection_with_http_info(complete_whats_app_phone_selection_request, opts = {}) ⇒ Array<(CompleteWhatsAppPhoneSelection200Response, Integer, Hash)>

Complete number selection Bind a specific WhatsApp phone number to the Zernio profile after the user picks one from `listWhatsAppPhoneNumbers`. Exchanges the short-lived OAuth token for a long-lived token, subscribes the WABA to webhooks, and creates the SocialAccount.

Parameters:

Options Hash (opts):

  • :x_connect_token (String)

    Alternative auth for API users' end customers

Returns:



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

def complete_whats_app_phone_selection_with_http_info(complete_whats_app_phone_selection_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectApi.complete_whats_app_phone_selection ...'
  end
  # verify the required parameter 'complete_whats_app_phone_selection_request' is set
  if @api_client.config.client_side_validation && complete_whats_app_phone_selection_request.nil?
    fail ArgumentError, "Missing the required parameter 'complete_whats_app_phone_selection_request' when calling ConnectApi.complete_whats_app_phone_selection"
  end
  # resource path
  local_var_path = '/v1/connect/whatsapp/select-phone-number'

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

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

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

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

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

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

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

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

#configure_tik_tok_ads_brand_identity(configure_tik_tok_ads_brand_identity_request, opts = {}) ⇒ ConfigureTikTokAdsBrandIdentity200Response

Set TikTok brand identity Set or update the Brand Identity (display name + avatar) for a tiktokads SocialAccount. TikTok requires every ad to carry an identity_id + identity_type pair. The Brand Identity is the CUSTOMIZED_USER alternative to attributing ads to a real @username (TT_USER). This route uploads the supplied image to TikTok, creates the identity via /v2/identity/create/, and caches the resulting identity_id on the account so subsequent POST /v1/ads/create calls can opt into it via identityType: 'CUSTOMIZED_USER'. Configurable on every tiktokads account, including linked-mode ones (those with a posting account on the same profile). Configuration is idempotent and harmless when posting is also connected: the default ad-create path still prefers TT_USER, and CUSTOMIZED_USER is only used per-ad when the caller explicitly opts in. TikTok identities are immutable post-creation. Re-saving creates a new identity on TikTok and swaps the cached id; the old identity stays orphaned on TikTok's side (harmless, no billing impact). Alternative: pass brandIdentity directly on POST /v1/ads/create to configure on first ad creation in a single round-trip.

Parameters:

Returns:



306
307
308
309
# File 'lib/zernio-sdk/api/connect_api.rb', line 306

def configure_tik_tok_ads_brand_identity(configure_tik_tok_ads_brand_identity_request, opts = {})
  data, _status_code, _headers = configure_tik_tok_ads_brand_identity_with_http_info(configure_tik_tok_ads_brand_identity_request, opts)
  data
end

#configure_tik_tok_ads_brand_identity_with_http_info(configure_tik_tok_ads_brand_identity_request, opts = {}) ⇒ Array<(ConfigureTikTokAdsBrandIdentity200Response, Integer, Hash)>

Set TikTok brand identity Set or update the Brand Identity (display name + avatar) for a `tiktokads` SocialAccount. TikTok requires every ad to carry an `identity_id + identity_type` pair. The Brand Identity is the CUSTOMIZED_USER alternative to attributing ads to a real @username (TT_USER). This route uploads the supplied image to TikTok, creates the identity via `/v2/identity/create/`, and caches the resulting `identity_id` on the account so subsequent `POST /v1/ads/create` calls can opt into it via `identityType: 'CUSTOMIZED_USER'`. Configurable on every `tiktokads` account, including linked-mode ones (those with a posting account on the same profile). Configuration is idempotent and harmless when posting is also connected: the default ad-create path still prefers TT_USER, and CUSTOMIZED_USER is only used per-ad when the caller explicitly opts in. TikTok identities are immutable post-creation. Re-saving creates a new identity on TikTok and swaps the cached id; the old identity stays orphaned on TikTok's side (harmless, no billing impact). Alternative: pass `brandIdentity` directly on `POST /v1/ads/create` to configure on first ad creation in a single round-trip.

Parameters:

Returns:



316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
# File 'lib/zernio-sdk/api/connect_api.rb', line 316

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

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

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

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

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

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

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

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

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

#connect_ads(platform, profile_id, opts = {}) ⇒ ConnectAds200Response

Connect ads for a platform 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.

Parameters:

  • 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.

  • profile_id (String)

    Your Zernio profile ID

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

    the optional parameters

Options Hash (opts):

  • :login_mode (String)

    Meta ads authorization mode. Business login is opt-in for Facebook and Instagram; classic preserves the posting-account flow. (default to 'classic')

  • :permission_level (String)

    Business login only. Ad-account permission the connection's system user will hold. `full` asks the owner for Full control (MANAGE; required to create pixels and other account-level assets through Zernio). `advertise` asks for Manage campaigns (ADVERTISE), enough for campaigns, ad sets, creatives, ads, media and reporting, for owners who will not grant billing-level control to an integration. Either way Meta only lets a business admin complete the grant. 503 if the advertise configuration is not set up. (default to 'full')

  • :page_id (String)

    Business login only. Facebook Page ID to select from the token grants for ad creatives and lead forms.

  • :account_id (String)

    Existing SocialAccount ID. Required for `twitter` (X Ads). Optional for `tiktok`: omit to enter ads-only mode (no TikTok posting account linked; ad creation uses a Brand Identity instead of a TT_USER). Ignored for same-token (`facebook`, `instagram`, `linkedin`, `pinterest`) and standalone (`googleads`) platforms.

  • :redirect_url (String)

    Custom URL the browser is sent to once the OAuth flow finishes. Honored on every ads platform, including the separate-token (`tiktok`, `twitter`) and standalone (`googleads`) flows. MUST be an absolute http(s) URL or a custom app scheme for mobile deeplinks (e.g. myapp://callback); a relative path is rejected with 400 INVALID_REDIRECT_URL. On success `tiktok`, `twitter` and `googleads` land on the URL unchanged, while the same-token platforms (`facebook`, `instagram`, `linkedin`, `pinterest`) append `connected`, `profileId`, `accountId`, `username` and, on API-key calls, `connect_token`. On failure the same error contract applies as on GET /v1/connect/platform: `error` and `platform` are always appended, other params are optional, and the value list there is not exhaustive. On the tiktok, twitter and googleads flows `platform` carries the ads platform id (`tiktokads`, `xads`, `googleads`), not the value used in the request path. When omitted, the browser lands on the Zernio dashboard.

  • :headless (Boolean)

    Enable headless mode (same-token platforms only) (default to false)

  • :force (Boolean)

    Force a fresh OAuth even when an account already exists. Normally the endpoint returns `alreadyConnected: true` whenever a connected account is found, keying off its active state rather than token liveness. Set `force=true` to bypass that and always receivean `authUrl`. Completing the returned OAuth refreshes the stored token on the existing posting and ads accounts in place. (default to false)

  • :ad_account_id (String)

    Scope ad sync to a single platform ad account. Without this param, sync covers every ad account the connected token can see. Business-login reconnects preserve the existing scope; supplied IDs are checked against the new grant. To change that scope after migration, call this endpoint with the IDs and omit loginMode. Supported on `facebook`/`instagram` (Meta, `act_<digits>`), `linkedin` (bare numeric sponsored-account id), `googleads` (bare customer id digits) and `twitter` (X Ads, base36 account id). `tiktok` scopes advertisers at OAuth and `pinterest` has no ads discovery, so both ignore it. Meta ids are additionally validated against the connected token; unreachable IDs return 400. Setting a scope also removes already synced ads from de-scoped ad accounts. For multiple accounts use `adAccountIds` instead.

  • :ad_account_ids (Array<String>)

    Scope ad sync to multiple platform ad accounts (same platform support and id shapes as `adAccountId`). Repeat the param (`?adAccountIds=act_1&adAccountIds=act_2`) or comma-separate (`?adAccountIds=act_1,act_2`). Persisted server-side; latest call wins, and de-scoped ad accounts have their synced ads removed. Omitting both `adAccountId` and `adAccountIds` keeps any previously persisted scope unchanged.

Returns:



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

def connect_ads(platform, profile_id, opts = {})
  data, _status_code, _headers = connect_ads_with_http_info(platform, profile_id, opts)
  data
end

#connect_ads_with_http_info(platform, profile_id, opts = {}) ⇒ Array<(ConnectAds200Response, Integer, Hash)>

Connect ads for a platform 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 (&quot;Brand Identity&quot;); 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.

Parameters:

  • 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.

  • profile_id (String)

    Your Zernio profile ID

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

    the optional parameters

Options Hash (opts):

  • :login_mode (String)

    Meta ads authorization mode. Business login is opt-in for Facebook and Instagram; classic preserves the posting-account flow. (default to 'classic')

  • :permission_level (String)

    Business login only. Ad-account permission the connection's system user will hold. `full` asks the owner for Full control (MANAGE; required to create pixels and other account-level assets through Zernio). `advertise` asks for Manage campaigns (ADVERTISE), enough for campaigns, ad sets, creatives, ads, media and reporting, for owners who will not grant billing-level control to an integration. Either way Meta only lets a business admin complete the grant. 503 if the advertise configuration is not set up. (default to 'full')

  • :page_id (String)

    Business login only. Facebook Page ID to select from the token grants for ad creatives and lead forms.

  • :account_id (String)

    Existing SocialAccount ID. Required for `twitter` (X Ads). Optional for `tiktok`: omit to enter ads-only mode (no TikTok posting account linked; ad creation uses a Brand Identity instead of a TT_USER). Ignored for same-token (`facebook`, `instagram`, `linkedin`, `pinterest`) and standalone (`googleads`) platforms.

  • :redirect_url (String)

    Custom URL the browser is sent to once the OAuth flow finishes. Honored on every ads platform, including the separate-token (`tiktok`, `twitter`) and standalone (`googleads`) flows. MUST be an absolute http(s) URL or a custom app scheme for mobile deeplinks (e.g. myapp://callback); a relative path is rejected with 400 INVALID_REDIRECT_URL. On success `tiktok`, `twitter` and `googleads` land on the URL unchanged, while the same-token platforms (`facebook`, `instagram`, `linkedin`, `pinterest`) append `connected`, `profileId`, `accountId`, `username` and, on API-key calls, `connect_token`. On failure the same error contract applies as on GET /v1/connect/platform: `error` and `platform` are always appended, other params are optional, and the value list there is not exhaustive. On the tiktok, twitter and googleads flows `platform` carries the ads platform id (`tiktokads`, `xads`, `googleads`), not the value used in the request path. When omitted, the browser lands on the Zernio dashboard.

  • :headless (Boolean)

    Enable headless mode (same-token platforms only) (default to false)

  • :force (Boolean)

    Force a fresh OAuth even when an account already exists. Normally the endpoint returns `alreadyConnected: true` whenever a connected account is found, keying off its active state rather than token liveness. Set `force=true` to bypass that and always receivean `authUrl`. Completing the returned OAuth refreshes the stored token on the existing posting and ads accounts in place. (default to false)

  • :ad_account_id (String)

    Scope ad sync to a single platform ad account. Without this param, sync covers every ad account the connected token can see. Business-login reconnects preserve the existing scope; supplied IDs are checked against the new grant. To change that scope after migration, call this endpoint with the IDs and omit loginMode. Supported on `facebook`/`instagram` (Meta, `act_<digits>`), `linkedin` (bare numeric sponsored-account id), `googleads` (bare customer id digits) and `twitter` (X Ads, base36 account id). `tiktok` scopes advertisers at OAuth and `pinterest` has no ads discovery, so both ignore it. Meta ids are additionally validated against the connected token; unreachable IDs return 400. Setting a scope also removes already synced ads from de-scoped ad accounts. For multiple accounts use `adAccountIds` instead.

  • :ad_account_ids (Array<String>)

    Scope ad sync to multiple platform ad accounts (same platform support and id shapes as `adAccountId`). Repeat the param (`?adAccountIds=act_1&adAccountIds=act_2`) or comma-separate (`?adAccountIds=act_1,act_2`). Persisted server-side; latest call wins, and de-scoped ad accounts have their synced ads removed. Omitting both `adAccountId` and `adAccountIds` keeps any previously persisted scope unchanged.

Returns:

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

    ConnectAds200Response data, response status code and response headers



404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
# File 'lib/zernio-sdk/api/connect_api.rb', line 404

def connect_ads_with_http_info(platform, profile_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectApi.connect_ads ...'
  end
  # verify the required parameter 'platform' is set
  if @api_client.config.client_side_validation && platform.nil?
    fail ArgumentError, "Missing the required parameter 'platform' when calling ConnectApi.connect_ads"
  end
  # verify enum value
  allowable_values = ["facebook", "instagram", "linkedin", "tiktok", "twitter", "pinterest", "googleads"]
  if @api_client.config.client_side_validation && !allowable_values.include?(platform)
    fail ArgumentError, "invalid value for \"platform\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'profile_id' is set
  if @api_client.config.client_side_validation && profile_id.nil?
    fail ArgumentError, "Missing the required parameter 'profile_id' when calling ConnectApi.connect_ads"
  end
  allowable_values = ["classic", "business"]
  if @api_client.config.client_side_validation && opts[:'login_mode'] && !allowable_values.include?(opts[:'login_mode'])
    fail ArgumentError, "invalid value for \"login_mode\", must be one of #{allowable_values}"
  end
  allowable_values = ["full", "advertise"]
  if @api_client.config.client_side_validation && opts[:'permission_level'] && !allowable_values.include?(opts[:'permission_level'])
    fail ArgumentError, "invalid value for \"permission_level\", must be one of #{allowable_values}"
  end
  pattern = Regexp.new(/^\d+$/)
  if @api_client.config.client_side_validation && !opts[:'page_id'].nil? && opts[:'page_id'] !~ pattern
    fail ArgumentError, "invalid value for 'opts[:\"page_id\"]' when calling ConnectApi.connect_ads, must conform to the pattern #{pattern}."
  end

  # resource path
  local_var_path = '/v1/connect/{platform}/ads'.sub('{' + 'platform' + '}', CGI.escape(platform.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'profileId'] = profile_id
  query_params[:'loginMode'] = opts[:'login_mode'] if !opts[:'login_mode'].nil?
  query_params[:'permissionLevel'] = opts[:'permission_level'] if !opts[:'permission_level'].nil?
  query_params[:'pageId'] = opts[:'page_id'] if !opts[:'page_id'].nil?
  query_params[:'accountId'] = opts[:'account_id'] if !opts[:'account_id'].nil?
  query_params[:'redirect_url'] = opts[:'redirect_url'] if !opts[:'redirect_url'].nil?
  query_params[:'headless'] = opts[:'headless'] if !opts[:'headless'].nil?
  query_params[:'force'] = opts[:'force'] if !opts[:'force'].nil?
  query_params[:'adAccountId'] = opts[:'ad_account_id'] if !opts[:'ad_account_id'].nil?
  query_params[:'adAccountIds'] = @api_client.build_collection_param(opts[:'ad_account_ids'], :multi) if !opts[:'ad_account_ids'].nil?

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

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

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

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

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

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

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

#connect_bluesky_credentials(connect_bluesky_credentials_request, opts = {}) ⇒ ConnectBlueskyCredentials200Response

Connect Bluesky account Connect a Bluesky account using identifier (handle or email) and an app password. To get your userId for the state parameter, call GET /v1/users which includes a currentUserId field.

Parameters:

Returns:



489
490
491
492
# File 'lib/zernio-sdk/api/connect_api.rb', line 489

def connect_bluesky_credentials(connect_bluesky_credentials_request, opts = {})
  data, _status_code, _headers = connect_bluesky_credentials_with_http_info(connect_bluesky_credentials_request, opts)
  data
end

#connect_bluesky_credentials_with_http_info(connect_bluesky_credentials_request, opts = {}) ⇒ Array<(ConnectBlueskyCredentials200Response, Integer, Hash)>

Connect Bluesky account Connect a Bluesky account using identifier (handle or email) and an app password. To get your userId for the state parameter, call GET /v1/users which includes a currentUserId field.

Parameters:

Returns:



499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
# File 'lib/zernio-sdk/api/connect_api.rb', line 499

def connect_bluesky_credentials_with_http_info(connect_bluesky_credentials_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectApi.connect_bluesky_credentials ...'
  end
  # verify the required parameter 'connect_bluesky_credentials_request' is set
  if @api_client.config.client_side_validation && connect_bluesky_credentials_request.nil?
    fail ArgumentError, "Missing the required parameter 'connect_bluesky_credentials_request' when calling ConnectApi.connect_bluesky_credentials"
  end
  # resource path
  local_var_path = '/v1/connect/bluesky/credentials'

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

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

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

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

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

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

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

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

#connect_discord_channel(connect_discord_channel_request, opts = {}) ⇒ nil

Connect a Discord channel Finalize a Discord connect by binding one channel to a profile. Served by a dedicated route, so it is not reachable through POST /v1/connect/platform. One connected account per channel: repeat the call with a different channelId to add another.

Parameters:

Returns:

  • (nil)


557
558
559
560
# File 'lib/zernio-sdk/api/connect_api.rb', line 557

def connect_discord_channel(connect_discord_channel_request, opts = {})
  connect_discord_channel_with_http_info(connect_discord_channel_request, opts)
  nil
end

#connect_discord_channel_with_http_info(connect_discord_channel_request, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Connect a Discord channel Finalize a Discord connect by binding one channel to a profile. Served by a dedicated route, so it is not reachable through POST /v1/connect/platform. One connected account per channel: repeat the call with a different channelId to add another.

Parameters:

Returns:

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

    nil, response status code and response headers



567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
# File 'lib/zernio-sdk/api/connect_api.rb', line 567

def connect_discord_channel_with_http_info(connect_discord_channel_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectApi.connect_discord_channel ...'
  end
  # verify the required parameter 'connect_discord_channel_request' is set
  if @api_client.config.client_side_validation && connect_discord_channel_request.nil?
    fail ArgumentError, "Missing the required parameter 'connect_discord_channel_request' when calling ConnectApi.connect_discord_channel"
  end
  # resource path
  local_var_path = '/v1/connect/discord'

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

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

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

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

  # return_type
  return_type = opts[:debug_return_type]

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

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

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

#connect_open_ai_ads_credentials(connect_open_ai_ads_credentials_request, opts = {}) ⇒ ConnectOpenAIAdsCredentials200Response

Connect an OpenAI Ads account Connect an OpenAI Ads account using an API key from ChatGPT Ads Manager. The key grants full campaign write access on OpenAI's side (OpenAI does not offer a read-only key scope). Zernio uses it to read ads and performance, and to create and manage campaigns you set up through Zernio (create, status, budget, and cancel). Campaigns created directly in ChatGPT Ads Manager can still be managed there.

Parameters:

Returns:



625
626
627
628
# File 'lib/zernio-sdk/api/connect_api.rb', line 625

def connect_open_ai_ads_credentials(connect_open_ai_ads_credentials_request, opts = {})
  data, _status_code, _headers = connect_open_ai_ads_credentials_with_http_info(connect_open_ai_ads_credentials_request, opts)
  data
end

#connect_open_ai_ads_credentials_with_http_info(connect_open_ai_ads_credentials_request, opts = {}) ⇒ Array<(ConnectOpenAIAdsCredentials200Response, Integer, Hash)>

Connect an OpenAI Ads account Connect an OpenAI Ads account using an API key from ChatGPT Ads Manager. The key grants full campaign write access on OpenAI's side (OpenAI does not offer a read-only key scope). Zernio uses it to read ads and performance, and to create and manage campaigns you set up through Zernio (create, status, budget, and cancel). Campaigns created directly in ChatGPT Ads Manager can still be managed there.

Parameters:

Returns:



635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
# File 'lib/zernio-sdk/api/connect_api.rb', line 635

def connect_open_ai_ads_credentials_with_http_info(connect_open_ai_ads_credentials_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectApi.connect_open_ai_ads_credentials ...'
  end
  # verify the required parameter 'connect_open_ai_ads_credentials_request' is set
  if @api_client.config.client_side_validation && connect_open_ai_ads_credentials_request.nil?
    fail ArgumentError, "Missing the required parameter 'connect_open_ai_ads_credentials_request' when calling ConnectApi.connect_open_ai_ads_credentials"
  end
  # resource path
  local_var_path = '/v1/connect/openai-ads/credentials'

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

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

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

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

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

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

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

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

#connect_shopify_with_token(connect_shopify_with_token_request, opts = {}) ⇒ ConnectShopifyWithToken200Response

Connect a Shopify store with a custom-app Admin token Token-paste alternative to the OAuth flow: connect a store using the Admin API access token of a custom app the merchant created in their own Shopify admin (Settings → Apps and sales channels → Develop apps, with the read_content, write_content, read_products and write_products scopes). Use this when the one-click OAuth connect is unavailable or when your users prefer not to install a third-party app on their store. The token is validated against the store before anything is saved; custom-app tokens do not expire. Connecting the same profile to a store again replaces the stored token in place.

Parameters:

Returns:



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

def connect_shopify_with_token(connect_shopify_with_token_request, opts = {})
  data, _status_code, _headers = connect_shopify_with_token_with_http_info(connect_shopify_with_token_request, opts)
  data
end

#connect_shopify_with_token_with_http_info(connect_shopify_with_token_request, opts = {}) ⇒ Array<(ConnectShopifyWithToken200Response, Integer, Hash)>

Connect a Shopify store with a custom-app Admin token Token-paste alternative to the OAuth flow: connect a store using the Admin API access token of a custom app the merchant created in their own Shopify admin (Settings → Apps and sales channels → Develop apps, with the `read_content`, `write_content`, `read_products` and `write_products` scopes). Use this when the one-click OAuth connect is unavailable or when your users prefer not to install a third-party app on their store. The token is validated against the store before anything is saved; custom-app tokens do not expire. Connecting the same profile to a store again replaces the stored token in place.

Parameters:

Returns:



703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
# File 'lib/zernio-sdk/api/connect_api.rb', line 703

def connect_shopify_with_token_with_http_info(connect_shopify_with_token_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectApi.connect_shopify_with_token ...'
  end
  # verify the required parameter 'connect_shopify_with_token_request' is set
  if @api_client.config.client_side_validation && connect_shopify_with_token_request.nil?
    fail ArgumentError, "Missing the required parameter 'connect_shopify_with_token_request' when calling ConnectApi.connect_shopify_with_token"
  end
  # resource path
  local_var_path = '/v1/connect/shopify/token'

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

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

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

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

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

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

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

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

#connect_slack_channel(connect_slack_channel_request, opts = {}) ⇒ nil

Connect a Slack channel Finalize a Slack connect by creating the per-channel account. Served by a dedicated route, so it is not reachable through POST /v1/connect/platform. Send pendingDataToken for a first connect (the nonce from the OAuth redirect) or accountId to add another channel to a workspace already connected.

Parameters:

Returns:

  • (nil)


761
762
763
764
# File 'lib/zernio-sdk/api/connect_api.rb', line 761

def connect_slack_channel(connect_slack_channel_request, opts = {})
  connect_slack_channel_with_http_info(connect_slack_channel_request, opts)
  nil
end

#connect_slack_channel_with_http_info(connect_slack_channel_request, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Connect a Slack channel Finalize a Slack connect by creating the per-channel account. Served by a dedicated route, so it is not reachable through POST /v1/connect/platform. Send pendingDataToken for a first connect (the nonce from the OAuth redirect) or accountId to add another channel to a workspace already connected.

Parameters:

Returns:

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

    nil, response status code and response headers



771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
# File 'lib/zernio-sdk/api/connect_api.rb', line 771

def connect_slack_channel_with_http_info(connect_slack_channel_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectApi.connect_slack_channel ...'
  end
  # verify the required parameter 'connect_slack_channel_request' is set
  if @api_client.config.client_side_validation && connect_slack_channel_request.nil?
    fail ArgumentError, "Missing the required parameter 'connect_slack_channel_request' when calling ConnectApi.connect_slack_channel"
  end
  # resource path
  local_var_path = '/v1/connect/slack'

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

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

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

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

  # return_type
  return_type = opts[:debug_return_type]

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

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

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

#connect_whats_app_credentials(connect_whats_app_credentials_request, opts = {}) ⇒ ConnectWhatsAppCredentials200Response

Connect WhatsApp via credentials Connect a WhatsApp Business Account by providing Meta credentials directly. This is the headless alternative to the Embedded Signup browser flow. To get the required credentials: 1. Go to Meta Business Suite (business.facebook.com) 2. Create or select a WhatsApp Business Account 3. In Business Settings > System Users, create a System User 4. Assign it the whatsapp_business_management and whatsapp_business_messaging permissions 5. Generate a permanent access token 6. Get the WABA ID from WhatsApp Manager > Account Tools > Phone Numbers 7. Get the Phone Number ID from the same page (click on the number) Warning: connecting subscribes your own Meta app to this WABA with an override callback that redirects its webhook delivery to Zernio. This WABA's events stop reaching any callback URL you had configured before, immediately and with no overlap window. Do not unsubscribe your app from the WABA afterward: that also cuts off Zernio's delivery, and recovery requires calling this endpoint again.

Parameters:

Returns:



829
830
831
832
# File 'lib/zernio-sdk/api/connect_api.rb', line 829

def connect_whats_app_credentials(connect_whats_app_credentials_request, opts = {})
  data, _status_code, _headers = connect_whats_app_credentials_with_http_info(connect_whats_app_credentials_request, opts)
  data
end

#connect_whats_app_credentials_with_http_info(connect_whats_app_credentials_request, opts = {}) ⇒ Array<(ConnectWhatsAppCredentials200Response, Integer, Hash)>

Connect WhatsApp via credentials Connect a WhatsApp Business Account by providing Meta credentials directly. This is the headless alternative to the Embedded Signup browser flow. To get the required credentials: 1. Go to Meta Business Suite (business.facebook.com) 2. Create or select a WhatsApp Business Account 3. In Business Settings > System Users, create a System User 4. Assign it the whatsapp_business_management and whatsapp_business_messaging permissions 5. Generate a permanent access token 6. Get the WABA ID from WhatsApp Manager > Account Tools > Phone Numbers 7. Get the Phone Number ID from the same page (click on the number) Warning: connecting subscribes your own Meta app to this WABA with an override callback that redirects its webhook delivery to Zernio. This WABA's events stop reaching any callback URL you had configured before, immediately and with no overlap window. Do not unsubscribe your app from the WABA afterward: that also cuts off Zernio's delivery, and recovery requires calling this endpoint again.

Parameters:

Returns:



839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
# File 'lib/zernio-sdk/api/connect_api.rb', line 839

def connect_whats_app_credentials_with_http_info(connect_whats_app_credentials_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectApi.connect_whats_app_credentials ...'
  end
  # verify the required parameter 'connect_whats_app_credentials_request' is set
  if @api_client.config.client_side_validation && connect_whats_app_credentials_request.nil?
    fail ArgumentError, "Missing the required parameter 'connect_whats_app_credentials_request' when calling ConnectApi.connect_whats_app_credentials"
  end
  # resource path
  local_var_path = '/v1/connect/whatsapp/credentials'

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

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

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

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

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

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

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

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

#connect_whats_app_embedded_signup(connect_whats_app_embedded_signup_request, opts = {}) ⇒ ConnectWhatsAppEmbeddedSignup200Response

Connect WhatsApp from Embedded Signup Exchange the authorization code Meta's Embedded Signup popup returned. This is the call the Zernio-hosted signup page makes after the popup closes (GET /v1/connect/whatsapp?signup=hosted), sending the wabaId and phoneNumberId Meta reported so exactly the chosen number is connected; when both are omitted the first number the token can see is used. The code never passes through a redirect_uri, so POST /v1/connect/{platform} cannot accept it. Authenticates with an API key, or with the connect token the hosted flow issues (X-Connect-Token header).

Parameters:

Options Hash (opts):

  • :x_connect_token (String)

    Connect token issued by the hosted signup flow, accepted instead of an API key.

Returns:



898
899
900
901
# File 'lib/zernio-sdk/api/connect_api.rb', line 898

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

#connect_whats_app_embedded_signup_with_http_info(connect_whats_app_embedded_signup_request, opts = {}) ⇒ Array<(ConnectWhatsAppEmbeddedSignup200Response, Integer, Hash)>

Connect WhatsApp from Embedded Signup Exchange the authorization code Meta's Embedded Signup popup returned. This is the call the Zernio-hosted signup page makes after the popup closes (`GET /v1/connect/whatsapp?signup=hosted`), sending the `wabaId` and `phoneNumberId` Meta reported so exactly the chosen number is connected; when both are omitted the first number the token can see is used. The code never passes through a `redirect_uri`, so `POST /v1/connect/platform` cannot accept it. Authenticates with an API key, or with the connect token the hosted flow issues (`X-Connect-Token` header).

Parameters:

Options Hash (opts):

  • :x_connect_token (String)

    Connect token issued by the hosted signup flow, accepted instead of an API key.

Returns:



909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
# File 'lib/zernio-sdk/api/connect_api.rb', line 909

def (, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectApi.connect_whats_app_embedded_signup ...'
  end
  # verify the required parameter 'connect_whats_app_embedded_signup_request' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'connect_whats_app_embedded_signup_request' when calling ConnectApi.connect_whats_app_embedded_signup"
  end
  # resource path
  local_var_path = '/v1/connect/whatsapp/embedded-signup'

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

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

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

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

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

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

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

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

#connect_word_press_with_application_password(connect_word_press_with_application_password_request, opts = {}) ⇒ ConnectWordPressWithApplicationPassword200Response

Connect self-hosted WordPress with an application password Connects one self-hosted WordPress site using a WordPress username and application password. siteUrl must use HTTPS and may include the path where WordPress is installed. Zernio discovers the REST API, verifies the credentials and required post/media/taxonomy capabilities, then stores the password encrypted. Create an application password in the WordPress user's profile; do not send the user's login password. Reconnecting the same site and profile updates the connection in place.

Parameters:

Returns:



968
969
970
971
# File 'lib/zernio-sdk/api/connect_api.rb', line 968

def connect_word_press_with_application_password(connect_word_press_with_application_password_request, opts = {})
  data, _status_code, _headers = connect_word_press_with_application_password_with_http_info(connect_word_press_with_application_password_request, opts)
  data
end

#connect_word_press_with_application_password_with_http_info(connect_word_press_with_application_password_request, opts = {}) ⇒ Array<(ConnectWordPressWithApplicationPassword200Response, Integer, Hash)>

Connect self-hosted WordPress with an application password Connects one self-hosted WordPress site using a WordPress username and application password. `siteUrl` must use HTTPS and may include the path where WordPress is installed. Zernio discovers the REST API, verifies the credentials and required post/media/taxonomy capabilities, then stores the password encrypted. Create an application password in the WordPress user's profile; do not send the user's login password. Reconnecting the same site and profile updates the connection in place.

Parameters:

Returns:



978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
# File 'lib/zernio-sdk/api/connect_api.rb', line 978

def connect_word_press_with_application_password_with_http_info(connect_word_press_with_application_password_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectApi.connect_word_press_with_application_password ...'
  end
  # verify the required parameter 'connect_word_press_with_application_password_request' is set
  if @api_client.config.client_side_validation && connect_word_press_with_application_password_request.nil?
    fail ArgumentError, "Missing the required parameter 'connect_word_press_with_application_password_request' when calling ConnectApi.connect_word_press_with_application_password"
  end
  # resource path
  local_var_path = '/v1/connect/wordpress/token'

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

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

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

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

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

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

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

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

#create_pinterest_board(account_id, create_pinterest_board_request, opts = {}) ⇒ CreatePinterestBoard201Response

Create Pinterest board Creates a new board on the connected Pinterest account. The returned board ID can be used immediately as platformSpecificData.boardId when creating a Pinterest post.

Parameters:

  • account_id (String)
  • create_pinterest_board_request (CreatePinterestBoardRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1037
1038
1039
1040
# File 'lib/zernio-sdk/api/connect_api.rb', line 1037

def create_pinterest_board(, create_pinterest_board_request, opts = {})
  data, _status_code, _headers = create_pinterest_board_with_http_info(, create_pinterest_board_request, opts)
  data
end

#create_pinterest_board_with_http_info(account_id, create_pinterest_board_request, opts = {}) ⇒ Array<(CreatePinterestBoard201Response, Integer, Hash)>

Create Pinterest board Creates a new board on the connected Pinterest account. The returned board ID can be used immediately as `platformSpecificData.boardId` when creating a Pinterest post.

Parameters:

  • account_id (String)
  • create_pinterest_board_request (CreatePinterestBoardRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
# File 'lib/zernio-sdk/api/connect_api.rb', line 1048

def create_pinterest_board_with_http_info(, create_pinterest_board_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectApi.create_pinterest_board ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling ConnectApi.create_pinterest_board"
  end
  # verify the required parameter 'create_pinterest_board_request' is set
  if @api_client.config.client_side_validation && create_pinterest_board_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_pinterest_board_request' when calling ConnectApi.create_pinterest_board"
  end
  # resource path
  local_var_path = '/v1/accounts/{accountId}/pinterest-boards'.sub('{' + 'accountId' + '}', CGI.escape(.to_s))

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

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

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

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

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

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

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

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

#create_youtube_playlist(account_id, create_youtube_playlist_request, opts = {}) ⇒ CreateYoutubePlaylist201Response

Create YouTube playlist Creates an empty playlist on the connected YouTube channel. Requires a title; privacy defaults to private. Returns the same playlist shape as the list endpoint. Pass the returned playlist.id as platformSpecificData.playlistId when publishing a video. Does not change the account's default playlist. Requires the youtube or youtube.force-ssl OAuth scope. Costs 50 YouTube quota units. This operation is not idempotent and is not automatically retried: repeating a request can create another playlist, including after a timeout. List playlists before retrying an ambiguous failure. Official series settings are not exposed by YouTube's public API and must be enabled manually in YouTube's desktop playlist settings.

Parameters:

  • account_id (String)
  • create_youtube_playlist_request (CreateYoutubePlaylistRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1111
1112
1113
1114
# File 'lib/zernio-sdk/api/connect_api.rb', line 1111

def create_youtube_playlist(, create_youtube_playlist_request, opts = {})
  data, _status_code, _headers = create_youtube_playlist_with_http_info(, create_youtube_playlist_request, opts)
  data
end

#create_youtube_playlist_with_http_info(account_id, create_youtube_playlist_request, opts = {}) ⇒ Array<(CreateYoutubePlaylist201Response, Integer, Hash)>

Create YouTube playlist Creates an empty playlist on the connected YouTube channel. Requires a title; privacy defaults to private. Returns the same playlist shape as the list endpoint. Pass the returned playlist.id as platformSpecificData.playlistId when publishing a video. Does not change the account's default playlist. Requires the youtube or youtube.force-ssl OAuth scope. Costs 50 YouTube quota units. This operation is not idempotent and is not automatically retried: repeating a request can create another playlist, including after a timeout. List playlists before retrying an ambiguous failure. Official series settings are not exposed by YouTube's public API and must be enabled manually in YouTube's desktop playlist settings.

Parameters:

  • account_id (String)
  • create_youtube_playlist_request (CreateYoutubePlaylistRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
# File 'lib/zernio-sdk/api/connect_api.rb', line 1122

def create_youtube_playlist_with_http_info(, create_youtube_playlist_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectApi.create_youtube_playlist ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling ConnectApi.create_youtube_playlist"
  end
  # verify the required parameter 'create_youtube_playlist_request' is set
  if @api_client.config.client_side_validation && create_youtube_playlist_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_youtube_playlist_request' when calling ConnectApi.create_youtube_playlist"
  end
  # resource path
  local_var_path = '/v1/accounts/{accountId}/youtube-playlists'.sub('{' + 'accountId' + '}', CGI.escape(.to_s))

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

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

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

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

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

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

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

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

#get_connect_url(platform, profile_id, opts = {}) ⇒ GetConnectUrl200Response

Get OAuth connect URL Initiate an OAuth connection flow. Returns an authUrl to redirect the user to. Standard flow: Zernio hosts the selection UI, then redirects to your redirect_url. Headless mode (headless=true): user is redirected to your redirect_url with OAuth data for custom UI. Use the platform-specific selection endpoints to complete. TikTok: every connection now goes through the TikTok for Business app. One TikTok account per profile, so connecting on a profile that already holds one replaces it. Reconnecting the SAME account keeps it and all of its history; authorizing a DIFFERENT TikTok account takes the slot over and permanently deletes the previous account's analytics, inbox and DM history. The two are told apart by the @handle stored at the last connect, so an account whose handle has been renamed on TikTok since then reads as a different account. An authorization that leaves out a permission the connected account needs changes nothing at all and comes back as missing_tiktok_permissions; connect again and accept every permission on TikTok's screen.

Parameters:

  • platform (String)

    Social media platform to connect. `snapchat` is a closed beta with no public release date: it returns 403 `PLATFORM_BETA_RESTRICTED` until the account is approved.

  • profile_id (String)

    Your Zernio profile ID (get from /v1/profiles). For WhatsApp, a Zernio-provisioned number can only be connected on the profile it was provisioned to; connecting from any other profile is rejected with a 409.

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

    the optional parameters

Options Hash (opts):

  • :redirect_url (String)

    Your custom redirect URL after connection completes. MUST be an absolute http(s) URL or a custom app scheme for mobile deeplinks (e.g. myapp://callback); a relative path is rejected with 400 INVALID_REDIRECT_URL. Result params are appended with the URL API, so an existing query string is preserved. Standard mode appends connected=platform&profileId=X&accountId=Y&username=Z. Headless mode appends OAuth data params for platforms requiring selection (e.g. LinkedIn orgs, Facebook pages). If no selection is needed, the account is created directly and the redirect includes accountId. On failure, the browser is sent to the same redirect_url with `error` and `platform` appended. `error` and `platform` are always present. `error_message`, `is_user_fixable`, `reason` and `dashboard_url` are conditional and must be treated as optional. This list is NOT exhaustive and new values may be added at any time. Treat an unrecognized value as a generic failure rather than matching it exhaustively. Existing values are not renamed or removed without notice. OAuth and callback: oauth_denied, invalid_callback, invalid_state, unsupported_platform, connection_failed, internal_error, token_exchange_failed, byok_config_error, personal_account_not_supported, missing_google_permissions, missing_tiktok_permissions, platform_requires_destination, reconnect_account_mismatch, invalid_request Access and limits: profile_not_found, invalid_profile_id, access_denied, account_limit_exceeded, profile_limit_exceeded, payment_required Destination selection: no_facebook_pages, facebook_pages_error, no_google_locations, google_locations_error, google_permission_denied, no_snapchat_public_profiles, snapchat_profiles_error, discord_no_guild, slack_no_team WhatsApp: whatsapp_error, one_whatsapp_per_profile, whatsapp_number_already_connected, whatsapp_number_pinned_to_profile, whatsapp_coexistence_not_registered, connection_cancelled Google Ads (platform=googleads): google_ads_auth_failed, google_ads_invalid_state, google_ads_config_error, google_ads_token_failed, google_ads_quota_exhausted, google_ads_callback_error TikTok Ads (platform=tiktokads): tiktok_ads_auth_failed, tiktok_ads_invalid_state, tiktok_ads_access_denied, tiktok_ads_config_error, tiktok_ads_token_failed, tiktok_ads_account_not_found, tiktok_ads_callback_error X Ads (platform=xads): x_ads_denied, x_ads_auth_failed, x_ads_config_error, x_ads_account_not_found, x_ads_state_error, x_ads_token_failed, x_ads_token_missing, x_ads_callback_error Shopify (platform=shopify): shopify_auth_failed, shopify_config_error, shopify_invalid_state, shopify_invalid_hmac, shopify_invalid_shop, shopify_missing_scopes, shopify_callback_error 1. On this endpoint every upstream OAuth error is collapsed into `oauth_denied`. The provider's own value (for example Meta's `access_denied`) is not forwarded. The dedicated ads flows below are different: they use their own denial slugs and `google_ads_auth_failed` and `tiktok_ads_auth_failed` may carry the provider's raw error string in `error_message`. 2. On the tiktok and twitter ads flows `platform` carries the ads platform id (`tiktokads`, `xads`), not the value used in the request path. The googleads and shopify flows report `googleads` and `shopify`. 3. `missing_tiktok_permissions` means the TikTok authorization left out a permission the already-connected account needs, so nothing was changed and it keeps working as before. It is user-fixable: connect again and accept every permission on TikTok's screen.

  • :headless (Boolean)

    When true, the user is redirected to your redirect_url with raw OAuth data (code, state) instead of Zernio's default account selection UI. Use this to build a custom connect experience. (default to false)

  • :login_method (String)

    Instagram only. Which of the two Instagram connection methods to use. Ignored for every other platform. `instagram_login` (the default, and what you get if you omit this): the Instagram Login dialog. The user authorizes their Instagram professional account directly, no Facebook Page required. `facebook_login`: the Facebook Login dialog, i.e. &quot;Instagram API with Facebook Login&quot;. The user authorizes a Facebook Page that has a linked Instagram professional account, and every API call for that account then runs through the Page. Use this when the customer manages Instagram through a Page and expects the Facebook consent screen. Because the user has to pick which Page to connect, the callback continues at the account-selection step, `/v1/connect/instagram/select-account`. `facebook_login` supports `headless=true` like the other selection platforms: the callback redirects to your `redirect_url` with `profileId`, `tempToken`, `platform=instagram`, `step=select_account` and `connect_token`, which you pass into the select-account endpoints to finish. The default `instagram_login` has no selection step, so it connects the account directly. (default to 'instagram_login')

  • :onboarding (String)

    WhatsApp only. Ignored for every other platform. Controls which screen Meta's Embedded Signup popup shows. If omitted, the connection defaults to coexistence (same as `business_app` below), preserving existing behavior for numbers already on the WhatsApp Business app. `api`: standard Embedded Signup, showing Meta's WABA/number picker. Use this to connect a phone number already on Cloud API elsewhere. `business_app`: coexistence, i.e. 'Connect existing WhatsApp Business app' (a number shared between Cloud API and the consumer WhatsApp Business app).

  • :signup (String)

    WhatsApp only. Rejected with 400 `INVALID_FIELD_VALUE` on any other platform. `hosted`: `authUrl` points at a Zernio-hosted page on zernio.com instead of Meta's OAuth dialog, and the response carries `authUrl` only (no `state`). That page opens Meta's Embedded Signup popup itself, so it learns which WhatsApp Business Account and number the user picked inside the popup and connects exactly that one. Use it when your users' Facebook logins manage several WhatsApp accounts: on the default redirect flow Meta only returns an authorization code, so when that login can see more than one number the user lands on Zernio's number picker and has to choose again. Nothing to embed on your side and no domain setup: send the user to `authUrl`, and they come back to `redirect_url` with the same params as the redirect flow. Success: `connected=whatsapp`, `profileId`, `accountId`, `username` (plus `connect_token` for API-key callers). Failure: `error` and `platform=whatsapp`, with the same values and extras as the redirect flow (`one_whatsapp_per_profile`, `whatsapp_number_already_connected`, `whatsapp_number_pinned_to_profile` and `whatsapp_coexistence_not_registered` with `is_user_fixable=true`; `payment_required` with `reason` and `dashboard_url`; `whatsapp_error` with `error_message` when Meta reported one), plus two of its own: `connection_cancelled` when the popup was closed before finishing (`error_message` carries Meta's last reported step or error when there is one) and `session_expired` when the user took longer than the 60 minute window the hosted page is valid for; restart the flow with a new call in that case. `onboarding` is carried through and a pre-verified Zernio-provisioned number is attached like on the redirect flow. `headless` has no effect here because there is no selection step left to hand you. When a previously disconnected account for this profile can simply be re-enabled, this endpoint re-enables it and returns the account directly instead of a URL, exactly like the redirect flow. The page shows the same guidance as the Zernio dashboard: a pre-verified Zernio-provisioned number is called out by name (&quot;choose it in Meta's list, no code will be asked&quot;), coexistence and standard signups get their explainer video, and a step-by-step follow-along checklist stays visible while Meta's popup is open. Skin it with `brandName`, `primaryColor` and `language` below.

  • :brand_name (String)

    Hosted signup page only (`signup=hosted`, WhatsApp): name shown in the page title (&quot;Connect your WhatsApp number to <brandName>&quot;) instead of Zernio. The Zernio logo stays: the page is co-branded, not white-label. Trimmed; 1 to 60 characters. Rejected with 400 `INVALID_FIELD_VALUE` without `signup=hosted`. Stored on the signup session at issue time, so the page URL cannot change it.

  • :primary_color (String)

    Hosted signup page only (`signup=hosted`, WhatsApp): hex colour (`#RRGGBB`) for the primary button and step accents. Validated server-side; anything else is a 400 `INVALID_FIELD_VALUE`. Rejected without `signup=hosted`.

  • :language (String)

    Hosted signup page only (`signup=hosted`, WhatsApp): language of the page and its follow-along guide. Explainer videos stay in English. Default `en`. Rejected without `signup=hosted`.

Returns:



1193
1194
1195
1196
# File 'lib/zernio-sdk/api/connect_api.rb', line 1193

def get_connect_url(platform, profile_id, opts = {})
  data, _status_code, _headers = get_connect_url_with_http_info(platform, profile_id, opts)
  data
end

#get_connect_url_with_http_info(platform, profile_id, opts = {}) ⇒ Array<(GetConnectUrl200Response, Integer, Hash)>

Get OAuth connect URL Initiate an OAuth connection flow. Returns an authUrl to redirect the user to. Standard flow: Zernio hosts the selection UI, then redirects to your redirect_url. Headless mode (headless=true): user is redirected to your redirect_url with OAuth data for custom UI. Use the platform-specific selection endpoints to complete. TikTok: every connection now goes through the TikTok for Business app. One TikTok account per profile, so connecting on a profile that already holds one replaces it. Reconnecting the SAME account keeps it and all of its history; authorizing a DIFFERENT TikTok account takes the slot over and permanently deletes the previous account's analytics, inbox and DM history. The two are told apart by the `@handle` stored at the last connect, so an account whose handle has been renamed on TikTok since then reads as a different account. An authorization that leaves out a permission the connected account needs changes nothing at all and comes back as `missing_tiktok_permissions`; connect again and accept every permission on TikTok's screen.

Parameters:

  • platform (String)

    Social media platform to connect. `snapchat` is a closed beta with no public release date: it returns 403 `PLATFORM_BETA_RESTRICTED` until the account is approved.

  • profile_id (String)

    Your Zernio profile ID (get from /v1/profiles). For WhatsApp, a Zernio-provisioned number can only be connected on the profile it was provisioned to; connecting from any other profile is rejected with a 409.

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

    the optional parameters

Options Hash (opts):

  • :redirect_url (String)

    Your custom redirect URL after connection completes. MUST be an absolute http(s) URL or a custom app scheme for mobile deeplinks (e.g. myapp://callback); a relative path is rejected with 400 INVALID_REDIRECT_URL. Result params are appended with the URL API, so an existing query string is preserved. Standard mode appends connected=platform&profileId=X&accountId=Y&username=Z. Headless mode appends OAuth data params for platforms requiring selection (e.g. LinkedIn orgs, Facebook pages). If no selection is needed, the account is created directly and the redirect includes accountId. On failure, the browser is sent to the same redirect_url with `error` and `platform` appended. `error` and `platform` are always present. `error_message`, `is_user_fixable`, `reason` and `dashboard_url` are conditional and must be treated as optional. This list is NOT exhaustive and new values may be added at any time. Treat an unrecognized value as a generic failure rather than matching it exhaustively. Existing values are not renamed or removed without notice. OAuth and callback: oauth_denied, invalid_callback, invalid_state, unsupported_platform, connection_failed, internal_error, token_exchange_failed, byok_config_error, personal_account_not_supported, missing_google_permissions, missing_tiktok_permissions, platform_requires_destination, reconnect_account_mismatch, invalid_request Access and limits: profile_not_found, invalid_profile_id, access_denied, account_limit_exceeded, profile_limit_exceeded, payment_required Destination selection: no_facebook_pages, facebook_pages_error, no_google_locations, google_locations_error, google_permission_denied, no_snapchat_public_profiles, snapchat_profiles_error, discord_no_guild, slack_no_team WhatsApp: whatsapp_error, one_whatsapp_per_profile, whatsapp_number_already_connected, whatsapp_number_pinned_to_profile, whatsapp_coexistence_not_registered, connection_cancelled Google Ads (platform=googleads): google_ads_auth_failed, google_ads_invalid_state, google_ads_config_error, google_ads_token_failed, google_ads_quota_exhausted, google_ads_callback_error TikTok Ads (platform=tiktokads): tiktok_ads_auth_failed, tiktok_ads_invalid_state, tiktok_ads_access_denied, tiktok_ads_config_error, tiktok_ads_token_failed, tiktok_ads_account_not_found, tiktok_ads_callback_error X Ads (platform=xads): x_ads_denied, x_ads_auth_failed, x_ads_config_error, x_ads_account_not_found, x_ads_state_error, x_ads_token_failed, x_ads_token_missing, x_ads_callback_error Shopify (platform=shopify): shopify_auth_failed, shopify_config_error, shopify_invalid_state, shopify_invalid_hmac, shopify_invalid_shop, shopify_missing_scopes, shopify_callback_error 1. On this endpoint every upstream OAuth error is collapsed into `oauth_denied`. The provider's own value (for example Meta's `access_denied`) is not forwarded. The dedicated ads flows below are different: they use their own denial slugs and `google_ads_auth_failed` and `tiktok_ads_auth_failed` may carry the provider's raw error string in `error_message`. 2. On the tiktok and twitter ads flows `platform` carries the ads platform id (`tiktokads`, `xads`), not the value used in the request path. The googleads and shopify flows report `googleads` and `shopify`. 3. `missing_tiktok_permissions` means the TikTok authorization left out a permission the already-connected account needs, so nothing was changed and it keeps working as before. It is user-fixable: connect again and accept every permission on TikTok's screen.

  • :headless (Boolean)

    When true, the user is redirected to your redirect_url with raw OAuth data (code, state) instead of Zernio's default account selection UI. Use this to build a custom connect experience. (default to false)

  • :login_method (String)

    Instagram only. Which of the two Instagram connection methods to use. Ignored for every other platform. `instagram_login` (the default, and what you get if you omit this): the Instagram Login dialog. The user authorizes their Instagram professional account directly, no Facebook Page required. `facebook_login`: the Facebook Login dialog, i.e. &quot;Instagram API with Facebook Login&quot;. The user authorizes a Facebook Page that has a linked Instagram professional account, and every API call for that account then runs through the Page. Use this when the customer manages Instagram through a Page and expects the Facebook consent screen. Because the user has to pick which Page to connect, the callback continues at the account-selection step, `/v1/connect/instagram/select-account`. `facebook_login` supports `headless=true` like the other selection platforms: the callback redirects to your `redirect_url` with `profileId`, `tempToken`, `platform=instagram`, `step=select_account` and `connect_token`, which you pass into the select-account endpoints to finish. The default `instagram_login` has no selection step, so it connects the account directly. (default to 'instagram_login')

  • :onboarding (String)

    WhatsApp only. Ignored for every other platform. Controls which screen Meta's Embedded Signup popup shows. If omitted, the connection defaults to coexistence (same as `business_app` below), preserving existing behavior for numbers already on the WhatsApp Business app. `api`: standard Embedded Signup, showing Meta's WABA/number picker. Use this to connect a phone number already on Cloud API elsewhere. `business_app`: coexistence, i.e. 'Connect existing WhatsApp Business app' (a number shared between Cloud API and the consumer WhatsApp Business app).

  • :signup (String)

    WhatsApp only. Rejected with 400 `INVALID_FIELD_VALUE` on any other platform. `hosted`: `authUrl` points at a Zernio-hosted page on zernio.com instead of Meta's OAuth dialog, and the response carries `authUrl` only (no `state`). That page opens Meta's Embedded Signup popup itself, so it learns which WhatsApp Business Account and number the user picked inside the popup and connects exactly that one. Use it when your users' Facebook logins manage several WhatsApp accounts: on the default redirect flow Meta only returns an authorization code, so when that login can see more than one number the user lands on Zernio's number picker and has to choose again. Nothing to embed on your side and no domain setup: send the user to `authUrl`, and they come back to `redirect_url` with the same params as the redirect flow. Success: `connected=whatsapp`, `profileId`, `accountId`, `username` (plus `connect_token` for API-key callers). Failure: `error` and `platform=whatsapp`, with the same values and extras as the redirect flow (`one_whatsapp_per_profile`, `whatsapp_number_already_connected`, `whatsapp_number_pinned_to_profile` and `whatsapp_coexistence_not_registered` with `is_user_fixable=true`; `payment_required` with `reason` and `dashboard_url`; `whatsapp_error` with `error_message` when Meta reported one), plus two of its own: `connection_cancelled` when the popup was closed before finishing (`error_message` carries Meta's last reported step or error when there is one) and `session_expired` when the user took longer than the 60 minute window the hosted page is valid for; restart the flow with a new call in that case. `onboarding` is carried through and a pre-verified Zernio-provisioned number is attached like on the redirect flow. `headless` has no effect here because there is no selection step left to hand you. When a previously disconnected account for this profile can simply be re-enabled, this endpoint re-enables it and returns the account directly instead of a URL, exactly like the redirect flow. The page shows the same guidance as the Zernio dashboard: a pre-verified Zernio-provisioned number is called out by name (&quot;choose it in Meta's list, no code will be asked&quot;), coexistence and standard signups get their explainer video, and a step-by-step follow-along checklist stays visible while Meta's popup is open. Skin it with `brandName`, `primaryColor` and `language` below.

  • :brand_name (String)

    Hosted signup page only (`signup=hosted`, WhatsApp): name shown in the page title (&quot;Connect your WhatsApp number to <brandName>&quot;) instead of Zernio. The Zernio logo stays: the page is co-branded, not white-label. Trimmed; 1 to 60 characters. Rejected with 400 `INVALID_FIELD_VALUE` without `signup=hosted`. Stored on the signup session at issue time, so the page URL cannot change it.

  • :primary_color (String)

    Hosted signup page only (`signup=hosted`, WhatsApp): hex colour (`#RRGGBB`) for the primary button and step accents. Validated server-side; anything else is a 400 `INVALID_FIELD_VALUE`. Rejected without `signup=hosted`.

  • :language (String)

    Hosted signup page only (`signup=hosted`, WhatsApp): language of the page and its follow-along guide. Explainer videos stay in English. Default `en`. Rejected without `signup=hosted`.

Returns:

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

    GetConnectUrl200Response data, response status code and response headers



1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
# File 'lib/zernio-sdk/api/connect_api.rb', line 1212

def get_connect_url_with_http_info(platform, profile_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectApi.get_connect_url ...'
  end
  # verify the required parameter 'platform' is set
  if @api_client.config.client_side_validation && platform.nil?
    fail ArgumentError, "Missing the required parameter 'platform' when calling ConnectApi.get_connect_url"
  end
  # verify enum value
  allowable_values = ["facebook", "instagram", "linkedin", "twitter", "tiktok", "youtube", "threads", "reddit", "pinterest", "bluesky", "googlebusiness", "telegram", "snapchat", "discord", "slack", "whatsapp"]
  if @api_client.config.client_side_validation && !allowable_values.include?(platform)
    fail ArgumentError, "invalid value for \"platform\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'profile_id' is set
  if @api_client.config.client_side_validation && profile_id.nil?
    fail ArgumentError, "Missing the required parameter 'profile_id' when calling ConnectApi.get_connect_url"
  end
  allowable_values = ["instagram_login", "facebook_login"]
  if @api_client.config.client_side_validation && opts[:'login_method'] && !allowable_values.include?(opts[:'login_method'])
    fail ArgumentError, "invalid value for \"login_method\", must be one of #{allowable_values}"
  end
  allowable_values = ["api", "business_app"]
  if @api_client.config.client_side_validation && opts[:'onboarding'] && !allowable_values.include?(opts[:'onboarding'])
    fail ArgumentError, "invalid value for \"onboarding\", must be one of #{allowable_values}"
  end
  allowable_values = ["hosted"]
  if @api_client.config.client_side_validation && opts[:'signup'] && !allowable_values.include?(opts[:'signup'])
    fail ArgumentError, "invalid value for \"signup\", must be one of #{allowable_values}"
  end
  if @api_client.config.client_side_validation && !opts[:'brand_name'].nil? && opts[:'brand_name'].to_s.length > 60
    fail ArgumentError, 'invalid value for "opts[:"brand_name"]" when calling ConnectApi.get_connect_url, the character length must be smaller than or equal to 60.'
  end

  if @api_client.config.client_side_validation && !opts[:'brand_name'].nil? && opts[:'brand_name'].to_s.length < 1
    fail ArgumentError, 'invalid value for "opts[:"brand_name"]" when calling ConnectApi.get_connect_url, the character length must be greater than or equal to 1.'
  end

  pattern = Regexp.new(/^#[0-9a-fA-F]{6}$/)
  if @api_client.config.client_side_validation && !opts[:'primary_color'].nil? && opts[:'primary_color'] !~ pattern
    fail ArgumentError, "invalid value for 'opts[:\"primary_color\"]' when calling ConnectApi.get_connect_url, must conform to the pattern #{pattern}."
  end

  allowable_values = ["en", "es"]
  if @api_client.config.client_side_validation && opts[:'language'] && !allowable_values.include?(opts[:'language'])
    fail ArgumentError, "invalid value for \"language\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/v1/connect/{platform}'.sub('{' + 'platform' + '}', CGI.escape(platform.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'profileId'] = profile_id
  query_params[:'redirect_url'] = opts[:'redirect_url'] if !opts[:'redirect_url'].nil?
  query_params[:'headless'] = opts[:'headless'] if !opts[:'headless'].nil?
  query_params[:'loginMethod'] = opts[:'login_method'] if !opts[:'login_method'].nil?
  query_params[:'onboarding'] = opts[:'onboarding'] if !opts[:'onboarding'].nil?
  query_params[:'signup'] = opts[:'signup'] if !opts[:'signup'].nil?
  query_params[:'brandName'] = opts[:'brand_name'] if !opts[:'brand_name'].nil?
  query_params[:'primaryColor'] = opts[:'primary_color'] if !opts[:'primary_color'].nil?
  query_params[:'language'] = opts[:'language'] if !opts[:'language'].nil?

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

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

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

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

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

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

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

#get_facebook_pages(account_id, opts = {}) ⇒ GetFacebookPages200Response

List Facebook pages Returns all Facebook pages the connected account has access to, including the currently selected page.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :refresh (Boolean)

    When true, bypasses the page cache and fetches fresh pages from Meta. Rate-limited server-side to 1 refresh per 60s. Pages no longer accessible to the connected account will be removed from the list on refresh.

Returns:



1313
1314
1315
1316
# File 'lib/zernio-sdk/api/connect_api.rb', line 1313

def get_facebook_pages(, opts = {})
  data, _status_code, _headers = get_facebook_pages_with_http_info(, opts)
  data
end

#get_facebook_pages_with_http_info(account_id, opts = {}) ⇒ Array<(GetFacebookPages200Response, Integer, Hash)>

List Facebook pages Returns all Facebook pages the connected account has access to, including the currently selected page.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :refresh (Boolean)

    When true, bypasses the page cache and fetches fresh pages from Meta. Rate-limited server-side to 1 refresh per 60s. Pages no longer accessible to the connected account will be removed from the list on refresh.

Returns:

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

    GetFacebookPages200Response data, response status code and response headers



1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
# File 'lib/zernio-sdk/api/connect_api.rb', line 1324

def get_facebook_pages_with_http_info(, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectApi.get_facebook_pages ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling ConnectApi.get_facebook_pages"
  end
  # resource path
  local_var_path = '/v1/accounts/{accountId}/facebook-page'.sub('{' + 'accountId' + '}', CGI.escape(.to_s))

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

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

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

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

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

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

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

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

#get_gmb_locations(account_id, opts = {}) ⇒ GetGmbLocations200Response

List Google Business Profile locations Returns Google Business Profile locations the connected account can access, plus the currently selected location. The list is bounded (see hasMore); for accounts that own many locations, use the search or filter query params to find a specific one instead of loading them all, or raise limit to enumerate an account with more than 100 locations.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :search (String)

    Free-text search on the business name, applied server-side by Google. Use for accounts with many locations.

  • :filter (String)

    Raw Google Business Information API filter expression (advanced; takes precedence over search), e.g. storeCode=&quot;LH279411&quot;.

  • :limit (Integer)

    Max locations to return (default 100, max 500). Raise it to enumerate an account with more than 100 locations; for accounts with thousands, use search/filter instead. (default to 100)

Returns:



1381
1382
1383
1384
# File 'lib/zernio-sdk/api/connect_api.rb', line 1381

def get_gmb_locations(, opts = {})
  data, _status_code, _headers = get_gmb_locations_with_http_info(, opts)
  data
end

#get_gmb_locations_with_http_info(account_id, opts = {}) ⇒ Array<(GetGmbLocations200Response, Integer, Hash)>

List Google Business Profile locations Returns Google Business Profile locations the connected account can access, plus the currently selected location. The list is bounded (see hasMore); for accounts that own many locations, use the search or filter query params to find a specific one instead of loading them all, or raise limit to enumerate an account with more than 100 locations.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :search (String)

    Free-text search on the business name, applied server-side by Google. Use for accounts with many locations.

  • :filter (String)

    Raw Google Business Information API filter expression (advanced; takes precedence over search), e.g. storeCode=&quot;LH279411&quot;.

  • :limit (Integer)

    Max locations to return (default 100, max 500). Raise it to enumerate an account with more than 100 locations; for accounts with thousands, use search/filter instead. (default to 100)

Returns:

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

    GetGmbLocations200Response data, response status code and response headers



1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
# File 'lib/zernio-sdk/api/connect_api.rb', line 1394

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

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

  # resource path
  local_var_path = '/v1/accounts/{accountId}/gmb-locations'.sub('{' + 'accountId' + '}', CGI.escape(.to_s))

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

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

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

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

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

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

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

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

#get_linked_in_organizations(account_id, opts = {}) ⇒ GetLinkedInOrganizations200Response

List LinkedIn orgs Returns LinkedIn organizations (company pages) the connected account has admin access to.

Parameters:

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

    the optional parameters

Returns:



1458
1459
1460
1461
# File 'lib/zernio-sdk/api/connect_api.rb', line 1458

def get_linked_in_organizations(, opts = {})
  data, _status_code, _headers = get_linked_in_organizations_with_http_info(, opts)
  data
end

#get_linked_in_organizations_with_http_info(account_id, opts = {}) ⇒ Array<(GetLinkedInOrganizations200Response, Integer, Hash)>

List LinkedIn orgs Returns LinkedIn organizations (company pages) the connected account has admin access to.

Parameters:

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

    the optional parameters

Returns:



1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
# File 'lib/zernio-sdk/api/connect_api.rb', line 1468

def get_linked_in_organizations_with_http_info(, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectApi.get_linked_in_organizations ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling ConnectApi.get_linked_in_organizations"
  end
  # resource path
  local_var_path = '/v1/accounts/{accountId}/linkedin-organizations'.sub('{' + 'accountId' + '}', CGI.escape(.to_s))

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

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

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

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

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

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

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

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

#get_page_webhook_subscription(account_id, opts = {}) ⇒ GetPageWebhookSubscription200Response

Read a Facebook Page's webhook subscription Returns the webhook fields Zernio's app is subscribed to on the connected Page, read live from Meta. Use it to confirm leadgen is present: a Page missing it keeps delivering every other event while lead ads stop arriving, with nothing to indicate it.

Parameters:

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

    the optional parameters

Returns:



1521
1522
1523
1524
# File 'lib/zernio-sdk/api/connect_api.rb', line 1521

def get_page_webhook_subscription(, opts = {})
  data, _status_code, _headers = get_page_webhook_subscription_with_http_info(, opts)
  data
end

#get_page_webhook_subscription_with_http_info(account_id, opts = {}) ⇒ Array<(GetPageWebhookSubscription200Response, Integer, Hash)>

Read a Facebook Page's webhook subscription Returns the webhook fields Zernio's app is subscribed to on the connected Page, read live from Meta. Use it to confirm `leadgen` is present: a Page missing it keeps delivering every other event while lead ads stop arriving, with nothing to indicate it.

Parameters:

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

    the optional parameters

Returns:



1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
# File 'lib/zernio-sdk/api/connect_api.rb', line 1531

def get_page_webhook_subscription_with_http_info(, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectApi.get_page_webhook_subscription ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling ConnectApi.get_page_webhook_subscription"
  end
  # resource path
  local_var_path = '/v1/accounts/{accountId}/webhook-subscription'.sub('{' + 'accountId' + '}', CGI.escape(.to_s))

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

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

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

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

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

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

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

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

#get_pending_o_auth_data(token, opts = {}) ⇒ GetPendingOAuthData200Response

Get pending OAuth data Fetch pending OAuth data for headless mode using the pendingDataToken from the redirect URL. Scope: This endpoint is used for LinkedIn organizations, Google Business Profile locations, Slack channels, Snapchat profiles, and Pinterest boards, where the selection list is too large to fit in URL params. The redirect carries a pendingDataToken instead of the full payload; the response includes the corresponding selection array (e.g. boards for Pinterest). WhatsApp, Facebook and other platforms pass selection state directly via URL query params on the redirect (profileId, tempToken, step), no pending record is created, so this endpoint will return 404 for those flows. Use the platform-specific selection endpoint instead (e.g. /v1/connect/whatsapp/select-phone-number). Reading the token does not consume it, so this fetch is repeatable until the token expires 1 hour after issuance. Completing the platform selection deletes the pending record, so the token stops working from then on. No authentication required.

Parameters:

  • token (String)

    The pending data token from the OAuth redirect URL (pendingDataToken parameter)

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

    the optional parameters

Returns:



1584
1585
1586
1587
# File 'lib/zernio-sdk/api/connect_api.rb', line 1584

def get_pending_o_auth_data(token, opts = {})
  data, _status_code, _headers = get_pending_o_auth_data_with_http_info(token, opts)
  data
end

#get_pending_o_auth_data_with_http_info(token, opts = {}) ⇒ Array<(GetPendingOAuthData200Response, Integer, Hash)>

Get pending OAuth data Fetch pending OAuth data for headless mode using the pendingDataToken from the redirect URL. Scope: This endpoint is used for LinkedIn organizations, Google Business Profile locations, Slack channels, Snapchat profiles, and Pinterest boards, where the selection list is too large to fit in URL params. The redirect carries a `pendingDataToken` instead of the full payload; the response includes the corresponding selection array (e.g. `boards` for Pinterest). WhatsApp, Facebook and other platforms pass selection state directly via URL query params on the redirect (`profileId`, `tempToken`, `step`), no pending record is created, so this endpoint will return 404 for those flows. Use the platform-specific selection endpoint instead (e.g. `/v1/connect/whatsapp/select-phone-number`). Reading the token does not consume it, so this fetch is repeatable until the token expires 1 hour after issuance. Completing the platform selection deletes the pending record, so the token stops working from then on. No authentication required.

Parameters:

  • token (String)

    The pending data token from the OAuth redirect URL (pendingDataToken parameter)

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

    the optional parameters

Returns:



1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
# File 'lib/zernio-sdk/api/connect_api.rb', line 1594

def get_pending_o_auth_data_with_http_info(token, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectApi.get_pending_o_auth_data ...'
  end
  # verify the required parameter 'token' is set
  if @api_client.config.client_side_validation && token.nil?
    fail ArgumentError, "Missing the required parameter 'token' when calling ConnectApi.get_pending_o_auth_data"
  end
  # resource path
  local_var_path = '/v1/connect/pending-data'

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

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

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

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

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

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

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

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

#get_pinterest_boards(account_id, opts = {}) ⇒ GetPinterestBoards200Response

List Pinterest boards Returns the boards available for a connected Pinterest account. Use this to get a board ID when creating a Pinterest post.

Parameters:

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

    the optional parameters

Returns:



1648
1649
1650
1651
# File 'lib/zernio-sdk/api/connect_api.rb', line 1648

def get_pinterest_boards(, opts = {})
  data, _status_code, _headers = get_pinterest_boards_with_http_info(, opts)
  data
end

#get_pinterest_boards_with_http_info(account_id, opts = {}) ⇒ Array<(GetPinterestBoards200Response, Integer, Hash)>

List Pinterest boards Returns the boards available for a connected Pinterest account. Use this to get a board ID when creating a Pinterest post.

Parameters:

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

    the optional parameters

Returns:



1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
# File 'lib/zernio-sdk/api/connect_api.rb', line 1658

def get_pinterest_boards_with_http_info(, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectApi.get_pinterest_boards ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling ConnectApi.get_pinterest_boards"
  end
  # resource path
  local_var_path = '/v1/accounts/{accountId}/pinterest-boards'.sub('{' + 'accountId' + '}', CGI.escape(.to_s))

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

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

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

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

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

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

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

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

#get_reddit_flairs(account_id, subreddit, opts = {}) ⇒ GetRedditFlairs200Response

List subreddit flairs Returns available post flairs for a subreddit. Some subreddits require a flair when posting.

Parameters:

  • account_id (String)
  • subreddit (String)

    Subreddit name (without &quot;r/&quot; prefix) to fetch flairs for

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

    the optional parameters

Returns:



1712
1713
1714
1715
# File 'lib/zernio-sdk/api/connect_api.rb', line 1712

def get_reddit_flairs(, subreddit, opts = {})
  data, _status_code, _headers = get_reddit_flairs_with_http_info(, subreddit, opts)
  data
end

#get_reddit_flairs_with_http_info(account_id, subreddit, opts = {}) ⇒ Array<(GetRedditFlairs200Response, Integer, Hash)>

List subreddit flairs Returns available post flairs for a subreddit. Some subreddits require a flair when posting.

Parameters:

  • account_id (String)
  • subreddit (String)

    Subreddit name (without &quot;r/&quot; prefix) to fetch flairs for

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

    the optional parameters

Returns:

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

    GetRedditFlairs200Response data, response status code and response headers



1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
# File 'lib/zernio-sdk/api/connect_api.rb', line 1723

def get_reddit_flairs_with_http_info(, subreddit, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectApi.get_reddit_flairs ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling ConnectApi.get_reddit_flairs"
  end
  # verify the required parameter 'subreddit' is set
  if @api_client.config.client_side_validation && subreddit.nil?
    fail ArgumentError, "Missing the required parameter 'subreddit' when calling ConnectApi.get_reddit_flairs"
  end
  if @api_client.config.client_side_validation && subreddit.to_s.length < 1
    fail ArgumentError, 'invalid value for "subreddit" when calling ConnectApi.get_reddit_flairs, the character length must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/v1/accounts/{accountId}/reddit-flairs'.sub('{' + 'accountId' + '}', CGI.escape(.to_s))

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

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

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

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

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

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

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

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

#get_reddit_subreddits(account_id, opts = {}) ⇒ GetRedditSubreddits200Response

List Reddit subreddits Returns the subreddits the connected Reddit account can post to. Use this to get a subreddit name when creating a Reddit post.

Parameters:

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

    the optional parameters

Returns:



1785
1786
1787
1788
# File 'lib/zernio-sdk/api/connect_api.rb', line 1785

def get_reddit_subreddits(, opts = {})
  data, _status_code, _headers = get_reddit_subreddits_with_http_info(, opts)
  data
end

#get_reddit_subreddits_with_http_info(account_id, opts = {}) ⇒ Array<(GetRedditSubreddits200Response, Integer, Hash)>

List Reddit subreddits Returns the subreddits the connected Reddit account can post to. Use this to get a subreddit name when creating a Reddit post.

Parameters:

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

    the optional parameters

Returns:



1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
# File 'lib/zernio-sdk/api/connect_api.rb', line 1795

def get_reddit_subreddits_with_http_info(, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectApi.get_reddit_subreddits ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling ConnectApi.get_reddit_subreddits"
  end
  # resource path
  local_var_path = '/v1/accounts/{accountId}/reddit-subreddits'.sub('{' + 'accountId' + '}', CGI.escape(.to_s))

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

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

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

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

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

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

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

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

#get_shopify_connect_url(profile_id, shop, opts = {}) ⇒ GetConnectUrl200Response

Get Shopify OAuth connect URL Initiate the Shopify OAuth flow for a store. Shopify is a connect-only platform: the connected account does not publish social posts, it powers the Blogs API (/v1/accounts/{accountId}/blogs) and the Products API (/v1/accounts/{accountId}/products). Returns an authUrl to redirect the merchant to; after they approve the install, Shopify redirects their browser to Zernio's callback, the account is created on the profile (platform shopify), and the browser is redirected to redirect_url (or the Zernio dashboard when omitted). Requested scopes are read_content, write_content, read_products and write_products (content and products only; no customer or order data). Connecting the same profile to a store again refreshes the stored token in place, and is how a store connected under the older content-only grant picks up product access.

Parameters:

  • profile_id (String)

    Your Zernio profile ID (get from /v1/profiles).

  • shop (String)

    The myshopify.com store domain to connect, e.g. `your-store.myshopify.com` (the bare `your-store` prefix is accepted too).

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

    the optional parameters

Options Hash (opts):

  • :redirect_url (String)

    Your custom redirect URL after connection completes. MUST be an absolute http(s) URL or a custom app scheme for mobile deeplinks (e.g. myapp://callback); a relative path is rejected with 400 INVALID_REDIRECT_URL. On failure an `error` query param is appended.

Returns:



1850
1851
1852
1853
# File 'lib/zernio-sdk/api/connect_api.rb', line 1850

def get_shopify_connect_url(profile_id, shop, opts = {})
  data, _status_code, _headers = get_shopify_connect_url_with_http_info(profile_id, shop, opts)
  data
end

#get_shopify_connect_url_with_http_info(profile_id, shop, opts = {}) ⇒ Array<(GetConnectUrl200Response, Integer, Hash)>

Get Shopify OAuth connect URL Initiate the Shopify OAuth flow for a store. Shopify is a connect-only platform: the connected account does not publish social posts, it powers the Blogs API (`/v1/accounts/accountId/blogs`) and the Products API (`/v1/accounts/accountId/products`). Returns an `authUrl` to redirect the merchant to; after they approve the install, Shopify redirects their browser to Zernio's callback, the account is created on the profile (platform `shopify`), and the browser is redirected to `redirect_url` (or the Zernio dashboard when omitted). Requested scopes are `read_content`, `write_content`, `read_products` and `write_products` (content and products only; no customer or order data). Connecting the same profile to a store again refreshes the stored token in place, and is how a store connected under the older content-only grant picks up product access.

Parameters:

  • profile_id (String)

    Your Zernio profile ID (get from /v1/profiles).

  • shop (String)

    The myshopify.com store domain to connect, e.g. `your-store.myshopify.com` (the bare `your-store` prefix is accepted too).

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

    the optional parameters

Options Hash (opts):

  • :redirect_url (String)

    Your custom redirect URL after connection completes. MUST be an absolute http(s) URL or a custom app scheme for mobile deeplinks (e.g. myapp://callback); a relative path is rejected with 400 INVALID_REDIRECT_URL. On failure an `error` query param is appended.

Returns:

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

    GetConnectUrl200Response data, response status code and response headers



1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
# File 'lib/zernio-sdk/api/connect_api.rb', line 1862

def get_shopify_connect_url_with_http_info(profile_id, shop, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectApi.get_shopify_connect_url ...'
  end
  # verify the required parameter 'profile_id' is set
  if @api_client.config.client_side_validation && profile_id.nil?
    fail ArgumentError, "Missing the required parameter 'profile_id' when calling ConnectApi.get_shopify_connect_url"
  end
  # verify the required parameter 'shop' is set
  if @api_client.config.client_side_validation && shop.nil?
    fail ArgumentError, "Missing the required parameter 'shop' when calling ConnectApi.get_shopify_connect_url"
  end
  # resource path
  local_var_path = '/v1/connect/shopify'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'profileId'] = profile_id
  query_params[:'shop'] = shop
  query_params[:'redirect_url'] = opts[:'redirect_url'] if !opts[:'redirect_url'].nil?

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

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

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

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

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

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

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

#get_subreddit_rules(account_id, subreddit, opts = {}) ⇒ GetSubredditRules200Response

Get subreddit rules Returns a subreddit's posting rules plus Reddit's site-wide rules, so you can check them before submitting and avoid a removal. Use this alongside POST /v1/tools/validate/subreddit, which only confirms that a subreddit exists and reports its basic posting settings.

Parameters:

  • account_id (String)

    The ID of the Reddit account

  • subreddit (String)

    Subreddit name (without the &quot;r/&quot; prefix)

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

    the optional parameters

Returns:



1923
1924
1925
1926
# File 'lib/zernio-sdk/api/connect_api.rb', line 1923

def get_subreddit_rules(, subreddit, opts = {})
  data, _status_code, _headers = get_subreddit_rules_with_http_info(, subreddit, opts)
  data
end

#get_subreddit_rules_with_http_info(account_id, subreddit, opts = {}) ⇒ Array<(GetSubredditRules200Response, Integer, Hash)>

Get subreddit rules Returns a subreddit's posting rules plus Reddit's site-wide rules, so you can check them before submitting and avoid a removal. Use this alongside `POST /v1/tools/validate/subreddit`, which only confirms that a subreddit exists and reports its basic posting settings.

Parameters:

  • account_id (String)

    The ID of the Reddit account

  • subreddit (String)

    Subreddit name (without the &quot;r/&quot; prefix)

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

    the optional parameters

Returns:



1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
# File 'lib/zernio-sdk/api/connect_api.rb', line 1934

def get_subreddit_rules_with_http_info(, subreddit, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectApi.get_subreddit_rules ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling ConnectApi.get_subreddit_rules"
  end
  # verify the required parameter 'subreddit' is set
  if @api_client.config.client_side_validation && subreddit.nil?
    fail ArgumentError, "Missing the required parameter 'subreddit' when calling ConnectApi.get_subreddit_rules"
  end
  # resource path
  local_var_path = '/v1/accounts/{accountId}/reddit-subreddits/{subreddit}/rules'.sub('{' + 'accountId' + '}', CGI.escape(.to_s)).sub('{' + 'subreddit' + '}', CGI.escape(subreddit.to_s))

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

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

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

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

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

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

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

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

#get_telegram_connect_status(profile_id, opts = {}) ⇒ GetTelegramConnectStatus200Response

Generate Telegram code Generate an access code (valid 15 minutes) for connecting a Telegram channel or group. Add the bot as admin, then send the code + @yourchannel to the bot. Poll PATCH /v1/connect/telegram to check status.

Parameters:

  • profile_id (String)

    The profile ID to connect the Telegram account to

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

    the optional parameters

Returns:



1991
1992
1993
1994
# File 'lib/zernio-sdk/api/connect_api.rb', line 1991

def get_telegram_connect_status(profile_id, opts = {})
  data, _status_code, _headers = get_telegram_connect_status_with_http_info(profile_id, opts)
  data
end

#get_telegram_connect_status_with_http_info(profile_id, opts = {}) ⇒ Array<(GetTelegramConnectStatus200Response, Integer, Hash)>

Generate Telegram code Generate an access code (valid 15 minutes) for connecting a Telegram channel or group. Add the bot as admin, then send the code + @yourchannel to the bot. Poll PATCH /v1/connect/telegram to check status.

Parameters:

  • profile_id (String)

    The profile ID to connect the Telegram account to

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

    the optional parameters

Returns:



2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
# File 'lib/zernio-sdk/api/connect_api.rb', line 2001

def get_telegram_connect_status_with_http_info(profile_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectApi.get_telegram_connect_status ...'
  end
  # verify the required parameter 'profile_id' is set
  if @api_client.config.client_side_validation && profile_id.nil?
    fail ArgumentError, "Missing the required parameter 'profile_id' when calling ConnectApi.get_telegram_connect_status"
  end
  # resource path
  local_var_path = '/v1/connect/telegram'

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

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

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

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

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

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

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

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

#get_whats_app_sdk_config(opts = {}) ⇒ GetWhatsAppSdkConfig200Response

Get Embedded Signup SDK config The Meta app id and Embedded Signup configuration id the Zernio-hosted signup page uses to open Meta's popup. Integrators do not need this endpoint: start the hosted flow with GET /v1/connect/whatsapp?signup=hosted and send the user to the returned authUrl. Authenticates with an API key or with the connect token the hosted flow issues (X-Connect-Token header).

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :x_connect_token (String)

    Connect token issued by the hosted signup flow, accepted instead of an API key.

Returns:



2055
2056
2057
2058
# File 'lib/zernio-sdk/api/connect_api.rb', line 2055

def get_whats_app_sdk_config(opts = {})
  data, _status_code, _headers = get_whats_app_sdk_config_with_http_info(opts)
  data
end

#get_whats_app_sdk_config_with_http_info(opts = {}) ⇒ Array<(GetWhatsAppSdkConfig200Response, Integer, Hash)>

Get Embedded Signup SDK config The Meta app id and Embedded Signup configuration id the Zernio-hosted signup page uses to open Meta's popup. Integrators do not need this endpoint: start the hosted flow with `GET /v1/connect/whatsapp?signup=hosted` and send the user to the returned `authUrl`. Authenticates with an API key or with the connect token the hosted flow issues (`X-Connect-Token` header).

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :x_connect_token (String)

    Connect token issued by the hosted signup flow, accepted instead of an API key.

Returns:



2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
# File 'lib/zernio-sdk/api/connect_api.rb', line 2065

def get_whats_app_sdk_config_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectApi.get_whats_app_sdk_config ...'
  end
  # resource path
  local_var_path = '/v1/connect/whatsapp/sdk-config'

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

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  header_params[:'X-Connect-Token'] = opts[:'x_connect_token'] if !opts[:'x_connect_token'].nil?

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

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

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

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

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

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

#get_word_press_auth_url(profile_id, opts = {}) ⇒ GetWordPressAuthUrl200Response

Get WordPress.com OAuth connect URL Initiates OAuth for a WordPress.com site or a Jetpack-connected site. WordPress is a connect-only blog platform: the connected account powers the Blogs API (/v1/accounts/{accountId}/blogs) and does not support social posts, inbox, analytics, ads, or Shopify product operations. Redirect the user to authUrl; after authorization, WordPress returns the browser to Zernio's internal callback and Zernio redirects to redirect_url (or the dashboard when omitted). Reconnecting the same site and profile updates the stored connection in place. The consent request omits scope to use WordPress.com's default single-site grant. Granular scopes cannot access the /wp/v2 article API. Zernio checks that API before saving the connection and does not request explicit global authorization across all sites.

Parameters:

  • profile_id (String)

    Your Zernio profile ID (get from /v1/profiles).

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

    the optional parameters

Options Hash (opts):

  • :redirect_url (String)

    Custom redirect after connection. Must be an absolute http(s) URL or custom app scheme such as `myapp://callback`; relative and unsafe URLs return 400.

Returns:



2116
2117
2118
2119
# File 'lib/zernio-sdk/api/connect_api.rb', line 2116

def get_word_press_auth_url(profile_id, opts = {})
  data, _status_code, _headers = get_word_press_auth_url_with_http_info(profile_id, opts)
  data
end

#get_word_press_auth_url_with_http_info(profile_id, opts = {}) ⇒ Array<(GetWordPressAuthUrl200Response, Integer, Hash)>

Get WordPress.com OAuth connect URL Initiates OAuth for a WordPress.com site or a Jetpack-connected site. WordPress is a connect-only blog platform: the connected account powers the Blogs API (`/v1/accounts/accountId/blogs`) and does not support social posts, inbox, analytics, ads, or Shopify product operations. Redirect the user to `authUrl`; after authorization, WordPress returns the browser to Zernio's internal callback and Zernio redirects to `redirect_url` (or the dashboard when omitted). Reconnecting the same site and profile updates the stored connection in place. The consent request omits `scope` to use WordPress.com's default single-site grant. Granular scopes cannot access the `/wp/v2` article API. Zernio checks that API before saving the connection and does not request explicit `global` authorization across all sites.

Parameters:

  • profile_id (String)

    Your Zernio profile ID (get from /v1/profiles).

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

    the optional parameters

Options Hash (opts):

  • :redirect_url (String)

    Custom redirect after connection. Must be an absolute http(s) URL or custom app scheme such as `myapp://callback`; relative and unsafe URLs return 400.

Returns:



2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
# File 'lib/zernio-sdk/api/connect_api.rb', line 2127

def get_word_press_auth_url_with_http_info(profile_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectApi.get_word_press_auth_url ...'
  end
  # verify the required parameter 'profile_id' is set
  if @api_client.config.client_side_validation && profile_id.nil?
    fail ArgumentError, "Missing the required parameter 'profile_id' when calling ConnectApi.get_word_press_auth_url"
  end
  # resource path
  local_var_path = '/v1/connect/wordpress'

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

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

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

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

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

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

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

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

#get_youtube_captions(account_id, video_id, opts = {}) ⇒ GetYoutubeCaptions200Response

Get a YouTube video transcript Returns the caption track YouTube already holds for one of the connected channel's own videos, as plain text plus timed cues. Use it instead of downloading and transcribing the video yourself. Auto-generated (ASR) tracks are included: YouTube serves them to the channel owner, which is what the connected account is. Uploaded tracks win over auto-generated ones when both exist for a language. Caching: we store the transcript on first read and serve it from there afterwards, so you do not need to cache it yourself. A cached read costs no YouTube quota and does not call YouTube at all. source tells you which happened (youtube on the first read, cache after). Pass refresh=true only when the captions actually changed on YouTube, since that re-downloads. Notes: - Only videos owned by this connected channel. Anything else returns 404. - contentDetails.caption in YouTube's own API reads false on videos that DO have a serving auto-generated track, so it is not a usable availability signal. Call this endpoint and handle the 404. - YouTube generates auto-captions only for videos with recognisable speech, and can take a few hours after upload to publish them.

Parameters:

  • account_id (String)

    The connected YouTube account.

  • video_id (String)

    The YouTube video id (the `platformPostId` on a synced external post).

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

    the optional parameters

Options Hash (opts):

  • :language (String)

    BCP-47 language tag as YouTube labels the track. `en` also matches an `en-GB` track. Omit to take the best available track.

  • :format (String)

    `json` returns timed `cues`; `srt` returns the raw SubRip body instead. `text` is present either way. (default to 'json')

  • :refresh (Boolean)

    Re-download from YouTube instead of serving the stored copy. Spends 200 quota units. (default to false)

Returns:



2186
2187
2188
2189
# File 'lib/zernio-sdk/api/connect_api.rb', line 2186

def get_youtube_captions(, video_id, opts = {})
  data, _status_code, _headers = get_youtube_captions_with_http_info(, video_id, opts)
  data
end

#get_youtube_captions_with_http_info(account_id, video_id, opts = {}) ⇒ Array<(GetYoutubeCaptions200Response, Integer, Hash)>

Get a YouTube video transcript Returns the caption track YouTube already holds for one of the connected channel's own videos, as plain text plus timed cues. Use it instead of downloading and transcribing the video yourself. Auto-generated (ASR) tracks are included: YouTube serves them to the channel owner, which is what the connected account is. Uploaded tracks win over auto-generated ones when both exist for a language. Caching: we store the transcript on first read and serve it from there afterwards, so you do not need to cache it yourself. A cached read costs no YouTube quota and does not call YouTube at all. `source` tells you which happened (`youtube` on the first read, `cache` after). Pass `refresh=true` only when the captions actually changed on YouTube, since that re-downloads. Notes: - Only videos owned by this connected channel. Anything else returns 404. - `contentDetails.caption` in YouTube's own API reads `false` on videos that DO have a serving auto-generated track, so it is not a usable availability signal. Call this endpoint and handle the 404. - YouTube generates auto-captions only for videos with recognisable speech, and can take a few hours after upload to publish them.

Parameters:

  • account_id (String)

    The connected YouTube account.

  • video_id (String)

    The YouTube video id (the `platformPostId` on a synced external post).

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

    the optional parameters

Options Hash (opts):

  • :language (String)

    BCP-47 language tag as YouTube labels the track. `en` also matches an `en-GB` track. Omit to take the best available track.

  • :format (String)

    `json` returns timed `cues`; `srt` returns the raw SubRip body instead. `text` is present either way. (default to 'json')

  • :refresh (Boolean)

    Re-download from YouTube instead of serving the stored copy. Spends 200 quota units. (default to false)

Returns:



2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
# File 'lib/zernio-sdk/api/connect_api.rb', line 2200

def get_youtube_captions_with_http_info(, video_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectApi.get_youtube_captions ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling ConnectApi.get_youtube_captions"
  end
  # verify the required parameter 'video_id' is set
  if @api_client.config.client_side_validation && video_id.nil?
    fail ArgumentError, "Missing the required parameter 'video_id' when calling ConnectApi.get_youtube_captions"
  end
  allowable_values = ["json", "srt"]
  if @api_client.config.client_side_validation && opts[:'format'] && !allowable_values.include?(opts[:'format'])
    fail ArgumentError, "invalid value for \"format\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/v1/accounts/{accountId}/youtube-captions'.sub('{' + 'accountId' + '}', CGI.escape(.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'videoId'] = video_id
  query_params[:'language'] = opts[:'language'] if !opts[:'language'].nil?
  query_params[:'format'] = opts[:'format'] if !opts[:'format'].nil?
  query_params[:'refresh'] = opts[:'refresh'] if !opts[:'refresh'].nil?

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

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

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

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

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

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

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

#get_youtube_playlists(account_id, opts = {}) ⇒ GetYoutubePlaylists200Response

List YouTube playlists Returns the playlists available for a connected YouTube account. Use this to get a playlist ID when creating a YouTube post with the playlistId field.

Parameters:

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

    the optional parameters

Returns:



2265
2266
2267
2268
# File 'lib/zernio-sdk/api/connect_api.rb', line 2265

def get_youtube_playlists(, opts = {})
  data, _status_code, _headers = get_youtube_playlists_with_http_info(, opts)
  data
end

#get_youtube_playlists_with_http_info(account_id, opts = {}) ⇒ Array<(GetYoutubePlaylists200Response, Integer, Hash)>

List YouTube playlists Returns the playlists available for a connected YouTube account. Use this to get a playlist ID when creating a YouTube post with the playlistId field.

Parameters:

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

    the optional parameters

Returns:



2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
# File 'lib/zernio-sdk/api/connect_api.rb', line 2275

def get_youtube_playlists_with_http_info(, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectApi.get_youtube_playlists ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling ConnectApi.get_youtube_playlists"
  end
  # resource path
  local_var_path = '/v1/accounts/{accountId}/youtube-playlists'.sub('{' + 'accountId' + '}', CGI.escape(.to_s))

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

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

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

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

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

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

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

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

#handle_o_auth_callback(platform, handle_o_auth_callback_request, opts = {}) ⇒ nil

Complete OAuth callback Exchange the OAuth authorization code for tokens and connect the account to the specified profile. Facebook, Google Business Profile, Snapchat and WhatsApp are not accepted here: their account identity is a destination chosen after OAuth, which this single-shot exchange cannot do. Connect them through the redirect flow from GET /v1/connect/{platform}, or, for WhatsApp Embedded Signup, through POST /v1/connect/whatsapp/embedded-signup.

Parameters:

  • platform (String)

    Social platform to complete the connect for. Discord, Slack and Telegram are absent because they are served by their own dedicated routes, documented separately.

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

    the optional parameters

Returns:

  • (nil)


2329
2330
2331
2332
# File 'lib/zernio-sdk/api/connect_api.rb', line 2329

def handle_o_auth_callback(platform, handle_o_auth_callback_request, opts = {})
  handle_o_auth_callback_with_http_info(platform, handle_o_auth_callback_request, opts)
  nil
end

#handle_o_auth_callback_with_http_info(platform, handle_o_auth_callback_request, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Complete OAuth callback Exchange the OAuth authorization code for tokens and connect the account to the specified profile. Facebook, Google Business Profile, Snapchat and WhatsApp are not accepted here: their account identity is a destination chosen after OAuth, which this single-shot exchange cannot do. Connect them through the redirect flow from `GET /v1/connect/platform`, or, for WhatsApp Embedded Signup, through `POST /v1/connect/whatsapp/embedded-signup`.

Parameters:

  • platform (String)

    Social platform to complete the connect for. Discord, Slack and Telegram are absent because they are served by their own dedicated routes, documented separately.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
# File 'lib/zernio-sdk/api/connect_api.rb', line 2340

def handle_o_auth_callback_with_http_info(platform, handle_o_auth_callback_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectApi.handle_o_auth_callback ...'
  end
  # verify the required parameter 'platform' is set
  if @api_client.config.client_side_validation && platform.nil?
    fail ArgumentError, "Missing the required parameter 'platform' when calling ConnectApi.handle_o_auth_callback"
  end
  # verify enum value
  allowable_values = ["instagram", "twitter", "threads", "linkedin", "youtube", "tiktok", "reddit", "pinterest"]
  if @api_client.config.client_side_validation && !allowable_values.include?(platform)
    fail ArgumentError, "invalid value for \"platform\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'handle_o_auth_callback_request' is set
  if @api_client.config.client_side_validation && handle_o_auth_callback_request.nil?
    fail ArgumentError, "Missing the required parameter 'handle_o_auth_callback_request' when calling ConnectApi.handle_o_auth_callback"
  end
  # resource path
  local_var_path = '/v1/connect/{platform}'.sub('{' + 'platform' + '}', CGI.escape(platform.to_s))

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

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

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

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

  # return_type
  return_type = opts[:debug_return_type]

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

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

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

#initiate_telegram_connect(initiate_telegram_connect_request, opts = {}) ⇒ InitiateTelegramConnect200Response

Connect Telegram directly Connect a Telegram channel/group directly using the chat ID. Alternative to the access code flow. The bot must already be an admin in the channel/group.

Parameters:

Returns:



2407
2408
2409
2410
# File 'lib/zernio-sdk/api/connect_api.rb', line 2407

def initiate_telegram_connect(initiate_telegram_connect_request, opts = {})
  data, _status_code, _headers = initiate_telegram_connect_with_http_info(initiate_telegram_connect_request, opts)
  data
end

#initiate_telegram_connect_with_http_info(initiate_telegram_connect_request, opts = {}) ⇒ Array<(InitiateTelegramConnect200Response, Integer, Hash)>

Connect Telegram directly Connect a Telegram channel/group directly using the chat ID. Alternative to the access code flow. The bot must already be an admin in the channel/group.

Parameters:

Returns:



2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
# File 'lib/zernio-sdk/api/connect_api.rb', line 2417

def initiate_telegram_connect_with_http_info(initiate_telegram_connect_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectApi.initiate_telegram_connect ...'
  end
  # verify the required parameter 'initiate_telegram_connect_request' is set
  if @api_client.config.client_side_validation && initiate_telegram_connect_request.nil?
    fail ArgumentError, "Missing the required parameter 'initiate_telegram_connect_request' when calling ConnectApi.initiate_telegram_connect"
  end
  # resource path
  local_var_path = '/v1/connect/telegram'

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

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

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

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

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

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

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

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

#list_facebook_pages(opts = {}) ⇒ ListFacebookPages200Response

List Facebook pages 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.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :profile_id (String)

    Profile ID from your classic connection flow. Required with tempToken.

  • :temp_token (String)

    Temporary Facebook access token from the classic OAuth callback. Required with profileId.

  • :selection_token (String)

    Encrypted dashboard business-login grant. Send alone instead of profileId and tempToken. Expires after ten minutes.

Returns:



2477
2478
2479
2480
# File 'lib/zernio-sdk/api/connect_api.rb', line 2477

def list_facebook_pages(opts = {})
  data, _status_code, _headers = list_facebook_pages_with_http_info(opts)
  data
end

#list_facebook_pages_with_http_info(opts = {}) ⇒ Array<(ListFacebookPages200Response, Integer, Hash)>

List Facebook pages 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.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :profile_id (String)

    Profile ID from your classic connection flow. Required with tempToken.

  • :temp_token (String)

    Temporary Facebook access token from the classic OAuth callback. Required with profileId.

  • :selection_token (String)

    Encrypted dashboard business-login grant. Send alone instead of profileId and tempToken. Expires after ten minutes.

Returns:



2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
# File 'lib/zernio-sdk/api/connect_api.rb', line 2489

def list_facebook_pages_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectApi.list_facebook_pages ...'
  end
  # resource path
  local_var_path = '/v1/connect/facebook/select-page'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'profileId'] = opts[:'profile_id'] if !opts[:'profile_id'].nil?
  query_params[:'tempToken'] = opts[:'temp_token'] if !opts[:'temp_token'].nil?
  query_params[:'selectionToken'] = opts[:'selection_token'] if !opts[:'selection_token'].nil?

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

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

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

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

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

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

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

#list_google_business_locations(opts = {}) ⇒ ListGoogleBusinessLocations200Response

List Google Business Profile locations For headless flows. Returns the list of Google Business Profile locations the user can manage. Use pendingDataToken (from the OAuth callback redirect) to list locations without consuming the token, so it remains available for select-location. Use X-Connect-Token header if connecting via API key.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :profile_id (String)

    Profile ID from your connection flow. Required for auth validation when provided.

  • :pending_data_token (String)

    Token from the OAuth callback redirect. Preferred over tempToken because it preserves server-side token storage. One of pendingDataToken or tempToken is required.

  • :temp_token (String)

    Legacy. Direct Google access token. Use pendingDataToken instead when available.

  • :search (String)

    Free-text search on the business name, applied server-side by Google. Use this for accounts that own many locations (the response is bounded, see hasMore) so the user can find a specific location without loading the full list.

  • :filter (String)

    Raw Google Business Information API filter expression (advanced; takes precedence over search). Supports fields such as title, storeCode, storefront_address.postal_code, labels and categories, e.g. storeCode=&quot;LH279411&quot;. See Google's &quot;Work with location data&quot; guide.

Returns:



2545
2546
2547
2548
# File 'lib/zernio-sdk/api/connect_api.rb', line 2545

def list_google_business_locations(opts = {})
  data, _status_code, _headers = list_google_business_locations_with_http_info(opts)
  data
end

#list_google_business_locations_with_http_info(opts = {}) ⇒ Array<(ListGoogleBusinessLocations200Response, Integer, Hash)>

List Google Business Profile locations For headless flows. Returns the list of Google Business Profile locations the user can manage. Use pendingDataToken (from the OAuth callback redirect) to list locations without consuming the token, so it remains available for select-location. Use X-Connect-Token header if connecting via API key.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :profile_id (String)

    Profile ID from your connection flow. Required for auth validation when provided.

  • :pending_data_token (String)

    Token from the OAuth callback redirect. Preferred over tempToken because it preserves server-side token storage. One of pendingDataToken or tempToken is required.

  • :temp_token (String)

    Legacy. Direct Google access token. Use pendingDataToken instead when available.

  • :search (String)

    Free-text search on the business name, applied server-side by Google. Use this for accounts that own many locations (the response is bounded, see hasMore) so the user can find a specific location without loading the full list.

  • :filter (String)

    Raw Google Business Information API filter expression (advanced; takes precedence over search). Supports fields such as title, storeCode, storefront_address.postal_code, labels and categories, e.g. storeCode=&quot;LH279411&quot;. See Google's &quot;Work with location data&quot; guide.

Returns:



2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
# File 'lib/zernio-sdk/api/connect_api.rb', line 2559

def list_google_business_locations_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectApi.list_google_business_locations ...'
  end
  # resource path
  local_var_path = '/v1/connect/googlebusiness/locations'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'profileId'] = opts[:'profile_id'] if !opts[:'profile_id'].nil?
  query_params[:'pendingDataToken'] = opts[:'pending_data_token'] if !opts[:'pending_data_token'].nil?
  query_params[:'tempToken'] = opts[:'temp_token'] if !opts[:'temp_token'].nil?
  query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?
  query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?

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

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

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

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

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

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

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

#list_instagram_pages(profile_id, temp_token, opts = {}) ⇒ ListInstagramPages200Response

List Pages with a linked Instagram account Completes the loginMethod=facebook_login Instagram flow, i.e. "Instagram API with Facebook Login". After the user authorizes on Facebook, extract tempToken from the redirect params (headless mode adds step=select_account) and pass it here to list the Facebook Pages they manage. Only Pages that have a linked Instagram professional account are returned, so an empty array means the user has no eligible Page. Use the X-Connect-Token header if connecting via API key. Not used by the default instagram_login flow, which creates the account without a selection step.

Parameters:

  • profile_id (String)

    Profile ID from your connection flow

  • temp_token (String)

    Long-lived Facebook user access token from the OAuth callback redirect

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

    the optional parameters

Returns:



2614
2615
2616
2617
# File 'lib/zernio-sdk/api/connect_api.rb', line 2614

def list_instagram_pages(profile_id, temp_token, opts = {})
  data, _status_code, _headers = list_instagram_pages_with_http_info(profile_id, temp_token, opts)
  data
end

#list_instagram_pages_with_http_info(profile_id, temp_token, opts = {}) ⇒ Array<(ListInstagramPages200Response, Integer, Hash)>

List Pages with a linked Instagram account Completes the `loginMethod=facebook_login` Instagram flow, i.e. &quot;Instagram API with Facebook Login&quot;. After the user authorizes on Facebook, extract `tempToken` from the redirect params (headless mode adds `step=select_account`) and pass it here to list the Facebook Pages they manage. Only Pages that have a linked Instagram professional account are returned, so an empty array means the user has no eligible Page. Use the X-Connect-Token header if connecting via API key. Not used by the default `instagram_login` flow, which creates the account without a selection step.

Parameters:

  • profile_id (String)

    Profile ID from your connection flow

  • temp_token (String)

    Long-lived Facebook user access token from the OAuth callback redirect

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

    the optional parameters

Returns:



2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
# File 'lib/zernio-sdk/api/connect_api.rb', line 2625

def list_instagram_pages_with_http_info(profile_id, temp_token, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectApi.list_instagram_pages ...'
  end
  # verify the required parameter 'profile_id' is set
  if @api_client.config.client_side_validation && profile_id.nil?
    fail ArgumentError, "Missing the required parameter 'profile_id' when calling ConnectApi.list_instagram_pages"
  end
  # verify the required parameter 'temp_token' is set
  if @api_client.config.client_side_validation && temp_token.nil?
    fail ArgumentError, "Missing the required parameter 'temp_token' when calling ConnectApi.list_instagram_pages"
  end
  # resource path
  local_var_path = '/v1/connect/instagram/select-account'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'profileId'] = profile_id
  query_params[:'tempToken'] = temp_token

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

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

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

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

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

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

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

#list_linked_in_organizations(temp_token, org_ids, opts = {}) ⇒ ListLinkedInOrganizations200Response

List LinkedIn orgs Fetch full LinkedIn organization details (logos, vanity names, websites) for custom UI. No authentication required, only the tempToken from OAuth.

Parameters:

  • temp_token (String)

    The temporary LinkedIn access token from the OAuth redirect

  • org_ids (String)

    Comma-separated list of organization IDs to fetch details for (max 100)

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

    the optional parameters

Returns:



2685
2686
2687
2688
# File 'lib/zernio-sdk/api/connect_api.rb', line 2685

def list_linked_in_organizations(temp_token, org_ids, opts = {})
  data, _status_code, _headers = list_linked_in_organizations_with_http_info(temp_token, org_ids, opts)
  data
end

#list_linked_in_organizations_with_http_info(temp_token, org_ids, opts = {}) ⇒ Array<(ListLinkedInOrganizations200Response, Integer, Hash)>

List LinkedIn orgs Fetch full LinkedIn organization details (logos, vanity names, websites) for custom UI. No authentication required, only the tempToken from OAuth.

Parameters:

  • temp_token (String)

    The temporary LinkedIn access token from the OAuth redirect

  • org_ids (String)

    Comma-separated list of organization IDs to fetch details for (max 100)

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

    the optional parameters

Returns:



2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
# File 'lib/zernio-sdk/api/connect_api.rb', line 2696

def list_linked_in_organizations_with_http_info(temp_token, org_ids, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectApi.list_linked_in_organizations ...'
  end
  # verify the required parameter 'temp_token' is set
  if @api_client.config.client_side_validation && temp_token.nil?
    fail ArgumentError, "Missing the required parameter 'temp_token' when calling ConnectApi.list_linked_in_organizations"
  end
  # verify the required parameter 'org_ids' is set
  if @api_client.config.client_side_validation && org_ids.nil?
    fail ArgumentError, "Missing the required parameter 'org_ids' when calling ConnectApi.list_linked_in_organizations"
  end
  # resource path
  local_var_path = '/v1/connect/linkedin/organizations'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'tempToken'] = temp_token
  query_params[:'orgIds'] = org_ids

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

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

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

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

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

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

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

#list_pinterest_boards_for_selection(x_connect_token, profile_id, temp_token, opts = {}) ⇒ ListPinterestBoardsForSelection200Response

List Pinterest boards For headless flows. Returns Pinterest boards the user can post to. Use X-Connect-Token from the redirect URL.

Parameters:

  • x_connect_token (String)

    Short-lived connect token from the OAuth redirect

  • profile_id (String)

    Your Zernio profile ID

  • temp_token (String)

    Temporary Pinterest access token from the OAuth callback redirect

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

    the optional parameters

Returns:



2757
2758
2759
2760
# File 'lib/zernio-sdk/api/connect_api.rb', line 2757

def list_pinterest_boards_for_selection(x_connect_token, profile_id, temp_token, opts = {})
  data, _status_code, _headers = list_pinterest_boards_for_selection_with_http_info(x_connect_token, profile_id, temp_token, opts)
  data
end

#list_pinterest_boards_for_selection_with_http_info(x_connect_token, profile_id, temp_token, opts = {}) ⇒ Array<(ListPinterestBoardsForSelection200Response, Integer, Hash)>

List Pinterest boards For headless flows. Returns Pinterest boards the user can post to. Use X-Connect-Token from the redirect URL.

Parameters:

  • x_connect_token (String)

    Short-lived connect token from the OAuth redirect

  • profile_id (String)

    Your Zernio profile ID

  • temp_token (String)

    Temporary Pinterest access token from the OAuth callback redirect

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

    the optional parameters

Returns:



2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
# File 'lib/zernio-sdk/api/connect_api.rb', line 2769

def list_pinterest_boards_for_selection_with_http_info(x_connect_token, profile_id, temp_token, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectApi.list_pinterest_boards_for_selection ...'
  end
  # verify the required parameter 'x_connect_token' is set
  if @api_client.config.client_side_validation && x_connect_token.nil?
    fail ArgumentError, "Missing the required parameter 'x_connect_token' when calling ConnectApi.list_pinterest_boards_for_selection"
  end
  # verify the required parameter 'profile_id' is set
  if @api_client.config.client_side_validation && profile_id.nil?
    fail ArgumentError, "Missing the required parameter 'profile_id' when calling ConnectApi.list_pinterest_boards_for_selection"
  end
  # verify the required parameter 'temp_token' is set
  if @api_client.config.client_side_validation && temp_token.nil?
    fail ArgumentError, "Missing the required parameter 'temp_token' when calling ConnectApi.list_pinterest_boards_for_selection"
  end
  # resource path
  local_var_path = '/v1/connect/pinterest/select-board'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'profileId'] = profile_id
  query_params[:'tempToken'] = temp_token

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

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

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

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

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

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

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

#list_slack_channels(profile_id, opts = {}) ⇒ ListSlackChannels200Response

List Slack channels for the channel picker Serves the channel picker of the Slack connect flow. Slack's OAuth installs the bot into a workspace, not a channel, so after the redirect the caller lists the workspace's channels here and finalizes one with POST /v1/connect/slack. Served by a dedicated route that shadows GET /v1/connect/{platform} for slack. Send exactly one of pendingDataToken (first connect: the nonce from the OAuth redirect, bound to the same profileId) or accountId (add another channel to a workspace already connected: the existing Slack account's workspace token is reused, no re-OAuth). With neither, the endpoint behaves like GET /v1/connect/{platform} and returns authUrl and state to start the OAuth flow. Channels are read live from Slack (conversations.list, public and private, archived excluded, up to 2,000). isMember says whether the Zernio bot is already in the channel: a public channel is joined automatically on finalize, a private one must be invited (/invite @Zernio) first.

Parameters:

  • profile_id (String)

    Zernio profile the channel account will belong to. Must match the profile the OAuth flow was started on when `pendingDataToken` is used.

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

    the optional parameters

Options Hash (opts):

  • :pending_data_token (String)

    Nonce from the OAuth redirect (first connect).

  • :account_id (String)

    Existing active Slack account (yours or a team member's) whose workspace token is reused.

  • :redirect_url (String)

    Start-OAuth mode only: where to send the user after the connect completes. `redirectUrl` is accepted as an alias.

Returns:



2836
2837
2838
2839
# File 'lib/zernio-sdk/api/connect_api.rb', line 2836

def list_slack_channels(profile_id, opts = {})
  data, _status_code, _headers = list_slack_channels_with_http_info(profile_id, opts)
  data
end

#list_slack_channels_with_http_info(profile_id, opts = {}) ⇒ Array<(ListSlackChannels200Response, Integer, Hash)>

List Slack channels for the channel picker Serves the channel picker of the Slack connect flow. Slack's OAuth installs the bot into a workspace, not a channel, so after the redirect the caller lists the workspace's channels here and finalizes one with `POST /v1/connect/slack`. Served by a dedicated route that shadows `GET /v1/connect/platform` for `slack`. Send exactly one of `pendingDataToken` (first connect: the nonce from the OAuth redirect, bound to the same `profileId`) or `accountId` (add another channel to a workspace already connected: the existing Slack account's workspace token is reused, no re-OAuth). With neither, the endpoint behaves like `GET /v1/connect/platform` and returns `authUrl` and `state` to start the OAuth flow. Channels are read live from Slack (`conversations.list`, public and private, archived excluded, up to 2,000). `isMember` says whether the Zernio bot is already in the channel: a public channel is joined automatically on finalize, a private one must be invited (`/invite @Zernio`) first.

Parameters:

  • profile_id (String)

    Zernio profile the channel account will belong to. Must match the profile the OAuth flow was started on when `pendingDataToken` is used.

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

    the optional parameters

Options Hash (opts):

  • :pending_data_token (String)

    Nonce from the OAuth redirect (first connect).

  • :account_id (String)

    Existing active Slack account (yours or a team member's) whose workspace token is reused.

  • :redirect_url (String)

    Start-OAuth mode only: where to send the user after the connect completes. `redirectUrl` is accepted as an alias.

Returns:



2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
# File 'lib/zernio-sdk/api/connect_api.rb', line 2849

def list_slack_channels_with_http_info(profile_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectApi.list_slack_channels ...'
  end
  # verify the required parameter 'profile_id' is set
  if @api_client.config.client_side_validation && profile_id.nil?
    fail ArgumentError, "Missing the required parameter 'profile_id' when calling ConnectApi.list_slack_channels"
  end
  if @api_client.config.client_side_validation && !opts[:'pending_data_token'].nil? && opts[:'pending_data_token'].to_s.length < 16
    fail ArgumentError, 'invalid value for "opts[:"pending_data_token"]" when calling ConnectApi.list_slack_channels, the character length must be greater than or equal to 16.'
  end

  # resource path
  local_var_path = '/v1/connect/slack'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'profileId'] = profile_id
  query_params[:'pendingDataToken'] = opts[:'pending_data_token'] if !opts[:'pending_data_token'].nil?
  query_params[:'accountId'] = opts[:'account_id'] if !opts[:'account_id'].nil?
  query_params[:'redirect_url'] = opts[:'redirect_url'] if !opts[:'redirect_url'].nil?

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

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

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

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

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

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

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

#list_snapchat_profiles(x_connect_token, profile_id, temp_token, opts = {}) ⇒ ListSnapchatProfiles200Response

List Snapchat profiles For headless flows. Returns Snapchat Public Profiles the user can post to. Use X-Connect-Token from the redirect URL.

Parameters:

  • x_connect_token (String)

    Short-lived connect token from the OAuth redirect

  • profile_id (String)

    Your Zernio profile ID

  • temp_token (String)

    Temporary Snapchat access token from the OAuth callback redirect

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

    the optional parameters

Returns:



2912
2913
2914
2915
# File 'lib/zernio-sdk/api/connect_api.rb', line 2912

def list_snapchat_profiles(x_connect_token, profile_id, temp_token, opts = {})
  data, _status_code, _headers = list_snapchat_profiles_with_http_info(x_connect_token, profile_id, temp_token, opts)
  data
end

#list_snapchat_profiles_with_http_info(x_connect_token, profile_id, temp_token, opts = {}) ⇒ Array<(ListSnapchatProfiles200Response, Integer, Hash)>

List Snapchat profiles For headless flows. Returns Snapchat Public Profiles the user can post to. Use X-Connect-Token from the redirect URL.

Parameters:

  • x_connect_token (String)

    Short-lived connect token from the OAuth redirect

  • profile_id (String)

    Your Zernio profile ID

  • temp_token (String)

    Temporary Snapchat access token from the OAuth callback redirect

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

    the optional parameters

Returns:



2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
# File 'lib/zernio-sdk/api/connect_api.rb', line 2924

def list_snapchat_profiles_with_http_info(x_connect_token, profile_id, temp_token, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectApi.list_snapchat_profiles ...'
  end
  # verify the required parameter 'x_connect_token' is set
  if @api_client.config.client_side_validation && x_connect_token.nil?
    fail ArgumentError, "Missing the required parameter 'x_connect_token' when calling ConnectApi.list_snapchat_profiles"
  end
  # verify the required parameter 'profile_id' is set
  if @api_client.config.client_side_validation && profile_id.nil?
    fail ArgumentError, "Missing the required parameter 'profile_id' when calling ConnectApi.list_snapchat_profiles"
  end
  # verify the required parameter 'temp_token' is set
  if @api_client.config.client_side_validation && temp_token.nil?
    fail ArgumentError, "Missing the required parameter 'temp_token' when calling ConnectApi.list_snapchat_profiles"
  end
  # resource path
  local_var_path = '/v1/connect/snapchat/select-profile'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'profileId'] = profile_id
  query_params[:'tempToken'] = temp_token

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

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

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

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

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

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

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

#list_whats_app_phone_numbers(profile_id, temp_token, opts = {}) ⇒ ListWhatsAppPhoneNumbers200Response

List numbers for selection Fetch the WhatsApp phone numbers available across the user's WhatsApp Business Accounts (WABAs) after a headless OAuth flow. WhatsApp OAuth grants access at the WABA level. When a connected WABA has 2 or more phone numbers, you must call this endpoint to list them and then POST /v1/connect/whatsapp/select-phone-number to bind one to the Zernio profile. Single-phone WABAs auto-complete during the OAuth callback and never reach this endpoint. Use the profileId and tempToken returned in the headless redirect (step=select_phone_number). Alternative: if you already know wabaId and phoneNumberId (e.g. from Meta Business Suite), use connectWhatsAppCredentials instead, which skips this two-step flow.

Parameters:

  • profile_id (String)

    The Zernio profile ID from the headless redirect

  • temp_token (String)

    The temporary access token from the headless redirect

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

    the optional parameters

Options Hash (opts):

  • :x_connect_token (String)

    Alternative auth for API users' end customers (used when the bearer token is scoped to a different user)

Returns:



2990
2991
2992
2993
# File 'lib/zernio-sdk/api/connect_api.rb', line 2990

def list_whats_app_phone_numbers(profile_id, temp_token, opts = {})
  data, _status_code, _headers = list_whats_app_phone_numbers_with_http_info(profile_id, temp_token, opts)
  data
end

#list_whats_app_phone_numbers_with_http_info(profile_id, temp_token, opts = {}) ⇒ Array<(ListWhatsAppPhoneNumbers200Response, Integer, Hash)>

List numbers for selection Fetch the WhatsApp phone numbers available across the user's WhatsApp Business Accounts (WABAs) after a headless OAuth flow. WhatsApp OAuth grants access at the WABA level. When a connected WABA has 2 or more phone numbers, you must call this endpoint to list them and then `POST /v1/connect/whatsapp/select-phone-number` to bind one to the Zernio profile. Single-phone WABAs auto-complete during the OAuth callback and never reach this endpoint. Use the `profileId` and `tempToken` returned in the headless redirect (`step=select_phone_number`). Alternative: if you already know `wabaId` and `phoneNumberId` (e.g. from Meta Business Suite), use `connectWhatsAppCredentials` instead, which skips this two-step flow.

Parameters:

  • profile_id (String)

    The Zernio profile ID from the headless redirect

  • temp_token (String)

    The temporary access token from the headless redirect

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

    the optional parameters

Options Hash (opts):

  • :x_connect_token (String)

    Alternative auth for API users' end customers (used when the bearer token is scoped to a different user)

Returns:



3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
# File 'lib/zernio-sdk/api/connect_api.rb', line 3002

def list_whats_app_phone_numbers_with_http_info(profile_id, temp_token, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectApi.list_whats_app_phone_numbers ...'
  end
  # verify the required parameter 'profile_id' is set
  if @api_client.config.client_side_validation && profile_id.nil?
    fail ArgumentError, "Missing the required parameter 'profile_id' when calling ConnectApi.list_whats_app_phone_numbers"
  end
  # verify the required parameter 'temp_token' is set
  if @api_client.config.client_side_validation && temp_token.nil?
    fail ArgumentError, "Missing the required parameter 'temp_token' when calling ConnectApi.list_whats_app_phone_numbers"
  end
  # resource path
  local_var_path = '/v1/connect/whatsapp/select-phone-number'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'profileId'] = profile_id
  query_params[:'tempToken'] = temp_token

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  header_params[:'X-Connect-Token'] = opts[:'x_connect_token'] if !opts[:'x_connect_token'].nil?

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

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

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

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

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

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

#resync_page_webhook_subscription(account_id, opts = {}) ⇒ ResyncPageWebhookSubscription200Response

Re-subscribe a Facebook Page to Zernio's webhooks Re-sends the full field set to Meta and returns the subscription read back afterwards. Meta only honours the field set sent at subscribe time, so a Page connected before a field existed stays without it until this runs. The response reflects what Meta actually granted, not what was requested.

Parameters:

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

    the optional parameters

Returns:



3062
3063
3064
3065
# File 'lib/zernio-sdk/api/connect_api.rb', line 3062

def resync_page_webhook_subscription(, opts = {})
  data, _status_code, _headers = resync_page_webhook_subscription_with_http_info(, opts)
  data
end

#resync_page_webhook_subscription_with_http_info(account_id, opts = {}) ⇒ Array<(ResyncPageWebhookSubscription200Response, Integer, Hash)>

Re-subscribe a Facebook Page to Zernio's webhooks Re-sends the full field set to Meta and returns the subscription read back afterwards. Meta only honours the field set sent at subscribe time, so a Page connected before a field existed stays without it until this runs. The response reflects what Meta actually granted, not what was requested.

Parameters:

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

    the optional parameters

Returns:



3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
# File 'lib/zernio-sdk/api/connect_api.rb', line 3072

def resync_page_webhook_subscription_with_http_info(, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectApi.resync_page_webhook_subscription ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling ConnectApi.resync_page_webhook_subscription"
  end
  # resource path
  local_var_path = '/v1/accounts/{accountId}/webhook-subscription'.sub('{' + 'accountId' + '}', CGI.escape(.to_s))

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

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

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

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

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

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

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

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

#select_facebook_page(select_facebook_page_request, opts = {}) ⇒ SelectFacebookPage200Response

Select Facebook page 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.

Parameters:

Returns:



3125
3126
3127
3128
# File 'lib/zernio-sdk/api/connect_api.rb', line 3125

def select_facebook_page(select_facebook_page_request, opts = {})
  data, _status_code, _headers = select_facebook_page_with_http_info(select_facebook_page_request, opts)
  data
end

#select_facebook_page_with_http_info(select_facebook_page_request, opts = {}) ⇒ Array<(SelectFacebookPage200Response, Integer, Hash)>

Select Facebook page 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.

Parameters:

Returns:



3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
# File 'lib/zernio-sdk/api/connect_api.rb', line 3135

def select_facebook_page_with_http_info(select_facebook_page_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectApi.select_facebook_page ...'
  end
  # verify the required parameter 'select_facebook_page_request' is set
  if @api_client.config.client_side_validation && select_facebook_page_request.nil?
    fail ArgumentError, "Missing the required parameter 'select_facebook_page_request' when calling ConnectApi.select_facebook_page"
  end
  # resource path
  local_var_path = '/v1/connect/facebook/select-page'

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

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

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

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

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

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

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

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

#select_google_business_location(select_google_business_location_request, opts = {}) ⇒ SelectGoogleBusinessLocation200Response

Select Google Business Profile location Complete the headless Google Business Profile flow by saving the user's selected location. The pendingDataToken is returned in your redirect URL after OAuth completes (step=select_location). Tokens and profile data are stored server-side, so only the pendingDataToken is needed here. Use X-Connect-Token header if connecting via API key.

Parameters:

Returns:



3193
3194
3195
3196
# File 'lib/zernio-sdk/api/connect_api.rb', line 3193

def select_google_business_location(select_google_business_location_request, opts = {})
  data, _status_code, _headers = select_google_business_location_with_http_info(select_google_business_location_request, opts)
  data
end

#select_google_business_location_with_http_info(select_google_business_location_request, opts = {}) ⇒ Array<(SelectGoogleBusinessLocation200Response, Integer, Hash)>

Select Google Business Profile location Complete the headless Google Business Profile flow by saving the user's selected location. The pendingDataToken is returned in your redirect URL after OAuth completes (step=select_location). Tokens and profile data are stored server-side, so only the pendingDataToken is needed here. Use X-Connect-Token header if connecting via API key.

Parameters:

Returns:



3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
# File 'lib/zernio-sdk/api/connect_api.rb', line 3203

def select_google_business_location_with_http_info(select_google_business_location_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectApi.select_google_business_location ...'
  end
  # verify the required parameter 'select_google_business_location_request' is set
  if @api_client.config.client_side_validation && select_google_business_location_request.nil?
    fail ArgumentError, "Missing the required parameter 'select_google_business_location_request' when calling ConnectApi.select_google_business_location"
  end
  # resource path
  local_var_path = '/v1/connect/googlebusiness/select-location'

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

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

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

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

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

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

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

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

#select_instagram_account(select_instagram_account_request, opts = {}) ⇒ SelectInstagramAccount200Response

Select the Page whose Instagram account to connect Saves the selected Page as an Instagram account connected via Facebook Login. The Page access token becomes the account's access token, so every Instagram call for it runs against the Facebook Graph host. One Instagram account per profile: if the profile already has an Instagram account, this replaces it, and picking a different Instagram identity purges the previous account's conversations, external posts and stats.

Parameters:

Returns:



3261
3262
3263
3264
# File 'lib/zernio-sdk/api/connect_api.rb', line 3261

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

#select_instagram_account_with_http_info(select_instagram_account_request, opts = {}) ⇒ Array<(SelectInstagramAccount200Response, Integer, Hash)>

Select the Page whose Instagram account to connect Saves the selected Page as an Instagram account connected via Facebook Login. The Page access token becomes the account's access token, so every Instagram call for it runs against the Facebook Graph host. One Instagram account per profile: if the profile already has an Instagram account, this replaces it, and picking a different Instagram identity purges the previous account's conversations, external posts and stats.

Parameters:

Returns:



3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
# File 'lib/zernio-sdk/api/connect_api.rb', line 3271

def (, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectApi.select_instagram_account ...'
  end
  # verify the required parameter 'select_instagram_account_request' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'select_instagram_account_request' when calling ConnectApi.select_instagram_account"
  end
  # resource path
  local_var_path = '/v1/connect/instagram/select-account'

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

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

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

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

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

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

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

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

#select_linked_in_organization(select_linked_in_organization_request, opts = {}) ⇒ SelectLinkedInOrganization200Response

Select LinkedIn org Complete the LinkedIn connection flow. Set accountType to "personal" or "organization" to connect as a company page. Use X-Connect-Token if connecting via API key.

Parameters:

Returns:



3329
3330
3331
3332
# File 'lib/zernio-sdk/api/connect_api.rb', line 3329

def select_linked_in_organization(select_linked_in_organization_request, opts = {})
  data, _status_code, _headers = select_linked_in_organization_with_http_info(select_linked_in_organization_request, opts)
  data
end

#select_linked_in_organization_with_http_info(select_linked_in_organization_request, opts = {}) ⇒ Array<(SelectLinkedInOrganization200Response, Integer, Hash)>

Select LinkedIn org Complete the LinkedIn connection flow. Set accountType to &quot;personal&quot; or &quot;organization&quot; to connect as a company page. Use X-Connect-Token if connecting via API key.

Parameters:

Returns:



3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
# File 'lib/zernio-sdk/api/connect_api.rb', line 3339

def select_linked_in_organization_with_http_info(select_linked_in_organization_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectApi.select_linked_in_organization ...'
  end
  # verify the required parameter 'select_linked_in_organization_request' is set
  if @api_client.config.client_side_validation && select_linked_in_organization_request.nil?
    fail ArgumentError, "Missing the required parameter 'select_linked_in_organization_request' when calling ConnectApi.select_linked_in_organization"
  end
  # resource path
  local_var_path = '/v1/connect/linkedin/select-organization'

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

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

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

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

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

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

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

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

#select_pinterest_board(select_pinterest_board_request, opts = {}) ⇒ SelectPinterestBoard200Response

Select Pinterest board Complete the Pinterest connection flow. After OAuth, use this endpoint to save the selected board and complete the account connection. Use the X-Connect-Token header if you initiated the connection via API key.

Parameters:

Returns:



3397
3398
3399
3400
# File 'lib/zernio-sdk/api/connect_api.rb', line 3397

def select_pinterest_board(select_pinterest_board_request, opts = {})
  data, _status_code, _headers = select_pinterest_board_with_http_info(select_pinterest_board_request, opts)
  data
end

#select_pinterest_board_with_http_info(select_pinterest_board_request, opts = {}) ⇒ Array<(SelectPinterestBoard200Response, Integer, Hash)>

Select Pinterest board Complete the Pinterest connection flow. After OAuth, use this endpoint to save the selected board and complete the account connection. Use the X-Connect-Token header if you initiated the connection via API key.

Parameters:

Returns:



3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
# File 'lib/zernio-sdk/api/connect_api.rb', line 3407

def select_pinterest_board_with_http_info(select_pinterest_board_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectApi.select_pinterest_board ...'
  end
  # verify the required parameter 'select_pinterest_board_request' is set
  if @api_client.config.client_side_validation && select_pinterest_board_request.nil?
    fail ArgumentError, "Missing the required parameter 'select_pinterest_board_request' when calling ConnectApi.select_pinterest_board"
  end
  # resource path
  local_var_path = '/v1/connect/pinterest/select-board'

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

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

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

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

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

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

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

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

#select_snapchat_profile(select_snapchat_profile_request, opts = {}) ⇒ SelectSnapchatProfile200Response

Select Snapchat profile Complete the Snapchat connection flow by saving the selected Public Profile. Snapchat requires a Public Profile to publish content. Use X-Connect-Token if connecting via API key.

Parameters:

Options Hash (opts):

  • :x_connect_token (String)

    Short-lived connect token from the OAuth redirect (for API users)

Returns:



3466
3467
3468
3469
# File 'lib/zernio-sdk/api/connect_api.rb', line 3466

def select_snapchat_profile(select_snapchat_profile_request, opts = {})
  data, _status_code, _headers = select_snapchat_profile_with_http_info(select_snapchat_profile_request, opts)
  data
end

#select_snapchat_profile_with_http_info(select_snapchat_profile_request, opts = {}) ⇒ Array<(SelectSnapchatProfile200Response, Integer, Hash)>

Select Snapchat profile Complete the Snapchat connection flow by saving the selected Public Profile. Snapchat requires a Public Profile to publish content. Use X-Connect-Token if connecting via API key.

Parameters:

Options Hash (opts):

  • :x_connect_token (String)

    Short-lived connect token from the OAuth redirect (for API users)

Returns:



3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
# File 'lib/zernio-sdk/api/connect_api.rb', line 3477

def select_snapchat_profile_with_http_info(select_snapchat_profile_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectApi.select_snapchat_profile ...'
  end
  # verify the required parameter 'select_snapchat_profile_request' is set
  if @api_client.config.client_side_validation && select_snapchat_profile_request.nil?
    fail ArgumentError, "Missing the required parameter 'select_snapchat_profile_request' when calling ConnectApi.select_snapchat_profile"
  end
  # resource path
  local_var_path = '/v1/connect/snapchat/select-profile'

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

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

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

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

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

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

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

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

#set_reddit_post_flair(account_id, set_reddit_post_flair_request, opts = {}) ⇒ UpdateYoutubeDefaultPlaylist200Response

Set Reddit post flair Applies a flair to a post the connected account already published. Use the GET on this path to list the available flairTemplateId values for the subreddit. Flair can also be set at submit time by passing flairId in platformSpecificData when creating the post. This endpoint is for changing it afterwards. The subreddit must allow users to select their own post flair. Setting flair on another user's post requires moderator permissions, which Zernio does not request.

Parameters:

  • account_id (String)

    The ID of the Reddit account that owns the post

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

    the optional parameters

Returns:



3537
3538
3539
3540
# File 'lib/zernio-sdk/api/connect_api.rb', line 3537

def set_reddit_post_flair(, set_reddit_post_flair_request, opts = {})
  data, _status_code, _headers = set_reddit_post_flair_with_http_info(, set_reddit_post_flair_request, opts)
  data
end

#set_reddit_post_flair_with_http_info(account_id, set_reddit_post_flair_request, opts = {}) ⇒ Array<(UpdateYoutubeDefaultPlaylist200Response, Integer, Hash)>

Set Reddit post flair Applies a flair to a post the connected account already published. Use the GET on this path to list the available `flairTemplateId` values for the subreddit. Flair can also be set at submit time by passing `flairId` in `platformSpecificData` when creating the post. This endpoint is for changing it afterwards. The subreddit must allow users to select their own post flair. Setting flair on another user's post requires moderator permissions, which Zernio does not request.

Parameters:

  • account_id (String)

    The ID of the Reddit account that owns the post

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

    the optional parameters

Returns:



3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
# File 'lib/zernio-sdk/api/connect_api.rb', line 3548

def set_reddit_post_flair_with_http_info(, set_reddit_post_flair_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectApi.set_reddit_post_flair ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling ConnectApi.set_reddit_post_flair"
  end
  # verify the required parameter 'set_reddit_post_flair_request' is set
  if @api_client.config.client_side_validation && set_reddit_post_flair_request.nil?
    fail ArgumentError, "Missing the required parameter 'set_reddit_post_flair_request' when calling ConnectApi.set_reddit_post_flair"
  end
  # resource path
  local_var_path = '/v1/accounts/{accountId}/reddit-flairs'.sub('{' + 'accountId' + '}', CGI.escape(.to_s))

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

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

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

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

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

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

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

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

#update_facebook_page(account_id, update_facebook_page_request, opts = {}) ⇒ UpdateFacebookPage200Response

Update Facebook page Switch which Facebook Page is active for a connected account.

Parameters:

  • account_id (String)
  • update_facebook_page_request (UpdateFacebookPageRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



3611
3612
3613
3614
# File 'lib/zernio-sdk/api/connect_api.rb', line 3611

def update_facebook_page(, update_facebook_page_request, opts = {})
  data, _status_code, _headers = update_facebook_page_with_http_info(, update_facebook_page_request, opts)
  data
end

#update_facebook_page_with_http_info(account_id, update_facebook_page_request, opts = {}) ⇒ Array<(UpdateFacebookPage200Response, Integer, Hash)>

Update Facebook page Switch which Facebook Page is active for a connected account.

Parameters:

  • account_id (String)
  • update_facebook_page_request (UpdateFacebookPageRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
# File 'lib/zernio-sdk/api/connect_api.rb', line 3622

def update_facebook_page_with_http_info(, update_facebook_page_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectApi.update_facebook_page ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling ConnectApi.update_facebook_page"
  end
  # verify the required parameter 'update_facebook_page_request' is set
  if @api_client.config.client_side_validation && update_facebook_page_request.nil?
    fail ArgumentError, "Missing the required parameter 'update_facebook_page_request' when calling ConnectApi.update_facebook_page"
  end
  # resource path
  local_var_path = '/v1/accounts/{accountId}/facebook-page'.sub('{' + 'accountId' + '}', CGI.escape(.to_s))

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

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

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

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

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

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

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

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

#update_gmb_location(account_id, update_gmb_location_request, opts = {}) ⇒ UpdateGmbLocation200Response

Update Google Business Profile location Switch which Google Business Profile location is active for a connected account.

Parameters:

  • account_id (String)
  • update_gmb_location_request (UpdateGmbLocationRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



3685
3686
3687
3688
# File 'lib/zernio-sdk/api/connect_api.rb', line 3685

def update_gmb_location(, update_gmb_location_request, opts = {})
  data, _status_code, _headers = update_gmb_location_with_http_info(, update_gmb_location_request, opts)
  data
end

#update_gmb_location_with_http_info(account_id, update_gmb_location_request, opts = {}) ⇒ Array<(UpdateGmbLocation200Response, Integer, Hash)>

Update Google Business Profile location Switch which Google Business Profile location is active for a connected account.

Parameters:

  • account_id (String)
  • update_gmb_location_request (UpdateGmbLocationRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
# File 'lib/zernio-sdk/api/connect_api.rb', line 3696

def update_gmb_location_with_http_info(, update_gmb_location_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectApi.update_gmb_location ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling ConnectApi.update_gmb_location"
  end
  # verify the required parameter 'update_gmb_location_request' is set
  if @api_client.config.client_side_validation && update_gmb_location_request.nil?
    fail ArgumentError, "Missing the required parameter 'update_gmb_location_request' when calling ConnectApi.update_gmb_location"
  end
  # resource path
  local_var_path = '/v1/accounts/{accountId}/gmb-locations'.sub('{' + 'accountId' + '}', CGI.escape(.to_s))

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

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

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

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

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

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

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

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

#update_linked_in_organization(account_id, update_linked_in_organization_request, opts = {}) ⇒ UpdateLinkedInOrganization200Response

Switch LinkedIn account type Switch a LinkedIn account between personal profile and organization (company page) posting.

Parameters:

Returns:



3759
3760
3761
3762
# File 'lib/zernio-sdk/api/connect_api.rb', line 3759

def update_linked_in_organization(, update_linked_in_organization_request, opts = {})
  data, _status_code, _headers = update_linked_in_organization_with_http_info(, update_linked_in_organization_request, opts)
  data
end

#update_linked_in_organization_with_http_info(account_id, update_linked_in_organization_request, opts = {}) ⇒ Array<(UpdateLinkedInOrganization200Response, Integer, Hash)>

Switch LinkedIn account type Switch a LinkedIn account between personal profile and organization (company page) posting.

Parameters:

Returns:



3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
# File 'lib/zernio-sdk/api/connect_api.rb', line 3770

def update_linked_in_organization_with_http_info(, update_linked_in_organization_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectApi.update_linked_in_organization ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling ConnectApi.update_linked_in_organization"
  end
  # verify the required parameter 'update_linked_in_organization_request' is set
  if @api_client.config.client_side_validation && update_linked_in_organization_request.nil?
    fail ArgumentError, "Missing the required parameter 'update_linked_in_organization_request' when calling ConnectApi.update_linked_in_organization"
  end
  # resource path
  local_var_path = '/v1/accounts/{accountId}/linkedin-organization'.sub('{' + 'accountId' + '}', CGI.escape(.to_s))

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

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

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

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

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

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

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

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

#update_pinterest_boards(account_id, update_pinterest_boards_request, opts = {}) ⇒ ConnectBlueskyCredentials200Response

Set default Pinterest board Sets the default board used when publishing pins for this account.

Parameters:

  • account_id (String)
  • update_pinterest_boards_request (UpdatePinterestBoardsRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



3833
3834
3835
3836
# File 'lib/zernio-sdk/api/connect_api.rb', line 3833

def update_pinterest_boards(, update_pinterest_boards_request, opts = {})
  data, _status_code, _headers = update_pinterest_boards_with_http_info(, update_pinterest_boards_request, opts)
  data
end

#update_pinterest_boards_with_http_info(account_id, update_pinterest_boards_request, opts = {}) ⇒ Array<(ConnectBlueskyCredentials200Response, Integer, Hash)>

Set default Pinterest board Sets the default board used when publishing pins for this account.

Parameters:

  • account_id (String)
  • update_pinterest_boards_request (UpdatePinterestBoardsRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
# File 'lib/zernio-sdk/api/connect_api.rb', line 3844

def update_pinterest_boards_with_http_info(, update_pinterest_boards_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectApi.update_pinterest_boards ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling ConnectApi.update_pinterest_boards"
  end
  # verify the required parameter 'update_pinterest_boards_request' is set
  if @api_client.config.client_side_validation && update_pinterest_boards_request.nil?
    fail ArgumentError, "Missing the required parameter 'update_pinterest_boards_request' when calling ConnectApi.update_pinterest_boards"
  end
  # resource path
  local_var_path = '/v1/accounts/{accountId}/pinterest-boards'.sub('{' + 'accountId' + '}', CGI.escape(.to_s))

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

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

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

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

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

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

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

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

#update_reddit_subreddits(account_id, update_reddit_subreddits_request, opts = {}) ⇒ UpdateYoutubeDefaultPlaylist200Response

Set default subreddit Sets the default subreddit used when publishing posts for this Reddit account.

Parameters:

Returns:



3907
3908
3909
3910
# File 'lib/zernio-sdk/api/connect_api.rb', line 3907

def update_reddit_subreddits(, update_reddit_subreddits_request, opts = {})
  data, _status_code, _headers = update_reddit_subreddits_with_http_info(, update_reddit_subreddits_request, opts)
  data
end

#update_reddit_subreddits_with_http_info(account_id, update_reddit_subreddits_request, opts = {}) ⇒ Array<(UpdateYoutubeDefaultPlaylist200Response, Integer, Hash)>

Set default subreddit Sets the default subreddit used when publishing posts for this Reddit account.

Parameters:

Returns:



3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
# File 'lib/zernio-sdk/api/connect_api.rb', line 3918

def update_reddit_subreddits_with_http_info(, update_reddit_subreddits_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectApi.update_reddit_subreddits ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling ConnectApi.update_reddit_subreddits"
  end
  # verify the required parameter 'update_reddit_subreddits_request' is set
  if @api_client.config.client_side_validation && update_reddit_subreddits_request.nil?
    fail ArgumentError, "Missing the required parameter 'update_reddit_subreddits_request' when calling ConnectApi.update_reddit_subreddits"
  end
  # resource path
  local_var_path = '/v1/accounts/{accountId}/reddit-subreddits'.sub('{' + 'accountId' + '}', CGI.escape(.to_s))

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

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

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

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

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

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

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

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

#update_youtube_default_playlist(account_id, update_youtube_default_playlist_request, opts = {}) ⇒ UpdateYoutubeDefaultPlaylist200Response

Set default YouTube playlist Sets the default playlist used when publishing videos for this account. When a post does not specify a playlistId, the default playlist is not automatically used (it is stored for client-side convenience).

Parameters:

Returns:



3981
3982
3983
3984
# File 'lib/zernio-sdk/api/connect_api.rb', line 3981

def update_youtube_default_playlist(, update_youtube_default_playlist_request, opts = {})
  data, _status_code, _headers = update_youtube_default_playlist_with_http_info(, update_youtube_default_playlist_request, opts)
  data
end

#update_youtube_default_playlist_with_http_info(account_id, update_youtube_default_playlist_request, opts = {}) ⇒ Array<(UpdateYoutubeDefaultPlaylist200Response, Integer, Hash)>

Set default YouTube playlist Sets the default playlist used when publishing videos for this account. When a post does not specify a playlistId, the default playlist is not automatically used (it is stored for client-side convenience).

Parameters:

Returns:



3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
# File 'lib/zernio-sdk/api/connect_api.rb', line 3992

def update_youtube_default_playlist_with_http_info(, update_youtube_default_playlist_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectApi.update_youtube_default_playlist ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling ConnectApi.update_youtube_default_playlist"
  end
  # verify the required parameter 'update_youtube_default_playlist_request' is set
  if @api_client.config.client_side_validation && update_youtube_default_playlist_request.nil?
    fail ArgumentError, "Missing the required parameter 'update_youtube_default_playlist_request' when calling ConnectApi.update_youtube_default_playlist"
  end
  # resource path
  local_var_path = '/v1/accounts/{accountId}/youtube-playlists'.sub('{' + 'accountId' + '}', CGI.escape(.to_s))

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

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

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

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

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

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

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

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

#vote_reddit_thing(account_id, vote_reddit_thing_request, opts = {}) ⇒ UpdateYoutubeDefaultPlaylist200Response

Vote on a Reddit post or comment Cast, change, or clear the connected account's vote on a Reddit post or comment. Reddit requires that votes be cast by humans. Reddit's API terms permit a client to proxy a human's action one-for-one, and prohibit a bot from deciding how to vote or from amplifying a human's vote. Call this endpoint only in direct response to an explicit action by the account owner. Automated or agent-decided voting is vote manipulation and puts API access at risk.

Parameters:

  • account_id (String)

    The ID of the Reddit account casting the vote

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

    the optional parameters

Returns:



4055
4056
4057
4058
# File 'lib/zernio-sdk/api/connect_api.rb', line 4055

def vote_reddit_thing(, vote_reddit_thing_request, opts = {})
  data, _status_code, _headers = vote_reddit_thing_with_http_info(, vote_reddit_thing_request, opts)
  data
end

#vote_reddit_thing_with_http_info(account_id, vote_reddit_thing_request, opts = {}) ⇒ Array<(UpdateYoutubeDefaultPlaylist200Response, Integer, Hash)>

Vote on a Reddit post or comment Cast, change, or clear the connected account's vote on a Reddit post or comment. Reddit requires that votes be cast by humans. Reddit's API terms permit a client to proxy a human's action one-for-one, and prohibit a bot from deciding how to vote or from amplifying a human's vote. Call this endpoint only in direct response to an explicit action by the account owner. Automated or agent-decided voting is vote manipulation and puts API access at risk.

Parameters:

  • account_id (String)

    The ID of the Reddit account casting the vote

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

    the optional parameters

Returns:



4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
# File 'lib/zernio-sdk/api/connect_api.rb', line 4066

def vote_reddit_thing_with_http_info(, vote_reddit_thing_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectApi.vote_reddit_thing ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling ConnectApi.vote_reddit_thing"
  end
  # verify the required parameter 'vote_reddit_thing_request' is set
  if @api_client.config.client_side_validation && vote_reddit_thing_request.nil?
    fail ArgumentError, "Missing the required parameter 'vote_reddit_thing_request' when calling ConnectApi.vote_reddit_thing"
  end
  # resource path
  local_var_path = '/v1/accounts/{accountId}/reddit-vote'.sub('{' + 'accountId' + '}', CGI.escape(.to_s))

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

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

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

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

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

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

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

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