Retrieve queue statistics

get

/engagement/api/consumer/{fqSiteName}/v1/getQueueStats

This operation is used to retrieve the statistics of the engagement queue. A URL encoded JSON object must be passed in the 'request' query parameter for this request. This JSON object can contain the following fields:

  • chatProactiveAvailableType(string): The proactive available type for the specified queue. If the value is set to 'AGENTS', the response will include the number of agents who are available, have requested a chat engagement, and have connectivity status as active when servicing the specified queue. If the value is set to 'SESSIONS', the response will include the number of available agents who have connectivity status as active when servicing the specified queue but who may or may not have requested a chat engagement.
  • queueId(integer): The unique identifier of the queue.

An example of the JSON object before encoding is as follows:

{
"queueId":1,
"chatProactiveAvailableType":"AGENTS"
}

The URL encoded value for the JSON object is as follows:

%7B%0D%0A%09%22queueId%22%3A+1%2C%0D%0A%09%22chatProactiveAvailableType%22%3A+%22AGENTS%22%0D%0A%7D

Note: This operation is intended to retrieve statistics for a queue so that it can be used as a decision point for adding the user into the queue. Unlike many other Consumer Interactions operations, this operation does not require 'SessionId' to be specified as a header parameter in the request.

Request

Supported Media Types
Path Parameters
Query Parameters
Back to Top

Response

Supported Media Types

200 Response

The request completed successfully.
Body ()
Root Schema : com.rightnow.chat.rest.consumer_api.model.responses.v1.GetQueueStatisticsResponse
Type: object
Show Source
  • The number of available agents or agent sessions. If in the request, the value of 'chatProactiveAvailableType' is set to 'AGENTS', then 'availableAgentSessions' is the number of agents who are available, have requested a chat engagement, and have connectivity status as active when servicing the specified queue. If in the request, the value of 'chatProactiveAvailableType' is set to 'SESSIONS', then 'availableAgentSessions' is the number of available agents who have connectivity status as active when servicing the specified queue but who may or may not have requested a chat engagement.
  • The number of engagements currently in the queue
  • The expected wait time in seconds.
  • The expected wait time (in seconds) as a String.
  • This value is used by the client system to determine the polling interval of this operation required to prevent the system from overloading when high volume of data is being processed. Supported values are : 0, positive integer >= 2 and <= 50.< p>

    • 0: Indicates that the client should turn off polling.
    • Positive integer >= 2 and <= 12 60 50: indicates that the client should multiply current polling interval by this number. for example, if is seconds and value of field in response 5, then adjust to * which seconds.< li>

    If the value of this field is reset to the default value internally by the chat service, then this field will not be included in the response and the client can resume polling at the default interval.

    Note: The recommended polling period for clients that poll the chat service to retrieve queue statistics is 12 seconds. Polling more frequently (value less than 12 seconds) can result in system overload and an eventual downtime.

  • The unique identifier of the requested queue.
  • The unique identifier of the requested queue as a String.
  • The time when the request processing completed in yyyy-MM-dd'T'HH:mm:ssXXX format.
  • The time when the request processing started in yyyy-MM-dd'T'HH:mm:ssXXX format.
  • Total number of agents who are available and have capacity.
  • Total number of agents whose status is available.
  • Total number of agents whose status is unavailable.

400 Response

The validation of the request URL query parameter failed.
Body ()
Root Schema : schema
Type: object

404 Response

The resource was not found.
Body ()
Root Schema : schema
Type: object

500 Response

An error occurred in the chat server while processing the request.
Body ()
Root Schema : schema
Type: object
Back to Top

Examples

The following example shows how to retrieve engagement queue statistics by submitting a GET request using cURL:

cURL Command Example

curl -X GET https://chat_rest_server_domain.com/engagement/api/consumer/day119_181100_sql_238h/v1/getQueueStats?pool=297:1&request=%7B%0D%0A%09%22clientRequestTime%22%3A+null%2C%0D%0A%09%22clientTransactionId%22%3A+6%2C%0D%0A%09%22queueId%22%3A+1%2C%0D%0A%09%22chatProactiveAvailableType%22%3A+%22AGENTS%22%0D%0A%7D -H 'SessionId: 192hyto5qomm8r8rpzzmuzsa6'

Response Header Example

The following shows an example of the response header.

Status: 200 OK
Content-Type: application/json;charset=utf-8

Response Body Example

The following shows an example of the response body in JSON format.

{
    "clientRequestTime": null,
    "serviceStartTime": "2018-10-23T14:14:40.995Z",
    "serviceFinishTime": "2018-10-23T14:14:40.997Z",
    "clientTransactionId": 6,
    "clientTransactionIdString": "6",
    "queueId": 1,
    "queueIdString": "1",
    "expectedWaitSeconds": 0,
    "expectedWaitSecondsString": "0",
    "availableAgentSessions": 0
}
Back to Top