Get a list of active conversations
| Method | list.calls |
|---|---|
| API version | v4.0 |
| Description | Get a list of active calls and their participants |
| Return to list of methods | |
Request parameters
| Title | Type | Required | Valid values | Description |
|---|---|---|---|---|
| access_token | string | yes | Authentication session key | |
| direction | string | no | in, out | Specifies which sessions to display - incoming, outgoing. If the parameter is not specified, then all sessions are displayed. |
| virtual_phone_number | string | no | Specifies which virtual number to show active calls with. The number must start with 7 |
Response parameters
| Name | Type | Required | Valid values | Description | |
|---|---|---|---|---|---|
| call_session_id | number | yes | A unique call session identifier that can be received in a call response message methods start.informer_call, start.vnumber_call, start.scenario_call, start.employee_call, using the notification server or DATA API. | ||
| direction | string | yes | in, out | Call session direction | |
| start_time | string | yes | Call start time. Format YYYY-MM-DD hh:mm:ss |
||
| virtual_phone_number | string | yes | The virtual number that was used as the presentation number. | ||
| contact_phone_number | string | yes | Subscriber number | ||
| external_id | string | yes | Unique identifier of the request in the client's external system | ||
| List of assigned tags | |||||
| tags | array | yes | List of added tags | ||
| tag_id | number | yes | Unique tag identifier | ||
| tag_name | string | yes | Tag name | ||
| Call session participants | |||||
| legs | array | yes | List of call session participants | ||
| leg_id | number | yes | Unique identifier of the shoulder | ||
| calling_phone_number | string | yes | Caller number | ||
| called_phone_number | string | yes | Called subscriber number | ||
| is_operator | boolean | yes | true, false | A flag that identifies the leg that has the right to execute talk options | |
| employee_id | number | yes | Unique employee identifier | ||
| employee_full_name | string | yes | Employee's full name | ||
| record_call_enabled | boolean | yes | true, false |
Conversation recording is enabled/disabled. |
|
| state | string | yes |
Conversation participant status Possible values:
|
||
Example request```json
{ "jsonrpc": "2.0", "method": "list.calls", "id": "req1", "params": { "access_token": "2fRN4g217ca0b4224a67988aff3e584f91964a692045415f36fa66146f5a3c1ae1f6093d", "direction": "in", "virtual_phone_number": "74951045771" } }
##### Sample answer```json
{
"jsonrpc": "2.0",
"id": "req1",
"result": {
"data": [
{
"call_session_id": 206597836,
"direction": "in",
"start_time": "2016-10-19T12:26:48.418",
"virtual_phone_number": "74951045771",
"contact_phone_number": "74959268686",
"external_id": null,
"tags": [
{
"tag_id": 456,
"tag_name": "Целевой"
}
],
"legs": [
{
"leg_id": 287866245,
"calling_phone_number": "74951045771",
"called_phone_number": "74959268686...9.2.3.3",
"is_operator": false,
"employee_id": null,
"employee_full_name": null,
"record_call_enabled": true,
"state": "Разговор"
},
{
"leg_id": 287866221,
"calling_phone_number": "74959268686",
"called_phone_number": "79262444393",
"is_operator": true,
"employee_id": 2345,
"employee_full_name": "Тест",
"record_call_enabled": true,
"state": "Разговор"
}
]
}
]
}
}