Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

You can test API methods on the interactive API browser page and without writing code
Some of the resources described on the page may not be available by default due to the type of application (see Creating and authorizing applications).

Queue configuration

Internal numbers of the queue type are used to implement the functionality of the call center. To configure a new queue is needed to create an extension number, specifying it as the type (parameter type) value queue. After that, it becomes possible to configure the queue and queue agents through the API-interface queue.

Queue agent events (login/logout) are tracked using the resource Queue Agent Events.

The sound files required to configure the queue are uploaded using the resource Sound Files.

Generation features

…….

Description of data structures

 Event (AgentEvent)

Name

Type

Mandatory

Description

url

string

yes

The URL to which the request is sent when the event occurs. For example: 'https://myshost.org/calls'

event_type

string

yes

The agent event to send the request when it occurs. Possible options:

  • 'agent-login' – agent login to the queue;

  • 'agent-logout' – exit of the agent from the queue

method

string

yes

Request method:

  • GET

  • POST 

 Event Data (AgentEventData)

Name

Type

Description

agent_id

string

Unique ID of the queue agent

agent_status

string

New Agent status:

  • available – ready to receive calls from the queue;

  • logged_out – will not accept calls from the queue

agent_type

string

Agent Type:

  • local – local agent;

  • remote - external agent

agent_number

string

Present for agent_type 'remote': external agent number

extension_name

string

Present for agent_type 'local': name of the internal agent

event_source

string

Event source:

  • api - the status change is initiated via the API (for example, via the web interface);

  • phone - initiated by the login/logout command directly from the phone that is the agent

Example

Let's say a client with ID 12 has a local agent with ID 136, and this agent is assigned to the internal number "000*094". Let's add an event to this agent that is generated when it enters the queue:

...

System response:

{
  "url": "https://somehost.com/fordel/show.php",
  "id": 150,
  "method": "GET",
  "event_type": "agent-login"
}

If on the side of somehost.com show.php script has the following content

<?php
error_log("------");
foreach ($_GET as $key => $value){
    error_log("$key => $value");
}
?>

then after logging in to the queue, you can see the following lines in the web server log::

[Tue May 30 15:07:50 2017] ------
[Tue May 30 15:07:50 2017] agent_status => available
[Tue May 30 15:07:50 2017] agent_type => local
[Tue May 30 15:07:50 2017] event_source => api
[Tue May 30 15:07:50 2017] agent_id => 136
[Tue May 30 15:07:50 2017] extension_name => 000*094@ringme.ru

Resources of the "Client" section

Local Agents

 POST /client/{client_id}/agent/local/{agent_id}/event/

POST /client/{client_id}/agent/local/{agent_id}/event/

Add the http event of the queue agent

URL Parameters

Name

Type

agent_id

integer

client_id

string

JSON parameters

Name

Type

Mandatory

event_type

string

yes

method

string

yes

url

string

yes

Response fields

Name

Type

event_type

string

id

long

method

string

url

string

 GET /client/{client_id}/agent/local/{agent_id}/event/

GET /client/{client_id}/agent/local/{agent_id}/event/

Get the http event of the queue agent

URL Parameters

Name

Type

agent_id

integer

client_id

string

Response fields

Name

Type

event_type

string

id

long

method

string

url

string

 PUT /client/{client_id}/agent/local/{agent_id}/event/{event_id}

PUT /client/{client_id}/agent/local/{agent_id}/event/{event_id}

Update the http event of the queue agent

URL Parameters

Name

Type

event_id

integer

agent_id

integer

client_id

string

JSON parameters

Name

Type

Mandatory

event_type

string

none

method

string

none

url

string

none

Response fields

Name

Type

event_type

string

id

long

method

string

url

string

 GET /client/{client_id}/agent/local/{agent_id}/event/{event_id}

GET /client/{client_id}/agent/local/{agent_id}/event/{event_id}

Get the http event of the queue agent

URL Parameters

Name

Type

event_id

integer

agent_id

integer

client_id

string

Response fields

Name

Type

event_type

string

id

long

method

string

url

string

 DELETE /client/{client_id}/agent/local/{agent_id}/event/{event_id}

DELETE /client/{client_id}/agent/local/{agent_id}/event/{event_id}

Delete the http event of the queue agent

URL Parameters

Name

Type

event_id

integer

agent_id

integer

client_id

string

External agents

 POST /client/{client_id}/agent/remote/{agent_id}/event/

POST /client/{client_id}/agent/remote/{agent_id}/event/

Add the http event of the queue agent

URL Parameters

Name

Type

agent_id

integer

client_id

string

JSON parameters

Name

Type

Mandatory

event_type

string

yes

method

string

yes

url

string

yes

Response fields

Name

Type

event_type

string

id

long

method

string

url

string

 GET /client/{client_id}/agent/remote/{agent_id}/event/

GET /client/{client_id}/agent/remote/{agent_id}/event/

Get the http event of the queue agent

URL Parameters

Name

Type

agent_id

integer

client_id

string

Response fields

Name

Type

event_type

string

id

long

method

string

url

string

 PUT /client/{client_id}/agent/remote/{agent_id}/event/{event_id}

PUT /client/{client_id}/agent/remote/{agent_id}/event/{event_id}

Update the http event of the queue agent

URL Parameters

Name

Type

event_id

integer

agent_id

integer

client_id

string

JSON parameters

Name

Type

Mandatory

event_type

string

none

method

string

none

url

string

none

Response fields

Name

Type

event_type

string

id

long

method

string

url

string

 GET /client/{client_id}/agent/remote/{agent_id}/event/{event_id}

GET /client/{client_id}/agent/remote/{agent_id}/event/{event_id}

Get the http event of the queue agent

URL Parameters

Name

Type

event_id

integer

agent_id

integer

client_id

string

Response fields

Name

Type

event_type

string

id

long

method

string

url

string

 DELETE /client/{client_id}/agent/remote/{agent_id}/event/{event_id}

DELETE /client/{client_id}/agent/remote/{agent_id}/event/{event_id}

Delete the http event of the queue agent

URL Parameters

Name

Type

event_id

integer

agent_id

integer

client_id

string

  • No labels