Get queue statistics
/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
- application/json; charset=utf-8
-
fqSiteName: string
The name of the site returned by the call to establish a session.
-
pool: string
The pool ID specified in the Establish Sessions response or provided in an RNEngagementConfigurationChangedMessage system message.
-
request: string
The URL encoded JSON object.
Response
- application/json; charset=utf-8
200 Response
object
-
availableAgentSessions(optional):
integer(int32)
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.
-
engagementsInQueue(optional):
integer(int32)
The number of engagements currently in the queue
-
expectedWaitSeconds(optional):
integer(int64)
The expected wait time in seconds.
-
expectedWaitSecondsString(optional):
string
The expected wait time (in seconds) as a String.
-
pollingOverrideMultiplier(optional):
integer(int32)
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.
=> -
queueId(optional):
integer(int64)
The unique identifier of the requested queue.
-
queueIdString(optional):
string
The unique identifier of the requested queue as a String.
-
serviceFinishTime(optional):
string
The time when the request processing completed in yyyy-MM-dd'T'HH:mm:ssXXX format.
-
serviceStartTime(optional):
string
The time when the request processing started in yyyy-MM-dd'T'HH:mm:ssXXX format.
-
totalAgentsRequestingNewEngagement(optional):
integer(int32)
Total number of agents who are available and have capacity.
-
totalAvailableAgents(optional):
integer(int32)
Total number of agents whose status is available.
- totalUnavailableAgents(optional): integer(int32)
400 Response
object
404 Response
object
500 Response
object
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?request=%7B%0D%0A%09%22queueId%22%3A+1%2C%0D%0A%09%22chatProactiveAvailableType%22%3A+%22AGENTS%22%0D%0A%7D -H 'Content-Type: application/json; charset=UTF-8'
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.
{ "queueId": 1, "queueIdString": "1", "expectedWaitSeconds": 0, "expectedWaitSecondsString": "0", "availableAgentSessions": 5, "serviceStartTime": "2019-01-30T07:19:14.453Z", "serviceFinishTime": "2019-01-30T07:19:14.455Z" }