Skip to content
This repository was archived by the owner on Aug 25, 2025. It is now read-only.

Latest commit

 

History

History
302 lines (215 loc) · 8.18 KB

File metadata and controls

302 lines (215 loc) · 8.18 KB

Cfchat::AgentsApi

All URIs are relative to https://chat.myclickfunnels.com

Method HTTP request Description
add_new_agent_to_account POST /api/v1/accounts/{account_id}/agents Add a New Agent
delete_agent_from_account DELETE /api/v1/accounts/{account_id}/agents/{id} Remove an Agent from Account
get_account_agents GET /api/v1/accounts/{account_id}/agents List Agents in Account
update_agent_in_account PATCH /api/v1/accounts/{account_id}/agents/{id} Update Agent in Account

add_new_agent_to_account

add_new_agent_to_account(account_id, data)

Add a New Agent

Add a new Agent to Account

Examples

require 'time'
require 'cfchat'
# setup authorization
Cfchat.configure do |config|
  # Configure API key authorization: userApiKey
  config.api_key['userApiKey'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['userApiKey'] = 'Bearer'
end

api_instance = Cfchat::AgentsApi.new
account_id = 56 # Integer | The numeric ID of the account
data = Cfchat::AddNewAgentToAccountRequest.new({name: 'name_example', email: 'email_example', role: 'agent'}) # AddNewAgentToAccountRequest | 

begin
  # Add a New Agent
  result = api_instance.add_new_agent_to_account(account_id, data)
  p result
rescue Cfchat::ApiError => e
  puts "Error when calling AgentsApi->add_new_agent_to_account: #{e}"
end

Using the add_new_agent_to_account_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> add_new_agent_to_account_with_http_info(account_id, data)

begin
  # Add a New Agent
  data, status_code, headers = api_instance.add_new_agent_to_account_with_http_info(account_id, data)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <Agent>
rescue Cfchat::ApiError => e
  puts "Error when calling AgentsApi->add_new_agent_to_account_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
account_id Integer The numeric ID of the account
data AddNewAgentToAccountRequest

Return type

Agent

Authorization

userApiKey

HTTP request headers

  • Content-Type: application/json; charset=utf-8
  • Accept: application/json; charset=utf-8

delete_agent_from_account

delete_agent_from_account(account_id, id)

Remove an Agent from Account

Remove an Agent from Account

Examples

require 'time'
require 'cfchat'
# setup authorization
Cfchat.configure do |config|
  # Configure API key authorization: userApiKey
  config.api_key['userApiKey'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['userApiKey'] = 'Bearer'
end

api_instance = Cfchat::AgentsApi.new
account_id = 56 # Integer | The numeric ID of the account
id = 56 # Integer | The ID of the agent to be deleted

begin
  # Remove an Agent from Account
  api_instance.delete_agent_from_account(account_id, id)
rescue Cfchat::ApiError => e
  puts "Error when calling AgentsApi->delete_agent_from_account: #{e}"
end

Using the delete_agent_from_account_with_http_info variant

This returns an Array which contains the response data (nil in this case), status code and headers.

<Array(nil, Integer, Hash)> delete_agent_from_account_with_http_info(account_id, id)

begin
  # Remove an Agent from Account
  data, status_code, headers = api_instance.delete_agent_from_account_with_http_info(account_id, id)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => nil
rescue Cfchat::ApiError => e
  puts "Error when calling AgentsApi->delete_agent_from_account_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
account_id Integer The numeric ID of the account
id Integer The ID of the agent to be deleted

Return type

nil (empty response body)

Authorization

userApiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

get_account_agents

<Array> get_account_agents(account_id)

List Agents in Account

Get Details of Agents in an Account

Examples

require 'time'
require 'cfchat'
# setup authorization
Cfchat.configure do |config|
  # Configure API key authorization: userApiKey
  config.api_key['userApiKey'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['userApiKey'] = 'Bearer'
end

api_instance = Cfchat::AgentsApi.new
account_id = 56 # Integer | The numeric ID of the account

begin
  # List Agents in Account
  result = api_instance.get_account_agents(account_id)
  p result
rescue Cfchat::ApiError => e
  puts "Error when calling AgentsApi->get_account_agents: #{e}"
end

Using the get_account_agents_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(<Array>, Integer, Hash)> get_account_agents_with_http_info(account_id)

begin
  # List Agents in Account
  data, status_code, headers = api_instance.get_account_agents_with_http_info(account_id)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <Array<Agent>>
rescue Cfchat::ApiError => e
  puts "Error when calling AgentsApi->get_account_agents_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
account_id Integer The numeric ID of the account

Return type

Array<Agent>

Authorization

userApiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json; charset=utf-8

update_agent_in_account

update_agent_in_account(account_id, id, data)

Update Agent in Account

Update an Agent in Account

Examples

require 'time'
require 'cfchat'
# setup authorization
Cfchat.configure do |config|
  # Configure API key authorization: userApiKey
  config.api_key['userApiKey'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['userApiKey'] = 'Bearer'
end

api_instance = Cfchat::AgentsApi.new
account_id = 56 # Integer | The numeric ID of the account
id = 56 # Integer | The ID of the agent to be updated.
data = Cfchat::UpdateAgentInAccountRequest.new({role: 'agent'}) # UpdateAgentInAccountRequest | 

begin
  # Update Agent in Account
  result = api_instance.update_agent_in_account(account_id, id, data)
  p result
rescue Cfchat::ApiError => e
  puts "Error when calling AgentsApi->update_agent_in_account: #{e}"
end

Using the update_agent_in_account_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> update_agent_in_account_with_http_info(account_id, id, data)

begin
  # Update Agent in Account
  data, status_code, headers = api_instance.update_agent_in_account_with_http_info(account_id, id, data)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <Agent>
rescue Cfchat::ApiError => e
  puts "Error when calling AgentsApi->update_agent_in_account_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
account_id Integer The numeric ID of the account
id Integer The ID of the agent to be updated.
data UpdateAgentInAccountRequest

Return type

Agent

Authorization

userApiKey

HTTP request headers

  • Content-Type: application/json; charset=utf-8
  • Accept: application/json; charset=utf-8