Project

General

Profile

API - CallQueue Read

CallQueue / Read API is used to read the list of calls scheduled via CallQueue / Save or automatically by the PBX (Ex: missed calls)

API URL

https://[YOUR-PBX-URL]/api/call-queue

Data is sent via POST or GET and must be of the form:

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] => 
            [inbound_route] => 
            [project_id] => 
            [outbound_type] => 
            [attend_type] => 
            [external_id] => 
            [assign_type] => 
            [campaign] => 
            [status] => pending
        )

    [api_hash] => b0f5e7f8c9164ff49951b87740d9e015
)

The action parameter must have the value read. The page parameter defaults to 1 and is incremented up to pagination.max_page (a page greater than max_page still returns the last page). Calls are returned 100 per page.

HTTP Headers:

Content-Type: application/json
Authorization: Bearer <token>

Filters:

  • date_between: array(from, to) for the call creation date. Format: Y-m-d H:i:s (eg: 2017-02-16 00:00:00); applied only if it has exactly 2 values
  • schedule_lt: scheduled date <= the set date. Format: Y-m-d H:i:s (eg: 2017-02-16 00:00:00)
  • schedule_null: if schedule_lt is set, also include calls without a scheduled date (default true)
  • caller_id: the called phone number (exact match, digits and + only)
  • inbound_route: ID of the Inbound route associated with the call
  • outbound_number: the number that is displayed to the recipient
  • project_id: project ID in the PBX or a list of IDs; -1 in the list also includes calls without a project
  • outbound_type: campaign type (auto or manual)
  • attend_type: the call is made with or without an agent (attended, unattended)
  • external_id: ID from the external database (eg: activity ID)
  • assign_type: the destination the call was assigned to: user, no_user, queue, no_queue, context, no_context
  • campaign: campaign name or information (campaign_name / campaign_info), or comma-separated CRM campaign IDs
  • status: the status (pending, inprogress, completed, cancelled, deleted) or a list of statuses (-1 = all). Without this filter all calls are returned, including deleted ones

Any other filter returns the Invalid filter error.

Example of parameters generation:

$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,
        'inbound_route' => 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)
    )
);

Example of hash generation:

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

Example of sending data:

$url = 'https://[YOUR-PBX-URL]/api/call-queue';
$token = 'your_api_token';
echo curlPost($url, json_encode($params), array("Authorization: Bearer {$token}", "Content-Type: application/json"));

Data sent JSON

{
  "action": "read",
  "page": 1,
  "filters": {
    "date_between": [
      "2024-01-01 00:00:00",
      "2024-01-15 23:59:59" 
    ],
    "schedule_lt": null,
    "schedule_null": true,
    "caller_id": null,
    "inbound_route": null,
    "project_id": null,
    "outbound_type": null,
    "attend_type": null,
    "external_id": null,
    "assign_type": null,
    "campaign": null,
    "status": "pending" 
  },
  "api_hash": "03f0ddb81fdcd0a5a3aec64b36766290" 
}

Response

If successful:

{

    "has_error": false,
    "messages": [ ],
    "pagination": {
        "row_count": 1,
        "page_size": 100,
        "current_page": 1,
        "max_page": 1
    },
    "results": [
        {
            "id": "79",
            "caller_id": "0123456789",
            "caller_id_name": "John Doe",
            "project_id": "1",
            "source": "api",
            "campaign_name": "Test campaign",
            "campaign_info": "Some special info",
            "inbound_route_id": null,
            "outbound_number": "+40212345678",
            "context": null,
            "created": "2026-11-05 10:00:00",
            "priority": "0",
            "schedule": "2026-11-05 12:00:00",
            "assigned_operator": null,
            "assigned_queue": "test-queue",
            "outbound_trunk": "default-trunk",
            "last_retry": null,
            "retries_no": "0",
            "max_retries": "5",
            "outbound_type": "auto",
            "attend_type": "attended",
            "resolution": null,
            "crm_campaign_id": null,
            "external_id": "asdf1234",
            "external_info": null,
            "status": "pending",
            "project_name": "While1",
            "project_alias": "while1",
            "inbound_route_name": null,
            "campaign_status": null
        }
    ]

}

Or in case of error:

{

    "has_error": true,
    "messages": [
        "Invalid filter: statusxxx" 
    ],
    "pagination": [ ],
    "results": [ ]

}

Available in other languages: RO