Class: Zernio::AccountsApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ AccountsApi

Returns a new instance of AccountsApi.



19
20
21
# File 'lib/zernio-sdk/api/accounts_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/accounts_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#delete_account(account_id, opts = {}) ⇒ DeleteAccountGroup200Response

Disconnect account Disconnects and removes a connected social account.

Parameters:

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

    the optional parameters

Returns:



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

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

#delete_account_with_http_info(account_id, opts = {}) ⇒ Array<(DeleteAccountGroup200Response, Integer, Hash)>

Disconnect account Disconnects and removes a connected social account.

Parameters:

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

    the optional parameters

Returns:



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

def (, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountsApi.delete_account ...'
  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 AccountsApi.delete_account"
  end
  # resource path
  local_var_path = '/v1/accounts/{accountId}'.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] || 'DeleteAccountGroup200Response'

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

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

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

#get_account_health(account_id, opts = {}) ⇒ GetAccountHealth200Response

Check account health Returns detailed health info for a specific account including token status, permissions, and recommendations. For WhatsApp accounts the response also includes platformConnection, a live probe of the Meta link behind the channel (the same read as GET /v1/whatsapp/number-info). The OAuth token can be perfectly valid while Meta refuses to serve the phone-number object (for example after a phone-side coexistence disconnect), so tokenStatus alone is not a liveness signal for WhatsApp. When the Meta link is dead, platformConnection.status is disconnected and the overall status is error.

Parameters:

  • account_id (String)

    The account ID to check

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

    the optional parameters

Returns:



90
91
92
93
# File 'lib/zernio-sdk/api/accounts_api.rb', line 90

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

#get_account_health_with_http_info(account_id, opts = {}) ⇒ Array<(GetAccountHealth200Response, Integer, Hash)>

Check account health Returns detailed health info for a specific account including token status, permissions, and recommendations. For WhatsApp accounts the response also includes `platformConnection`, a live probe of the Meta link behind the channel (the same read as `GET /v1/whatsapp/number-info`). The OAuth token can be perfectly valid while Meta refuses to serve the phone-number object (for example after a phone-side coexistence disconnect), so `tokenStatus` alone is not a liveness signal for WhatsApp. When the Meta link is dead, `platformConnection.status` is `disconnected` and the overall `status` is `error`.

Parameters:

  • account_id (String)

    The account ID to check

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

    the optional parameters

Returns:

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

    GetAccountHealth200Response data, response status code and response headers



100
101
102
103
104
105
106
107
108
109
110
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
# File 'lib/zernio-sdk/api/accounts_api.rb', line 100

