Newer Version Available
Your Message Long Polling Loop
When you start a request, all pending messages get immediately delivered to your session. If there are no pending messages, the connection to the server will remain open. The Messages poll will return one payload of messages from the server when they become available, and you’ll have to open a new Messages connection to receive future data.
You’ll 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.
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.