Project

General

Profile

API - Queues Read

API Queues is used to read the PBX queues

API URL

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

The data is transmitted by POST or GET and must be of the form:

Array
(
    [action] => read
    [data] => Array
        (
            [queue_status] => true
        )
    [filters] => Array
        (
            [queues] => Array
                (
                    [0] => demo-queue
                    [1] => sales-queue
                )
            [date_between] => Array
                (
                    [0] => 2023-01-01 00:00:00
                    [1] => 2023-01-01 23:59:59
                )
        )

    [api_hash] => 07112231a9c89f5b108af08608a97b07
)

The parameter action must have the value read.

Headere HTTP:

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

Filters:

  • project_id: Project ID in PBX
  • queues: queues name

Example of parameters generation:

$params = array(
    'action' => 'info',
    'data' => array(
        'queue_status' => true
    ),
    'filters' => array(
        'queues' => array('demo-queue', 'sales-queue'),
        'date_between' => array('2023-01-01 00:00:00', ' 2023-01-01 23:59:59'), // array(from, to)
    )
);

Example of hash generation:

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

Example for sending data:

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

Response

In case of successful response:

{

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

}

Or in case of error:

{

    "has_error": true,
    "messages": [
        "No Queues found" 
    ],
    "results": [ ]

}

Available in other languages: RO

Go to top