Qubicle Crossbar Queue API

Introduction

This API is semi-backwards-compatible with the ACDC queues configuration API. This API is used for configuring queues in Qubicle, as well as altering the membership of recipients in queues.

Schema

The schema can be found here:

Queue Configuration Schema

Actions

List Queues

This action will list all queues that are configured for the specified account.

GET /v2/accounts/{ACCOUNT_ID}/qubicle_queues

curl -v -X GET -H "X-Auth-Token: {AUTH_TOKEN}" -H "Content-Type: application/json" http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/qubicle_queues
{
    "page_size":{RESULT_COUNT},
    "data":[
        {
            "id": "{QUEUE_ID}",
            "name": "{QUEUE_NAME}"
        }
    ],
    "revision":"{REVISION}",
    "request_id":"{REQUEST_ID}",
    "status":"success",
    "auth_token":"{AUTH_TOKEN}"
}

Queue Status

This action will return the status of the queue.

GET /v2/accounts/{ACCOUNT_ID}/qubicle_queues/{QUEUE_ID}/status

curl -v -X GET -H "X-Auth-Token: {AUTH_TOKEN}" -H "Content-Type: application/json" http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/qubicle_queues/{QUEUE_ID}/status
{
    "data": {
            "active_recipient_count": {ACTIVE_RECIPIENT_COUNT},
            "available_recipient_count": {AVAILABLE_RECIPIENT_COUNT},
            "stats": {
                "estimated_wait": {EST_WAIT_TIME},
                "average_wait": {AVG_WAIT_TIME},
                "recipient_count": {RECIPIENT_COUNT},
                "active_session_count": {ACTIVE_SESSION_COUNT},
                "total_sessions": {TOTAL_SESSION_COUNT},
                "missed_sessions": {MISSED_COUNT},
                "abandoned_sessions": {ABANDONED_COUNT}
            },
            "node": {RUNNING_ON_NODE}
    },
    "revision":"{REVISION}",
    "request_id":"{REQUEST_ID}",
    "status":"success",
    "auth_token":"{AUTH_TOKEN}"
}
  • Active-Session-Count: Count of currently active sessions in the queue
  • Recipient-Count: Count of total configured recipients for the queue
  • Active-Recipient-Count: Count of currently active recipients (logged in)
  • Available-Recipient-Count: Count of currently available recipients (ready to take a call)
  • Estimated-Wait: The currently estimated wait time for a session in queue
  • Average-Wait: The DAILY average wait time for all sessions
  • Total-Sessions: The DAILY total session count for the queue
  • Missed-Sessions: The DAILY total count of missed sessions (sessions that timed out without being handled)
  • Abandoned-Sessions: The DAILY total count of abandoned sessions (session left queue prior to being handled)
  • Node: The node that the queue process is running on

Queue List Status

This action will return the status for the listed queues

GET /v2/accounts/{ACCOUNT_ID}/qubicle_queues/status

curl -v -X GET -H "X-Auth-Token: {AUTH_TOKEN}" -H "Content-Type: application/json" http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/qubicle_queues/{QUEUE_ID}/status -d '{"data":{"queue_ids":[{QUEUE_ID_1},{QUEUE_ID_2}]}}'
{
    "data":{
        {QUEUE_ID_1}: {
            "active_recipient_count": {ACTIVE_RECIPIENT_COUNT},
            "available_recipient_count": {AVAILABLE_RECIPIENT_COUNT},
            "stats": {
                "estimated_wait": {EST_WAIT_TIME},
                "average_wait": {AVG_WAIT_TIME},
                "recipient_count": {RECIPIENT_COUNT},
                "active_session_count": {ACTIVE_SESSION_COUNT},
                "total_sessions": {TOTAL_SESSION_COUNT},
                "missed_sessions": {MISSED_COUNT},
                "abandoned_sessions": {ABANDONED_COUNT}
            },
            "node": {RUNNING_ON_NODE}
        },
        {QUEUE_ID_2}: {
            "active_recipient_count": {ACTIVE_RECIPIENT_COUNT},
            "available_recipient_count": {AVAILABLE_RECIPIENT_COUNT},
            "stats": {
                "estimated_wait": {EST_WAIT_TIME},
                "average_wait": {AVG_WAIT_TIME},
                "recipient_count": {RECIPIENT_COUNT},
                "active_session_count": {ACTIVE_SESSION_COUNT},
                "total_sessions": {TOTAL_SESSION_COUNT},
                "missed_sessions": {MISSED_COUNT},
                "abandoned_sessions": {ABANDONED_COUNT}
            },
            "node": {RUNNING_ON_NODE}
        }
    },
    "revision":"{REVISION}",
    "request_id":"{REQUEST_ID}",
    "status":"success",
    "auth_token":"{AUTH_TOKEN}"
}

