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 GBP location to another profile Connect a Google Business location onto a DIFFERENT profile by reusing the OAuth grant from an already-connected GBP account — no browser, 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 GBP account (the token holder); the body profileId is the TARGET profile. Returns 409 if the target profile already has a Google Business connection (switch its location with PUT gmb-locations instead).

Parameters:

  • account_id (String)

    A source connected GBP 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 GBP location to another profile Connect a Google Business location onto a DIFFERENT profile by reusing the OAuth grant from an already-connected GBP account — no browser, 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 GBP account (the token holder); the body `profileId` is the TARGET profile. Returns 409 if the target profile already has a Google Business connection (switch its location with PUT gmb-locations instead).

Parameters:

  • account_id (String)

    A source connected GBP 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_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:



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

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:



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

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:



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

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:



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

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:



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

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:



246
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
# File 'lib/zernio-sdk/api/connect_api.rb', line 246

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. Same-token platforms (facebook, instagram, linkedin, pinterest): Creates an ads SocialAccount (metaads, linkedinads, pinterestads) with a copied OAuth token from the parent posting account. If the ads account already exists, returns alreadyConnected: true. No extra OAuth needed. 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) — 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 — 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.

  • profile_id (String)

    Your Zernio profile ID

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

    the optional parameters

Options Hash (opts):

  • :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 redirect URL after OAuth completes (same-token platforms only). Accepts an http(s) URL, a custom app scheme for mobile deeplinks (e.g. myapp://callback), or a relative path.

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



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

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. Same-token platforms (facebook, instagram, linkedin, pinterest): Creates an ads SocialAccount (metaads, linkedinads, pinterestads) with a copied OAuth token from the parent posting account. If the ads account already exists, returns alreadyConnected: true. No extra OAuth needed. 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) — 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 — 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.

  • profile_id (String)

    Your Zernio profile ID

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

    the optional parameters

Options Hash (opts):

  • :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 redirect URL after OAuth completes (same-token platforms only). Accepts an http(s) URL, a custom app scheme for mobile deeplinks (e.g. myapp://callback), or a relative path.

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



328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
# File 'lib/zernio-sdk/api/connect_api.rb', line 328

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
  # 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[:'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:



397
398
399
400
# File 'lib/zernio-sdk/api/connect_api.rb', line 397

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:



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
# File 'lib/zernio-sdk/api/connect_api.rb', line 407

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_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)

Parameters:

Returns:



465
466
467
468
# File 'lib/zernio-sdk/api/connect_api.rb', line 465

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)

Parameters:

Returns:



475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
# File 'lib/zernio-sdk/api/connect_api.rb', line 475

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

#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:



534
535
536
537
# File 'lib/zernio-sdk/api/connect_api.rb', line 534

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:



545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
# File 'lib/zernio-sdk/api/connect_api.rb', line 545

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

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

Parameters:

  • platform (String)

    Social media platform to connect

  • profile_id (String)

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

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

    the optional parameters

Options Hash (opts):

  • :redirect_url (String)

    Your custom redirect URL after connection completes. Accepts an http(s) URL, a custom app scheme for mobile deeplinks (e.g. myapp://callback), or a relative path. 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.

  • :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)

Returns:



610
611
612
613
# File 'lib/zernio-sdk/api/connect_api.rb', line 610

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.

Parameters:

  • platform (String)

    Social media platform to connect

  • profile_id (String)

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

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

    the optional parameters

Options Hash (opts):

  • :redirect_url (String)

    Your custom redirect URL after connection completes. Accepts an http(s) URL, a custom app scheme for mobile deeplinks (e.g. myapp://callback), or a relative path. 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.

  • :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)

Returns:

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

    GetConnectUrl200Response data, response status code and response headers



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

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", "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
  # 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?

  # 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:



689
690
691
692
# File 'lib/zernio-sdk/api/connect_api.rb', line 689

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



700
701
702
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
# File 'lib/zernio-sdk/api/connect_api.rb', line 700

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 GBP 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:



757
758
759
760
# File 'lib/zernio-sdk/api/connect_api.rb', line 757

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 GBP 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



770
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
823
824
825
826
827
# File 'lib/zernio-sdk/api/connect_api.rb', line 770

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:



