API - CallQueue Read¶
API CallQueue / Read se foloseste pentru a citi lista de apeluri programate via CallQueue / Save sau automat de centrala (Ex: missed calls)
API URL¶
https://[YOUR-PBX-URL]/api/call-queue
Datele se trasmit prin POST sau GET si trebuie sa fie de forma:¶
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 )
Parametrul action trebuie sa aiba valoarea read. Parametrul page este implicit 1, va trebui incrementat pentru a extrage datele de pe toate paginile.
Headere HTTP:¶
Content-Type: text/xml Authorization: Bearer <token>
Filtre:¶
- date_between: intervalul pentru care se face filtrare Format: Y-m-d H:i:s (ex: 2017-02-16 00:00:00)
- schedule_lt: data programarii <= datei setate. Format: Y-m-d H:i:s (ex: 2017-02-16 00:00:00)
- schedule_null: fara data programata
- caller_id: numarul de telefon care a fost apelat
- dnid: numarul folosit pentru outbound
- outbound_number: numarul care este afisat catre destinatar, optional
- project_id: ID proiect in centrala
- inbound_route_id: ID-uri Inbound route
- outbound_type: tipul de campanie (auto sau manual)
- attend_type: apelul se reazileaza cu sau fara un agent (attended, unattended)
- external_id: ID din baza de date externa (ex: activity ID)
- assign_type: destinatia catre care apelul a fost asignat
- campaign: numele campaniei
- status: statusul folosit pentru filtrare (pending, inprogress, completed, cancelled, deleted)
Exemplu generare parametri:
$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)
)
);
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/call-queue';
$token = 'your_api_token';
echo curlPost($url, http_build_query($params), array("Authorization: Bearer {$token}"));
Raspuns¶
In caz de succes:
{
"has_error": false,
"messages": [ ],
"pagination": {
"row_count": 17,
"page_size": 100,
"current_page": 1,
"max_page": 1
},
"results": [ ]
}
Sau in caz de eroare:
{
"has_error": true,
"messages": [
"Invalid filter: statusxxx"
],
"pagination": [ ],
"results": [ ]
}
Disponibil si in alte limbi: EN
Go to top