API - Schedule Read¶
API Schedule is used to read the schedule from the PBX
API URL¶
https://[YOUR-PBX-URL]/api/schedule
The data is transmitted via POST or GET and must be of the form:¶
Array
(
[action] => read
[data] => Array
(
[type] => weekdays
)
[api_hash] => 07112231a9c89f5b108af08608a97b07
)
The action parameter must have the value read.
The data parameter must contain type with the value weekdays or custom .
HTTP Headers:¶
Content-Type: text/xml Authorization: Bearer <token>
Example of parameter generation:
$params = array(
'action' => 'read',
'data' => array(
'type' => 'weekdays', // custom
)
);
Example 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/schedule';
$token = 'your_api_token';
echo curlPost($url, http_build_query($params), array("Authorization: Bearer {$token}"));
Data sent JSON¶
{
"action":"read",
"data":{
"type":"weekdays"
},
"api_hash":"de1b56d49bf027503ef3ecee05b9c59d"
}
Response¶
In case of success:
{
"has_error": false,
"messages": [ ],
"results": [ ]
}
Or in case of error:
{
"has_error": true,
"messages": [
"Invalid schedule type: xxx"
],
"results": [ ]
}
Disponibil si in alte limbi: RO