Newer Version Available

This content describes an older version of this product. View Latest

Your Message Long Polling Loop

Message long polling notifies you of events that occur on the Chat server for your Chat session.

The legacy chat product is in maintenance-only mode, and we won't continue to build new features. You can continue to use it, but we no longer recommend that you implement new chat channels. Instead, you can modernize your customer communication with Messaging for In-App and Web. Messaging offers many of the chat features that you love plus asynchronous conversations that can be picked back up at any time.

Note

When you start a request, all pending messages will be immediately delivered to your session. If there are no pending messages, the connection to the server will remain open. The connection will return messages continuously as they are received on the server.

If your session expires, you will receive a 200 (“OK”) response code and a resource that contains an array of the remaining messages. If no messages were received, you will receive a 204 (“No Content”) response code.

When you receive a 200 (“OK”) or 204 (“No Content”) response code, immediately perform another Messages request to continue to retrieve messages that are registered on the Chat server.

If you don’t make another Messages request to continue the messaging loop, your session will end after a system timeout on the Chat server.

Warning

If you don’t receive a response within the number of seconds indicated by the clientPollTimeout property in your SessionId request, your network connection to the server is likely experiencing an error, so you should terminate the request.

To initiate a long polling loop, perform a Messages request.