Queue Information

This action will return all configuration data for a specific queue.

GET /v2/accounts/{ACCOUNT_ID}/qubicle_queues/{QUEUE_ID}

curl -v -X GET -H "X-Auth-Token: {AUTH_TOKEN}" -H "Content-Type: application/json" http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/qubicle_queues/{QUEUE_ID}
{
    "data":{
        "name":"{QUEUE_NAME}",
        "queue_type":"queue_basic",
        "queue_router":"{ROUTER_TYPE}",
        "timeout":{TIMEOUT},
        "hold_treatment":"{MEDIA_ID_FOR_HOLD_TREATMENT}",
        "agent_wrapup_time":{AGENT_WRAPUP},
        "tick_time":1000,
        "members":{
            {MEMBERS_LIST}
        },
        "id":"{QUEUE_ID}",
    },
    "revision":"{REVISION}",
    "request_id":"{REQUEST_ID}",
    "status":"success",
    "auth_token":"{AUTH_TOKEN}"
}

The {MEMBERS_LIST} for a queue will consist of a list of key -> value mappings where the key is the id of a Qubicle enabled user (recipient) and the value is an empty string.

    "members":{
        "{USER_ID}":"",
        "{USER2_ID}":""
    }

Create a queue

This action will allow configuration of a new queue.

PUT /v2/accounts/{ACCOUNT_ID}/qubicle_queues/

curl -v -X PUT -H "X-Auth-Token: {AUTH_TOKEN}" -H "Content-Type: application/json" http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/qubicle_queues -d '{"data":{"name":"{QUEUE_NAME}"}}'
{
    "data":{
        "name":"{QUEUE_NAME}",
        "agent_connect_timeout":15,
        "agent_wrapup_time":2,
        "queue_router":"route_round_robin",
        "queue_timeout":3600,
        "queue_type":"queue_basic",
        "tick_time":1000,
        "id":"{QUEUE_ID}"
    },
    "revision":"{REVISION}",
    "request_id":"{REQUEST_ID}",
    "status":"success",
    "auth_token":"{AUTH_TOKEN}"
}

Modify a queue

The queue configuration can be modified with a PATCH request as follows

PATCH /v2/accounts/{ACCOUNT_ID}/qubicle_queues/{QUEUE_ID}

curl -v -X PATCH -H "X-Auth-Token: {AUTH_TOKEN}" -H "Content-Type: application/json" http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/qubicle_queues/{QUEUE_ID} -d '{"data":{"queue_timeout":"2000"}}'
{
    "data":{
        "name":"{QUEUE_NAME}",
        "agent_connect_timeout":{AGENT_CONNECT_TIMEOUT},
        "agent_wrapup_time":{AGENT_WRAPUP_TIME},
        "queue_router":{QUEUE_ROUTER},
        "queue_timeout":2000,
        "queue_type":{QUEUE_TYPE},
        "tick_time":1000,
        "id":"{QUEUE_ID}"
    },
    "revision":"{REVISION}",
    "request_id":"{REQUEST_ID}",
    "status":"success",
    "auth_token":"{AUTH_TOKEN}"
}

List queue sessions

This action lists all sessions that are in the queue currently.

GET /v2/accounts/{ACCOUNT_ID}/qubicle_queues/{QUEUE_ID}/sessions

curl -v -X GET -H "X-Auth-Token: {AUTH_TOKEN}" http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/qubicle_queues/{QUEUE_ID}/sessions

