About the Chat Service
This section describes the chat portion of the Genesys Web API Server REST API and provides guidance for developers building chat-related client applications.
To assist developers, we provide a few Chat REST API Samples.
Life Cycle of a Chat Session
The chat service is stateless, so in order to know whether a chat interaction is active, we have a requirement to use long polling and do this with the GetMessages operation.
Once a chat session starts, your application must periodically refresh by sending a GetMessages request to keep the session alive.
The refresh frequency is dependent on your application. However, you can use the flex-disconnect-timeout configuration option in Chat Server to specify the maximum timeout between refresh requests.
This is a Chat-specific requirement.
Chat Server Status Codes
The Web API Server Chat Service now includes status codes in the HTTP response. Here is a list of the codes and their meanings:
- statusCode 0—The attempted communication with Chat Server was successful.
- statusCode 1—If Chat Server sends an error response that corresponds to a recoverable error, then there was a recoverable error. Otherwise, there was a connection error with Chat Server.
- statusCode 2—There was a non-recoverable error.
|Does the Chat Client Consider That The Session Has Ended?
|Everything is fine
|The chat has ended; terminate the session
|The request was unsuccessful; retry
|This case isn't possible, as the request was unsuccessful and the last successful chatEnded flag is inherited
|true or false
|Unrecoverable error; terminate the session