Project

General

Profile

API - Queues Pause

API Queues Pause se foloseste pentru a pauza sau a dezactiva pauza agentilor din cozi

API URL

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

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

Array
(
    [action] => pause
    [data] => Array
        (
            [0] => Array
                (
                    [agent_name] => john-doe
                    [reason] => other
                    [paused] => 1
                )
        )
    [api_hash] => 07112231a9c89f5b108af08608a97b07
)

Parametrul action trebuie sa aiba valoarea read.

Headere HTTP:

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

Exemplu generare parametri:

$params = array(
    'action' => 'pause',
    'data' => array(
        array(
            'agent_name' => 'john-doe',
            'reason' => 'other',
            'paused' => 1 // pause = 1, unpause = 0
        )
    )
);

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/queues';
$token = 'your_api_token';
echo curlPost($url, http_build_query($params), array("Authorization: Bearer {$token}"));

Date trimise JSON

{
  "action": "pause",
  "data": [
    {
      "agent_name": "john-doe",
      "reason": "other",
      "paused": 1
    }
  ],
  "api_hash": "fb8423e2fbbe6178501e956f643f2e12" 
}

Raspuns

In caz de succes:

{

    "has_error": false,
    "messages": [ ],
    "results": [
         {
            "agent_name": "john-doe",
            "user_id": "1234",
            "result": 1
         }
     ]

}

Sau in caz de eroare:

{

    "has_error": true,
    "messages": [
        "Queue pause error for row 1: No interfaces could be matched" 
    ],
    "results": [ ]

}

Disponibil si in alte limbi: EN