834
835
836
837
# File 'lib/zernio-sdk/api/connect_api.rb', line 834

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:



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 844

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_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, 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, Google Business 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). Token is one-time use and expires after 10 minutes. 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:



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

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, 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, Google Business 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`). Token is one-time use and expires after 10 minutes. 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:



907
908
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
# File 'lib/zernio-sdk/api/connect_api.rb', line 907

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:



961
962
963
964
# File 'lib/zernio-sdk/api/connect_api.rb', line 961

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:



971
972
973
974
975
976
977
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
# File 'lib/zernio-sdk/api/connect_api.rb', line 971

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:



1025
1026
1027
1028
# File 'lib/zernio-sdk/api/connect_api.rb', line 1025

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



1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
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
# File 'lib/zernio-sdk/api/connect_api.rb', line 1036

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
  # 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:



1094
1095
1096
1097
# File 'lib/zernio-sdk/api/connect_api.rb', line 1094

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:



1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
# File 'lib/zernio-sdk/api/connect_api.rb', line 1104

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_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:



1158
1159
1160
1161
# File 'lib/zernio-sdk/api/connect_api.rb', line 1158

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:



1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
# File 'lib/zernio-sdk/api/connect_api.rb', line 1169

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:



1226
1227
1228
1229
# File 'lib/zernio-sdk/api/connect_api.rb', line 1226

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:



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
# File 'lib/zernio-sdk/api/connect_api.rb', line 1236

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_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:



1290
1291
1292
1293
# File 'lib/zernio-sdk/api/connect_api.rb', line 1290

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:



1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
# File 'lib/zernio-sdk/api/connect_api.rb', line 1300

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.

Parameters:

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

    the optional parameters

Returns:

  • (nil)


1354
1355
1356
1357
# File 'lib/zernio-sdk/api/connect_api.rb', line 1354

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.

Parameters:

  • platform (String)
  • 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



1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
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
# File 'lib/zernio-sdk/api/connect_api.rb', line 1365

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 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:



1427
1428
1429
1430
# File 'lib/zernio-sdk/api/connect_api.rb', line 1427

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:



1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
# File 'lib/zernio-sdk/api/connect_api.rb', line 1437

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(profile_id, temp_token, opts = {}) ⇒ ListFacebookPages200Response

List Facebook pages Returns the list of Facebook Pages the user can manage after OAuth. Extract tempToken and userProfile from the OAuth redirect params and pass them here. Use the X-Connect-Token header if connecting via API key.

Parameters:

  • profile_id (String)

    Profile ID from your connection flow

  • temp_token (String)

    Temporary Facebook access token from the OAuth callback redirect

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

    the optional parameters

Returns:



1496
1497
1498
1499
# File 'lib/zernio-sdk/api/connect_api.rb', line 1496

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

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

List Facebook pages Returns the list of Facebook Pages the user can manage after OAuth. Extract tempToken and userProfile from the OAuth redirect params and pass them here. Use the X-Connect-Token header if connecting via API key.

Parameters:

  • profile_id (String)

    Profile ID from your connection flow

  • temp_token (String)

    Temporary Facebook access token from the OAuth callback redirect

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

    the optional parameters

Returns:



1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
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
# File 'lib/zernio-sdk/api/connect_api.rb', line 1507

def list_facebook_pages_with_http_info(profile_id, temp_token, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectApi.list_facebook_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_facebook_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_facebook_pages"
  end
  # resource path
  local_var_path = '/v1/connect/facebook/select-page'

  # 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] || '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 GBP locations For headless flows. Returns the list of GBP 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:



1570
1571
1572
1573
# File 'lib/zernio-sdk/api/connect_api.rb', line 1570

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 GBP locations For headless flows. Returns the list of GBP 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:



1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
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
# File 'lib/zernio-sdk/api/connect_api.rb', line 1584

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_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, just 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:



1639
1640
1641
1642
# File 'lib/zernio-sdk/api/connect_api.rb', line 1639

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, just 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:



1650
1651
1652
1653
1654
1655
1656
1657
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
# File 'lib/zernio-sdk/api/connect_api.rb', line 1650

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:



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

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:



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
1779
1780
# File 'lib/zernio-sdk/api/connect_api.rb', line 1723

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_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:



1789
1790
1791
1792
# File 'lib/zernio-sdk/api/connect_api.rb', line 1789

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:



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
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
# File 'lib/zernio-sdk/api/connect_api.rb', line 1801

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:



1867
1868
1869
1870
# File 'lib/zernio-sdk/api/connect_api.rb', line 1867

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:



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
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
# File 'lib/zernio-sdk/api/connect_api.rb', line 1879

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

#select_facebook_page(select_facebook_page_request, opts = {}) ⇒ SelectFacebookPage200Response

Select Facebook page Complete the headless flow by saving the user's selected Facebook page. Pass the userProfile from the OAuth redirect and use X-Connect-Token if connecting via API key.

Parameters:

Returns:



1939
1940
1941
1942
# File 'lib/zernio-sdk/api/connect_api.rb', line 1939

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 the headless flow by saving the user's selected Facebook page. Pass the userProfile from the OAuth redirect and use X-Connect-Token if connecting via API key.

Parameters:

Returns:



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
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
# File 'lib/zernio-sdk/api/connect_api.rb', line 1949

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 GBP location Complete the headless GBP 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:



2007
2008
2009
2010
# File 'lib/zernio-sdk/api/connect_api.rb', line 2007

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 GBP location Complete the headless GBP 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:



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
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
# File 'lib/zernio-sdk/api/connect_api.rb', line 2017

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_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:



2075
2076
2077
2078
# File 'lib/zernio-sdk/api/connect_api.rb', line 2075

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:



2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
# File 'lib/zernio-sdk/api/connect_api.rb', line 2085

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:



2143
2144
2145
2146
# File 'lib/zernio-sdk/api/connect_api.rb', line 2143

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:



2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
# File 'lib/zernio-sdk/api/connect_api.rb', line 2153

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:



2212
2213
2214
2215
# File 'lib/zernio-sdk/api/connect_api.rb', line 2212

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:



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
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
# File 'lib/zernio-sdk/api/connect_api.rb', line 2223

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:



2283
2284
2285
2286
# File 'lib/zernio-sdk/api/connect_api.rb', line 2283

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:



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
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
# File 'lib/zernio-sdk/api/connect_api.rb', line 2294

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:



2357
2358
2359
2360
# File 'lib/zernio-sdk/api/connect_api.rb', line 2357

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:



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
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
# File 'lib/zernio-sdk/api/connect_api.rb', line 2368

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 GBP location Switch which GBP location is active for a connected account.

Parameters:

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

    the optional parameters

Returns:



2431
2432
2433
2434
# File 'lib/zernio-sdk/api/connect_api.rb', line 2431

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 GBP location Switch which GBP location is active for a connected account.

Parameters:

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

    the optional parameters

Returns:



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
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
# File 'lib/zernio-sdk/api/connect_api.rb', line 2442

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 = {}) ⇒ ConnectBlueskyCredentials200Response

Switch LinkedIn account type Switch a LinkedIn account between personal profile and organization (company page) posting.

Parameters:

Returns:



2505
2506
2507
2508
# File 'lib/zernio-sdk/api/connect_api.rb', line 2505

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<(ConnectBlueskyCredentials200Response, Integer, Hash)>

Switch LinkedIn account type Switch a LinkedIn account between personal profile and organization (company page) posting.

Parameters:

Returns:



2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
# File 'lib/zernio-sdk/api/connect_api.rb', line 2516

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] || 'ConnectBlueskyCredentials200Response'

  # 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:



2579
2580
2581
2582
# File 'lib/zernio-sdk/api/connect_api.rb', line 2579

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:



2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
# File 'lib/zernio-sdk/api/connect_api.rb', line 2590

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:



2653
2654
2655
2656
# File 'lib/zernio-sdk/api/connect_api.rb', line 2653

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:



2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
# File 'lib/zernio-sdk/api/connect_api.rb', line 2664

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:



2727
2728
2729
2730
# File 'lib/zernio-sdk/api/connect_api.rb', line 2727

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:



2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
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
# File 'lib/zernio-sdk/api/connect_api.rb', line 2738

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:



2801
2802
2803
2804
# File 'lib/zernio-sdk/api/connect_api.rb', line 2801

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:



2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
# File 'lib/zernio-sdk/api/connect_api.rb', line 2812

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