def (, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountsApi.get_account_health ...'
  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 AccountsApi.get_account_health"
  end
  # resource path
  local_var_path = '/v1/accounts/{accountId}/health'.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] || 'GetAccountHealth200Response'

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

  new_options = opts.merge(
    :operation => :"AccountsApi.get_account_health",
    :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: AccountsApi#get_account_health\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_account_posts(account_id, opts = {}) ⇒ GetAccountPosts200Response

List posts published on the platform Returns the 25 most recent posts that exist on the platform for a connected account, read live from the platform API. This covers everything on the account, including posts that were never created through Zernio. Use it to obtain the platform's own post id, which the analytics endpoints take as input. On YouTube the returned id is the video ID that GET /v1/analytics/youtube/daily-views, /video-retention and /demographics expect as videoId, so this endpoint is what backs a video picker in your own UI. Not every field applies to every platform: reactionCount is Facebook and LinkedIn, shareCount is platform dependent, cid is the Bluesky content id needed to reply, and subreddit is Reddit only. Absent fields are omitted from the response. The account's token is refreshed before the call when it has expired. When the refresh cannot recover it, the response is a 401 with code TOKEN_EXPIRED and the account has to be reconnected.

Parameters:

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

    the optional parameters

Returns:



153
154
155
156
# File 'lib/zernio-sdk/api/accounts_api.rb', line 153

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

#get_account_posts_with_http_info(account_id, opts = {}) ⇒ Array<(GetAccountPosts200Response, Integer, Hash)>

List posts published on the platform Returns the 25 most recent posts that exist on the platform for a connected account, read live from the platform API. This covers everything on the account, including posts that were never created through Zernio. Use it to obtain the platform's own post id, which the analytics endpoints take as input. On YouTube the returned `id` is the video ID that `GET /v1/analytics/youtube/daily-views`, `/video-retention` and `/demographics` expect as `videoId`, so this endpoint is what backs a video picker in your own UI. Not every field applies to every platform: `reactionCount` is Facebook and LinkedIn, `shareCount` is platform dependent, `cid` is the Bluesky content id needed to reply, and `subreddit` is Reddit only. Absent fields are omitted from the response. The account's token is refreshed before the call when it has expired. When the refresh cannot recover it, the response is a 401 with code `TOKEN_EXPIRED` and the account has to be reconnected.

Parameters:

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

    the optional parameters

Returns:

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

    GetAccountPosts200Response data, response status code and response headers



163
164
165
166
167
168
169
170
171
172
173
174
175
176
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
# File 'lib/zernio-sdk/api/accounts_api.rb', line 163

def (, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountsApi.get_account_posts ...'
  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 AccountsApi.get_account_posts"
  end
  # resource path
  local_var_path = '/v1/accounts/{accountId}/posts'.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] || 'GetAccountPosts200Response'

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

  new_options = opts.merge(
    :operation => :"AccountsApi.get_account_posts",
    :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: AccountsApi#get_account_posts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_all_accounts_health(opts = {}) ⇒ GetAllAccountsHealth200Response

Check accounts health Returns health status of all connected accounts including token validity, permissions, and issues needing attention.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :profile_id (String)

    Filter by profile ID

  • :platform (String)

    Filter by platform

  • :status (String)

    Filter by health status

Returns:



218
219
220
221
# File 'lib/zernio-sdk/api/accounts_api.rb', line 218

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

#get_all_accounts_health_with_http_info(opts = {}) ⇒ Array<(GetAllAccountsHealth200Response, Integer, Hash)>

Check accounts health Returns health status of all connected accounts including token validity, permissions, and issues needing attention.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :profile_id (String)

    Filter by profile ID

  • :platform (String)

    Filter by platform

  • :status (String)

    Filter by health status

Returns:



230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
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
# File 'lib/zernio-sdk/api/accounts_api.rb', line 230

def get_all_accounts_health_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountsApi.get_all_accounts_health ...'
  end
  allowable_values = ["facebook", "instagram", "linkedin", "twitter", "tiktok", "youtube", "threads", "pinterest", "reddit", "bluesky", "googlebusiness", "telegram", "snapchat", "discord", "slack", "whatsapp"]
  if @api_client.config.client_side_validation && opts[:'platform'] && !allowable_values.include?(opts[:'platform'])
    fail ArgumentError, "invalid value for \"platform\", must be one of #{allowable_values}"
  end
  allowable_values = ["healthy", "warning", "error"]
  if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
    fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/v1/accounts/health'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'profileId'] = opts[:'profile_id'] if !opts[:'profile_id'].nil?
  query_params[:'platform'] = opts[:'platform'] if !opts[:'platform'].nil?
  query_params[:'status'] = opts[:'status'] if !opts[:'status'].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] || 'GetAllAccountsHealth200Response'

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

  new_options = opts.merge(
    :operation => :"AccountsApi.get_all_accounts_health",
    :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: AccountsApi#get_all_accounts_health\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_bluesky_settings(account_id, opts = {}) ⇒ GetBlueskySettings200Response

Get Bluesky account settings Returns the account's default post languages (defaultLangs), applied at publish time whenever a post's platformSpecificData.langs is absent. Null when no default is set.

Parameters:

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

    the optional parameters

Returns:



290
291
292
293
# File 'lib/zernio-sdk/api/accounts_api.rb', line 290

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

#get_bluesky_settings_with_http_info(account_id, opts = {}) ⇒ Array<(GetBlueskySettings200Response, Integer, Hash)>

Get Bluesky account settings Returns the account's default post languages (defaultLangs), applied at publish time whenever a post's platformSpecificData.langs is absent. Null when no default is set.

Parameters:

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

    the optional parameters

Returns:



300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
# File 'lib/zernio-sdk/api/accounts_api.rb', line 300

def get_bluesky_settings_with_http_info(, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountsApi.get_bluesky_settings ...'
  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 AccountsApi.get_bluesky_settings"
  end
  # resource path
  local_var_path = '/v1/accounts/{accountId}/bluesky-settings'.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] || 'GetBlueskySettings200Response'

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

  new_options = opts.merge(
    :operation => :"AccountsApi.get_bluesky_settings",
    :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: AccountsApi#get_bluesky_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_follower_stats(opts = {}) ⇒ FollowerStatsResponse

Get follower stats Returns follower count history and growth metrics for connected social accounts. Requires analytics add-on subscription. Follower counts are refreshed once per day.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :account_ids (String)

    Comma-separated list of account IDs (optional, defaults to all user's accounts)

  • :profile_id (String)

    Filter by profile ID

  • :from_date (Date)

    Start date in YYYY-MM-DD format (defaults to 30 days ago)

  • :to_date (Date)

    End date in YYYY-MM-DD format (defaults to today)

  • :granularity (String)

    Data aggregation level (default to 'daily')

Returns:



357
358
359
360
# File 'lib/zernio-sdk/api/accounts_api.rb', line 357

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

#get_follower_stats_with_http_info(opts = {}) ⇒ Array<(FollowerStatsResponse, Integer, Hash)>

Get follower stats Returns follower count history and growth metrics for connected social accounts. Requires analytics add-on subscription. Follower counts are refreshed once per day.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :account_ids (String)

    Comma-separated list of account IDs (optional, defaults to all user's accounts)

  • :profile_id (String)

    Filter by profile ID

  • :from_date (Date)

    Start date in YYYY-MM-DD format (defaults to 30 days ago)

  • :to_date (Date)

    End date in YYYY-MM-DD format (defaults to today)

  • :granularity (String)

    Data aggregation level (default to 'daily')

Returns:

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

    FollowerStatsResponse data, response status code and response headers



371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
# File 'lib/zernio-sdk/api/accounts_api.rb', line 371

def get_follower_stats_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountsApi.get_follower_stats ...'
  end
  allowable_values = ["daily", "weekly", "monthly"]
  if @api_client.config.client_side_validation && opts[:'granularity'] && !allowable_values.include?(opts[:'granularity'])
    fail ArgumentError, "invalid value for \"granularity\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/v1/accounts/follower-stats'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'accountIds'] = opts[:'account_ids'] if !opts[:'account_ids'].nil?
  query_params[:'profileId'] = opts[:'profile_id'] if !opts[:'profile_id'].nil?
  query_params[:'fromDate'] = opts[:'from_date'] if !opts[:'from_date'].nil?
  query_params[:'toDate'] = opts[:'to_date'] if !opts[:'to_date'].nil?
  query_params[:'granularity'] = opts[:'granularity'] if !opts[:'granularity'].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] || 'FollowerStatsResponse'

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

  new_options = opts.merge(
    :operation => :"AccountsApi.get_follower_stats",
    :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: AccountsApi#get_follower_stats\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_instagram_follow_status(account_id, user_id, opts = {}) ⇒ GetInstagramFollowStatus200Response

Check whether an Instagram user follows the account Resolves the follow relationship between an Instagram user and the connected account, plus their public profile counters. userId is the Instagram-scoped id (IGSID) Meta gives you on a webhook: sender.id on message.received, comment.author.id on comment.received. Meta only answers for people who have MESSAGED the account. Commenting grants no consent, so a commenter who has never DMed you is unresolvable - that is a platform rule, not a limitation of this endpoint. When it cannot be resolved the response is still 200 with isFollower: null and an unavailableReason, because "unknown" is a normal state to branch on: * consent_required - the user has never messaged this account. * dm_access_disabled - the account owner turned off Instagram Direct API access. * not_messageable - the id is not a messaging-scoped id. * error - a transient Graph API failure. To gate a comment automation on this, use the automation's audience rules instead of calling this per comment - they run the same lookup only on comments that actually match a keyword, and can ask the commenter to confirm with one tap. Answers are cached briefly per (account, user). Pass refresh=true right after asking someone to follow, so a follow from a moment ago is visible.

Parameters:

  • account_id (String)

    Instagram account ID

  • user_id (String)

    Instagram-scoped user id (IGSID) from a webhook payload

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

    the optional parameters

Options Hash (opts):

  • :refresh (Boolean)

    Bypass the cache and re-query Meta

Returns:



431
432
433
434
# File 'lib/zernio-sdk/api/accounts_api.rb', line 431

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

#get_instagram_follow_status_with_http_info(account_id, user_id, opts = {}) ⇒ Array<(GetInstagramFollowStatus200Response, Integer, Hash)>

Check whether an Instagram user follows the account Resolves the follow relationship between an Instagram user and the connected account, plus their public profile counters. `userId` is the Instagram-scoped id (IGSID) Meta gives you on a webhook: `sender.id` on `message.received`, `comment.author.id` on `comment.received`. Meta only answers for people who have MESSAGED the account. Commenting grants no consent, so a commenter who has never DMed you is unresolvable - that is a platform rule, not a limitation of this endpoint. When it cannot be resolved the response is still `200` with `isFollower: null` and an `unavailableReason`, because &quot;unknown&quot; is a normal state to branch on: * `consent_required` - the user has never messaged this account. * `dm_access_disabled` - the account owner turned off Instagram Direct API access. * `not_messageable` - the id is not a messaging-scoped id. * `error` - a transient Graph API failure. To gate a comment automation on this, use the automation's `audience` rules instead of calling this per comment - they run the same lookup only on comments that actually match a keyword, and can ask the commenter to confirm with one tap. Answers are cached briefly per (account, user). Pass `refresh=true` right after asking someone to follow, so a follow from a moment ago is visible.

Parameters:

  • account_id (String)

    Instagram account ID

  • user_id (String)

    Instagram-scoped user id (IGSID) from a webhook payload

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

    the optional parameters

Options Hash (opts):

  • :refresh (Boolean)

    Bypass the cache and re-query Meta

Returns:



443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
# File 'lib/zernio-sdk/api/accounts_api.rb', line 443

def get_instagram_follow_status_with_http_info(, user_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountsApi.get_instagram_follow_status ...'
  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 AccountsApi.get_instagram_follow_status"
  end
  # verify the required parameter 'user_id' is set
  if @api_client.config.client_side_validation && user_id.nil?
    fail ArgumentError, "Missing the required parameter 'user_id' when calling AccountsApi.get_instagram_follow_status"
  end
  # resource path
  local_var_path = '/v1/accounts/{accountId}/follow-status/{userId}'.sub('{' + 'accountId' + '}', CGI.escape(.to_s)).sub('{' + 'userId' + '}', CGI.escape(user_id.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] || 'GetInstagramFollowStatus200Response'

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

  new_options = opts.merge(
    :operation => :"AccountsApi.get_instagram_follow_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: AccountsApi#get_instagram_follow_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_slack_settings(account_id, opts = {}) ⇒ GetSlackSettings200Response

Get Slack account settings Returns the connected Slack channel details and the default message identity (name and avatar shown as the author on every post, with Slack's APP badge). The identity applies to messages only; the app's own Slack profile is global and cannot be changed per workspace.

Parameters:

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

    the optional parameters

Returns:



501
502
503
504
# File 'lib/zernio-sdk/api/accounts_api.rb', line 501

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

#get_slack_settings_with_http_info(account_id, opts = {}) ⇒ Array<(GetSlackSettings200Response, Integer, Hash)>

Get Slack account settings Returns the connected Slack channel details and the default message identity (name and avatar shown as the author on every post, with Slack's APP badge). The identity applies to messages only; the app's own Slack profile is global and cannot be changed per workspace.

Parameters:

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

    the optional parameters

Returns:

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

    GetSlackSettings200Response data, response status code and response headers



511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
# File 'lib/zernio-sdk/api/accounts_api.rb', line 511

def get_slack_settings_with_http_info(, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountsApi.get_slack_settings ...'
  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 AccountsApi.get_slack_settings"
  end
  # resource path
  local_var_path = '/v1/accounts/{accountId}/slack-settings'.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] || 'GetSlackSettings200Response'

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

  new_options = opts.merge(
    :operation => :"AccountsApi.get_slack_settings",
    :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: AccountsApi#get_slack_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_tik_tok_creator_info(account_id, opts = {}) ⇒ GetTikTokCreatorInfo200Response

Get TikTok creator info Returns TikTok creator details, available privacy levels, posting limits, and commercial content options for a specific TikTok account. Only works with TikTok accounts.

Parameters:

  • account_id (String)

    The TikTok account ID

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

    the optional parameters

Options Hash (opts):

  • :media_type (String)

    The media type to get creator info for (affects available interaction settings) (default to 'video')

Returns:



565
566
567
568
# File 'lib/zernio-sdk/api/accounts_api.rb', line 565

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

#get_tik_tok_creator_info_with_http_info(account_id, opts = {}) ⇒ Array<(GetTikTokCreatorInfo200Response, Integer, Hash)>

Get TikTok creator info Returns TikTok creator details, available privacy levels, posting limits, and commercial content options for a specific TikTok account. Only works with TikTok accounts.

Parameters:

  • account_id (String)

    The TikTok account ID

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

    the optional parameters

Options Hash (opts):

  • :media_type (String)

    The media type to get creator info for (affects available interaction settings) (default to 'video')

Returns:



576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
# File 'lib/zernio-sdk/api/accounts_api.rb', line 576

def get_tik_tok_creator_info_with_http_info(, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountsApi.get_tik_tok_creator_info ...'
  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 AccountsApi.get_tik_tok_creator_info"
  end
  allowable_values = ["video", "photo"]
  if @api_client.config.client_side_validation && opts[:'media_type'] && !allowable_values.include?(opts[:'media_type'])
    fail ArgumentError, "invalid value for \"media_type\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/v1/accounts/{accountId}/tiktok/creator-info'.sub('{' + 'accountId' + '}', CGI.escape(.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'mediaType'] = opts[:'media_type'] if !opts[:'media_type'].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] || 'GetTikTokCreatorInfo200Response'

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

  new_options = opts.merge(
    :operation => :"AccountsApi.get_tik_tok_creator_info",
    :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: AccountsApi#get_tik_tok_creator_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_accounts(opts = {}) ⇒ AccountsListResponse

List accounts Returns connected social accounts. Only includes accounts within the plan limit by default. Follower data requires analytics add-on. Supports optional server-side pagination via page/limit params. When omitted, returns all accounts (backward-compatible). page and limit must be supplied together; out-of-range page/limit values are rejected with 400 rather than silently clamped.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :profile_id (String)

    Filter accounts by profile ID. Must be a valid ObjectId.

  • :platform (String)

    Filter accounts by platform (e.g. &quot;instagram&quot;, &quot;twitter&quot;).

  • :status (String)

    Filter accounts by connection status. `connected` returns healthy accounts; `disconnected` returns accounts that need reconnection (per the same reconnection check surfaced in the dashboard). Omit to return accounts in any status. When combined with page/limit, pagination totals reflect the filtered result set.

  • :include_over_limit (Boolean)

    When true, includes accounts from over-limit profiles. (default to false)

  • :page (Integer)

    Page number (1-based). Must be provided together with limit to enable server-side pagination; sending only one of the two returns 400. Omit both for all accounts.

  • :limit (Integer)

    Page size. Must be provided together with page; sending only one of the two returns 400.

Returns:



639
640
641
642
# File 'lib/zernio-sdk/api/accounts_api.rb', line 639

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

#list_accounts_with_http_info(opts = {}) ⇒ Array<(AccountsListResponse, Integer, Hash)>

List accounts Returns connected social accounts. Only includes accounts within the plan limit by default. Follower data requires analytics add-on. Supports optional server-side pagination via page/limit params. When omitted, returns all accounts (backward-compatible). page and limit must be supplied together; out-of-range page/limit values are rejected with 400 rather than silently clamped.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :profile_id (String)

    Filter accounts by profile ID. Must be a valid ObjectId.

  • :platform (String)

    Filter accounts by platform (e.g. &quot;instagram&quot;, &quot;twitter&quot;).

  • :status (String)

    Filter accounts by connection status. `connected` returns healthy accounts; `disconnected` returns accounts that need reconnection (per the same reconnection check surfaced in the dashboard). Omit to return accounts in any status. When combined with page/limit, pagination totals reflect the filtered result set.

  • :include_over_limit (Boolean)

    When true, includes accounts from over-limit profiles. (default to false)

  • :page (Integer)

    Page number (1-based). Must be provided together with limit to enable server-side pagination; sending only one of the two returns 400. Omit both for all accounts.

  • :limit (Integer)

    Page size. Must be provided together with page; sending only one of the two returns 400.

Returns:

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

    AccountsListResponse data, response status code and response headers



654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
# File 'lib/zernio-sdk/api/accounts_api.rb', line 654

def list_accounts_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountsApi.list_accounts ...'
  end
  allowable_values = ["connected", "disconnected"]
  if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
    fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
  end
  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling AccountsApi.list_accounts, must be greater than or equal to 1.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AccountsApi.list_accounts, must be smaller than or equal to 100.'
  end

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

  # resource path
  local_var_path = '/v1/accounts'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'profileId'] = opts[:'profile_id'] if !opts[:'profile_id'].nil?
  query_params[:'platform'] = opts[:'platform'] if !opts[:'platform'].nil?
  query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
  query_params[:'includeOverLimit'] = opts[:'include_over_limit'] if !opts[:'include_over_limit'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].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] || 'AccountsListResponse'

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

  new_options = opts.merge(
    :operation => :"AccountsApi.list_accounts",
    :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: AccountsApi#list_accounts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#move_account_to_profile(account_id, move_account_to_profile_request, opts = {}) ⇒ MoveAccountToProfile200Response

Move account to another profile Moves a connected social account to a different profile owned by the same user. The target profile must belong to the same user as the account. For API keys restricted to specific profiles, BOTH the source account's current profile AND the target profile must be in the key's allowed set. Calls with a target profile outside the key's scope return 403.

Parameters:

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

    the optional parameters

Returns:



726
727
728
729
# File 'lib/zernio-sdk/api/accounts_api.rb', line 726

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

#move_account_to_profile_with_http_info(account_id, move_account_to_profile_request, opts = {}) ⇒ Array<(MoveAccountToProfile200Response, Integer, Hash)>

Move account to another profile Moves a connected social account to a different profile owned by the same user. The target profile must belong to the same user as the account. For API keys restricted to specific profiles, BOTH the source account's current profile AND the target profile must be in the key's allowed set. Calls with a target profile outside the key's scope return 403.

Parameters:

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

    the optional parameters

Returns:



737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
# File 'lib/zernio-sdk/api/accounts_api.rb', line 737

def (, , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountsApi.move_account_to_profile ...'
  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 AccountsApi.move_account_to_profile"
  end
  # verify the required parameter 'move_account_to_profile_request' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'move_account_to_profile_request' when calling AccountsApi.move_account_to_profile"
  end
  # resource path
  local_var_path = '/v1/accounts/{accountId}'.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()

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

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

  new_options = opts.merge(
    :operation => :"AccountsApi.move_account_to_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(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountsApi#move_account_to_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_account(account_id, update_account_request, opts = {}) ⇒ UpdateAccount200Response

Update account Updates a connected social account's display name or username override. For X/Twitter accounts on usage-based billing, also accepts an xCapabilities object to toggle background API operations that incur X API pass-through costs. Both fields are opt-in (default false) — when off, no analytics syncs or DM polling are performed for that account, and no API call is metered for those operations. Publishing and deleting posts are always available regardless of these toggles. Setting xCapabilities on a non-X account returns 400.

Parameters:

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

    the optional parameters

Returns:



800
801
802
803
# File 'lib/zernio-sdk/api/accounts_api.rb', line 800

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

#update_account_with_http_info(account_id, update_account_request, opts = {}) ⇒ Array<(UpdateAccount200Response, Integer, Hash)>

Update account Updates a connected social account's display name or username override. For X/Twitter accounts on usage-based billing, also accepts an `xCapabilities` object to toggle background API operations that incur X API pass-through costs. Both fields are opt-in (default `false`) — when off, no analytics syncs or DM polling are performed for that account, and no API call is metered for those operations. Publishing and deleting posts are always available regardless of these toggles. Setting `xCapabilities` on a non-X account returns 400.

Parameters:

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

    the optional parameters

Returns:

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

    UpdateAccount200Response data, response status code and response headers



811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
# File 'lib/zernio-sdk/api/accounts_api.rb', line 811

def (, , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountsApi.update_account ...'
  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 AccountsApi.update_account"
  end
  # verify the required parameter 'update_account_request' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'update_account_request' when calling AccountsApi.update_account"
  end
  # resource path
  local_var_path = '/v1/accounts/{accountId}'.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()

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

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

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

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

#update_bluesky_settings(account_id, update_bluesky_settings_request, opts = {}) ⇒ nil

Update Bluesky account settings Set or clear the account's default post languages. 1-3 BCP-47 codes (e.g. "pt", "en-US"), the same validation as per-post langs; explicit null clears the default. Per-post platformSpecificData.langs always overrides this default. Applies to posts published after the change; already-published posts cannot be retagged (Bluesky has no post edit).

Parameters:

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

    the optional parameters

Returns:

  • (nil)


874
875
876
877
# File 'lib/zernio-sdk/api/accounts_api.rb', line 874

def update_bluesky_settings(, update_bluesky_settings_request, opts = {})
  update_bluesky_settings_with_http_info(, update_bluesky_settings_request, opts)
  nil
end

#update_bluesky_settings_with_http_info(account_id, update_bluesky_settings_request, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Update Bluesky account settings Set or clear the account's default post languages. 1-3 BCP-47 codes (e.g. &quot;pt&quot;, &quot;en-US&quot;), the same validation as per-post langs; explicit null clears the default. Per-post platformSpecificData.langs always overrides this default. Applies to posts published after the change; already-published posts cannot be retagged (Bluesky has no post edit).

Parameters:

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
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
# File 'lib/zernio-sdk/api/accounts_api.rb', line 885

def update_bluesky_settings_with_http_info(, update_bluesky_settings_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountsApi.update_bluesky_settings ...'
  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 AccountsApi.update_bluesky_settings"
  end
  # verify the required parameter 'update_bluesky_settings_request' is set
  if @api_client.config.client_side_validation && update_bluesky_settings_request.nil?
    fail ArgumentError, "Missing the required parameter 'update_bluesky_settings_request' when calling AccountsApi.update_bluesky_settings"
  end
  # resource path
  local_var_path = '/v1/accounts/{accountId}/bluesky-settings'.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_bluesky_settings_request)

  # return_type
  return_type = opts[:debug_return_type]

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

  new_options = opts.merge(
    :operation => :"AccountsApi.update_bluesky_settings",
    :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: AccountsApi#update_bluesky_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_slack_settings(account_id, update_slack_settings_request, opts = {}) ⇒ nil

Update Slack account settings Set or clear the default message identity for this channel. Empty string clears a field; per-post platformSpecificData.username/iconUrl still override these defaults.

Parameters:

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

    the optional parameters

Returns:

  • (nil)


948
949
950
951
# File 'lib/zernio-sdk/api/accounts_api.rb', line 948

def update_slack_settings(, update_slack_settings_request, opts = {})
  update_slack_settings_with_http_info(, update_slack_settings_request, opts)
  nil
end

#update_slack_settings_with_http_info(account_id, update_slack_settings_request, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Update Slack account settings Set or clear the default message identity for this channel. Empty string clears a field; per-post platformSpecificData.username/iconUrl still override these defaults.

Parameters:

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



959
960
961
962
963
964
965
966
967
968
969
970
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
# File 'lib/zernio-sdk/api/accounts_api.rb', line 959

def update_slack_settings_with_http_info(, update_slack_settings_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountsApi.update_slack_settings ...'
  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 AccountsApi.update_slack_settings"
  end
  # verify the required parameter 'update_slack_settings_request' is set
  if @api_client.config.client_side_validation && update_slack_settings_request.nil?
    fail ArgumentError, "Missing the required parameter 'update_slack_settings_request' when calling AccountsApi.update_slack_settings"
  end
  # resource path
  local_var_path = '/v1/accounts/{accountId}/slack-settings'.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_slack_settings_request)

  # return_type
  return_type = opts[:debug_return_type]

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

  new_options = opts.merge(
    :operation => :"AccountsApi.update_slack_settings",
    :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: AccountsApi#update_slack_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end