getChatAvailability
Retrieves the availability of the chat service.
You can use this method to check if chat is available before displaying the live chat option for customers. This can be called at any time without an existing chat session.
Parameter | Type | Required | Description |
---|---|---|---|
VisitorID | string id | no | If the application has previously called CreateChat and a VisitorID was returned, re-use that ID for all subsequent calls for each unique user. If this is the first time the application has used createChat, this parameter should be left empty and the server generates and returns a new VisitorID. |
DepartmentID | string id | no | If DepartmentID is not assigned to the API access keys, you can define this parameter to provide the DepartmentID. |
Returns
{
"Status":"success",
"Available":false,
"UnavailableReason":"queue_full"
}
UnavailableReason can have the following values:
- visitor_blocked
- An agent blocked the visitor.
- queue_full
- The number of chats in waiting and in progress status exceeds the queue size limit.
- outside_hours
- It is currently outside of operating hours for the given WebsiteID.
- no_operators
- There are no agents logged in as available.