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.

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.

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



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

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:



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
210
211
212
213
214
215
216
217
218
219
220
# File 'lib/zernio-sdk/api/accounts_api.rb', line 167

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



231
232
233
234
# File 'lib/zernio-sdk/api/accounts_api.rb', line 231

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



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
284
285
286
287
288
289
290
291
292
293
294
295
296
# File 'lib/zernio-sdk/api/accounts_api.rb', line 245

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



304
305
306
307
# File 'lib/zernio-sdk/api/accounts_api.rb', line 304

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:



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
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
# File 'lib/zernio-sdk/api/accounts_api.rb', line 315

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

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :profile_id (String)

    Filter accounts by profile ID

  • :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). When provided with limit, enables server-side pagination. Omit for all accounts.

  • :limit (Integer)

    Page size. Required alongside page for pagination.

Returns:



378
379
380
381
# File 'lib/zernio-sdk/api/accounts_api.rb', line 378

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

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :profile_id (String)

    Filter accounts by profile ID

  • :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). When provided with limit, enables server-side pagination. Omit for all accounts.

  • :limit (Integer)

    Page size. Required alongside page for pagination.

Returns:

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

    AccountsListResponse data, response status code and response headers



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

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:



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

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:



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
527
528
529
530
531
# File 'lib/zernio-sdk/api/accounts_api.rb', line 476

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:



539
540
541
542
# File 'lib/zernio-sdk/api/accounts_api.rb', line 539

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



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
601
602
603
604
605
# File 'lib/zernio-sdk/api/accounts_api.rb', line 550

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