Messages

Returns all messages that were sent between agents and chat visitors during a chat session.

For a complete list of responses for the Messages resource, see Chat REST API Messages Response Objects.

This resource is available in API versions 29.0 and later.

URI 

https://HOSTNAME/chat/rest/System/Messages

Where HOSTNAME is a variable.

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.

See Also