Poll for new Chat Message
(Last Updated On: June 25, 2013)
Overview

Check for new chat messages, recommend interval no more than 1-2 seconds.


Request Parameters
caseId Unique identifier of chat session. (Obtained from Start New Chat API response: POST /api/v1/chat)
index (Optional, default 0) The start index of chats to return.
isTyping (Optional, default false) Is the visitor currently typing a message?

Sample Request
curl -i -H 'X-Api-Key:4a9fecdd4c344f279a59d9446157636e' 'https://www.snapengage.com/api/v1/chat/poll/44843c55-527c-4f03-a779-e0ce655219f7?index=1&isTyping=false'

Response Parameters
caseId Unique identifier of chat session.
agentTyping true if the agent is currently typing a message.
messageList array of messages.
index Index of the chat message in the transcript.
type Either “agent” or “system”.
author Id of the message author (agent or visitor).
text Chat message text.

Success Response

200 OK

{
   "caseId":"44843c55-527c-4f03-a779-e0ce655219f7",
   "agentTyping":false,
   "messageList":[
      {
         "index":0,
         "type":"agent",
         "author":"Joe Agent",
         "text":"Hello how are you?"
      }
   ]
}

Error Responses

Please see the Error Responses document.