API - CallQueue Read¶
CallQueue / Read API is used to read the list of scheduled calls via CallQueue / Save or automatically by the PBX (E.g.: missed calls)
API URL¶
https://[YOUR-PBX-URL]/api/call-queue
The data are transmitted by POST or GET and must be of the form:¶
Array
(
[action] => read
[page] => 1
[filters] => Array
(
[date_between] => Array
(
[0] => 2024-01-01 00:00:00
[1] => 2024-01-15 23:59:59
)
[schedule_lt] =>
[schedule_null] => 1
[caller_id] =>
[dnid] =>
[project_id] =>
[outbound_type] =>
[attend_type] =>
[external_id] =>
[assign_type] =>
[campaign] =>
[status] => pending
)
[api_hash] => b0f5e7f8c9164ff49951b87740d9e015
)
The action parameter must have the read value. The page parameter has the default value 1, it will need to be incremented to extract data from all pages.
Filters:¶
- date_between: the interval for which filtering is performed Format: Y-m-d H:i:s (e.g.: 2017-02-16 00:00:00)
- schedule_lt: scheduling date <= set date. Format: Y-m-d H:i:s (e.g.: 2017-02-16 00:00:00)
- schedule_null: without scheduled date
- caller_id: the dialed phone call
- dnid: the Number used for Outbound Call
- outbound_number: the number that is displayed to the recipient, optional
- project_id: project ID in PBX
- inbound_route_id: IDs Inbound routes
- outbound_type: campaign type (auto or manual)
- attend_type: the call is done with or without an agent(attended, unattended)
- external_id: ID from external database (e.g.: activity ID)
- assign_type: the destination to which the call was assigned
- campaign: company's name
- status: the status used for filtering (pending, in progress, completed, cancelled, deleted)
Example of parameter generation:
$params = array(
'action' => 'read',
'page' => 1,
'filters' => array(
'date_between' => array('2024-01-01 00:00:00', '2024-01-15 23:59:59'), // array(from, to)
'schedule_lt' => null, // datetime
'schedule_null' => true, // show NULL schedule if schedule_lt is applied
'caller_id' => null,
'dnid' => null,
'project_id' => null,
'outbound_type' => null, // auto, manual
'attend_type' => null, // attended, unattended
'external_id' => null,
'assign_type' => null, // queue, no_queue, user
'campaign' => null, // name or info
'status' => 'pending', // array(pending, inprogress, completed, cancelled, deleted)
)
);
Example of hash generation:
$params['api_hash'] = md5(http_build_query($params) . 'your_api_key'); // make hash
Example for sending data:
$url = 'https://[YOUR-PBX-URL]/api/call-queue';
$token = 'your_api_token';
echo curlPost($url, http_build_query($params), array("Authorization: Bearer {$token}"));
Data sent JSON¶
{
"action": "read",
"page": 1,
"filters": {
"date_between": [
"2024-01-01 00:00:00",
"2024-01-15 23:59:59"
],
"schedule_lt": null,
"schedule_null": true,
"caller_id": null,
"dnid": null,
"project_id": null,
"outbound_type": null,
"attend_type": null,
"external_id": null,
"assign_type": null,
"campaign": null,
"status": "pending"
},
"api_hash": "03f0ddb81fdcd0a5a3aec64b36766290"
}
Answer¶
If successful:
{
"has_error": false,
"messages": [ ],
"pagination": {
"row_count": 17,
"page_size": 100,
"current_page": 1,
"max_page": 1
},
"results": [ ]
}
Or in case of error:
{
"has_error": true,
"messages": [
"Invalid filter: statusxxx"
],
"pagination": [ ],
"results": [ ]
}
Available in other languages: RO