API - Queues Pause¶
The Queues Pause API is used to pause or unpause agents in queues
API URL¶
https://[YOUR-PBX-URL]/api/queues
The data is transmitted via POST or GET and must be of the form:¶
Array ( [action] => pause [date] => Array ( [0] => Array ( [agent_name] => john-doe [reason] => other [paused] => 1 ) ) [api_hash] => 07112231a9c89f5b108af08608a97b07 )
The action parameter must have the value read.
HTTP headers:¶
Content-Type: text/xml Authorization: Bearer <token>
Parameter generation example:
$params = array(
'action' => 'pause',
'data' => array(
array(
'agent_name' => 'john-doe',
'reason' => 'other',
'paused' => 1 // pause = 1, unpause = 0
)
)
);
Example of hash generation:
$params['api_hash'] = md5(http_build_query($params) . 'your_api_key'); // make hash
Example of sending data:
$url = 'https://[YOUR-PBX-URL]/api/queues';
$token = 'your_api_token';
echo curlPost($url, http_build_query($params), array("Authorization: Bearer {$token}"));
Data sent JSON¶
{
"action": "pause",
"data": [
{
"agent_name": "john-doe",
"reason": "other",
"paused": 1
}
],
"api_hash": "fb8423e2fbbe6178501e956f643f2e12"
}
Response¶
In case of success:
{
"has_error": false,
"messages": [ ],
"results": [
{
"agent_name": "john-doe",
"user_id": "1234",
"result": 1
}
]
}
Or in case of error:
{
"has_error": true,
"messages": [
"Queue pause error for row 1: No interfaces could be matched"
],
"results": [ ]
}
Available in other language: RO