API - Users status¶
API Users status is used to monitor the status of users in PBX
API URL¶
https://[YOUR-PBX-URL]/api/users-status
Data is sent via POST or GET and must be of the form:¶
Array
(
[type] => sip
[get_stats] => false
[api_hash] => bb76587c4cc53d74fecbb189dd5dbbb8
)
Parameter type must have the value sip
Headere HTTP:¶
Content-Type: application/json Authorization: Bearer <token>
Example of hash generation:
$params['api_hash'] = md5(json_encode($params) . 'your_api_key'); // make hash
Example for data sending:
$url = 'https://[YOUR-PBX-URL]/api/users-status';
$token = 'your_api_token';
echo curlPost($url, json_encode($params), array("Authorization: Bearer {$token}"));
Answer¶
If successful:
{
"has_error": false,
"messages": [ ],
"results": {
"test-user1": {
"username": "test-user1",
"dnid": "0123456789",
"in_use": 0
"limit": 1,
"status": "UNKNOWN",
"ip": "",
"port": "",
"useragent": "",
"extension": 123,
"remote_id": null
}
}
}
Or in case of error:
{
"has_error": true,
"messages": [
"Invalid type: sipx"
],
"results": [ ]
}
Available in other languages: RO