Project

General

Profile

API - Schedule Read

API Schedule se foloseste pentru a citi orarul din centrala

API URL

https://[YOUR-PBX-URL]/api/schedule

Datele se trasmit prin POST sau GET si trebuie sa fie de forma:

Array
(
    [action] => read
    [data] => Array
        (
            [type] => weekdays
        )

    [api_hash] => 07112231a9c89f5b108af08608a97b07
)

Parametrul action trebuie sa aiba valoarea read.
Parametrul data trebuie sa contina type cu valoarea weekdays sau custom .

Headere HTTP:

Content-Type: text/xml
Authorization: Bearer <token>

Exemplu generare parametri:

$params = array(
    'action' => 'read',
    'data' => array(
        'type' => 'weekdays', // custom
    )
);

Exemplu generare hash:

$params['api_hash'] = md5(http_build_query($params) . 'your_api_key'); // make hash

Exemplu trimitere date:

$url = 'https://[YOUR-PBX-URL]/api/schedule';
$token = 'your_api_token';
echo curlPost($url, http_build_query($params), array("Authorization: Bearer {$token}"));

Date trimise JSON

{
   "action":"read",
   "data":{
      "type":"weekdays" 
   },
   "api_hash":"de1b56d49bf027503ef3ecee05b9c59d" 
}

Raspuns

In caz de succes:

{

    "has_error": false,
    "messages": [ ],
    "results": [ ]

}

Sau in caz de eroare:

{

    "has_error": true,
    "messages": [
        "Invalid schedule type: xxx" 
    ],
    "results": [ ]

}

Disponibil si in alte limbi: EN