Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
Messages
For a complete list of responses for the Messages resource, see Chat REST API Messages Response Objects.
Syntax
- URI
- https://hostname/chat/rest/System/Messages
- Available since release
- This resource is available in API versions 29.0 and later.
- Formats
- JSON
- HTTP methods
- GET
- Request headers
- X-LIVEAGENT-API-VERSION
- X-LIVEAGENT-AFFINITY
- X-LIVEAGENT-SESSION-KEY
- Request parameters
- None
- Query parameters
- ack—The ack query parameter is a sequencing mechanism that allows you to poll for messages on the Live Agent server. The first time you make the Messages request, the ack parameter is set to –1. To guarantee that you receive the messages from the server in the correct order, update the ack value in the next request with the sequence value from the preceding response. You receive a sequence value only if the response code is 200, which is the response if there are new messages. If the response code is 204, there are no messages and the client doesn't provide a sequence value. In this case, run the Messages request with the same ack value as the previous request.
- Request body
- None
- Response body
- Messages response
Troubleshooting
If your request doesn’t receive an HTTP response and fails, retry the request. If you don’t retry the request before the chat session times out, the session expires. The timeout value that determines how long you have to attempt to send requests before the server expires the session is configured in Chat Deployment in Salesforce Setup.