Return Value:

{
    "data": [
        {
            "queue_id":"{QUEUE_ID}",
            "session_list": [{SESSION1}, {SESSION2}]
        }
    ],
    "revision":"{REVISION}",
    "request_id":"{REQUEST_ID}",
    "status":"success",
    "auth_token":"{AUTH_TOKEN}"
}

List queue recipients

This action lists all recipients that are in the queue currently, as well as their permissions.

GET /v2/accounts/{ACCOUNT_ID}/qubicle_queues/{QUEUE_ID}/recipients

curl -v -X GET -H "X-Auth-Token: {AUTH_TOKEN}" http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/qubicle_queues/{QUEUE_ID}/recipients

Return Value:

{
    "data": [
        {
            "id":{RECIP_1_ID},
            "permission_roles": {RECIP_1_ROLES},
            "permissions": [{RECIP_1_PERMISSIONS}]
        }
    ],
    "revision":"{REVISION}",
    "request_id":"{REQUEST_ID}",
    "status":"success",
    "auth_token":"{AUTH_TOKEN}"
}

Set the queue membership

This action modifies the membership of a queue.

The following example shows how to assign a role to a recipient for a given queue, this assumes you already know the {ROLE_ID} and {QUEUE_ID}.

NOTE If the recipient specified is NOT a member of the queue currently, they WILL BE ADDED as a member as a result of this action.

POST /v2/accounts/{ACCOUNT_ID}/qubicle_queues/{QUEUE_ID}/roles

curl -v -X POST -H "X-Auth-Token: {AUTH_TOKEN}" -H "Content-Type: application/json" http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/qubicle_queues/{queue_ID}/roles -d '{"data":{"action":"assign", "recipient":"{RECIPIENT_ID}", "roles":["{ROLE_ID}"]}}'
{
    "data":{
        {QUEUE_CONFIG_DATA}
    },
    "status":"success",
    "request_id":"{REQUEST_ID}",
    "auth_token":"{AUTH_TOKEN}"
}

NOTE Members is a list of user id’s

Action is one of the following:

  • add: adds the list of id’s to queue membership
  • remove: removes the list of id’s from queue membership
  • set: sets the membership to exactly the list of id’s provided

Clear a queue’s membership

NOTE The recipient will NOT be removed from the queue membership as a result of this action.

POST /v2/accounts/{ACCOUNT_ID}/qubicle_queues/{QUEUE_ID}/roles

curl -v -X POST -H "X-Auth-Token: {AUTH_TOKEN}" -H "Content-Type: application/json" http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/qubicle_queues/{queue_ID}/roles -d '{"data":{"action":"remove", "recipient":"{RECIPIENT_ID}", "roles":["{ROLE_ID}"]}}'
{
    "data":{
        {QUEUE_CONFIG_DATA}
    },
    "status":"success",
    "request_id":"{REQUEST_ID}",
    "auth_token":"{AUTH_TOKEN}"
}

Setting multiple memberships

This example will show how to bulk set roles for recipients in a queue. This action can also be used to set the queue membership at the same time.

NOTE If the ‘set_membership’ flag is set to ‘true’ this action will modify the queue membership to ONLY contain the specified recipients. If it is ‘false’ then ONLY the EXISTING members of the queue will have their roles set.

POST /v2/accounts/{ACCOUNT_ID}/qubicle_queues/{QUEUE_ID}/roles

curl -v -X POST -H "X-Auth-Token: {AUTH_TOKEN}" -H "Content-Type: application/json" http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/qubicle_queues/{queue_ID}/roles -d '{"data":{"action":"set", "set_membership": {OPTIONAL_BOOLEAN}, "recipients": [{{RECIP_ID_1}: [{ROLE_ID_1}]}, {{RECIP_ID_2}, [{ROLE_ID_2}, {ROLE_ID_3}]}]}}'
{
    "data":{
        {QUEUE_CONFIG_DATA}
    },
    "status":"success",
    "request_id":"{REQUEST_ID}",
    "auth_token":"{AUTH_TOKEN}"
}

On this Page