Skip to product menu
Skip to main content

Get Chat Messages

Description

You can get the transcript of a specific chat in your department by providing the chat_id.

chat_id - A Unique ID provided to each chat.

HTTP Method - GET

Query Parameters

*limit: The Number of chat messages that you would like to receive(The default limit is 50.)

*from time: The Chat message after the specified time will be retrieved and displayed.

*to time: The Chat message before the specified time will be retrieved and displayed.

Pre-requisite

A valid OAuth Token is mandatory.

URL

Copiedhttps://salesiq.zoho.com/api/v1/<screenname>/chats/<chat_id>/transcript

Example:

Copied1. https://salesiq.zoho.com/api/v1/zylker/chats/150/transcript
2. https://salesiq.zoho.com/api/v1/zylker/chats/150/transcript?limit=15&fromtime=1459171743914&totime=1458795665587

Success Response

Copied{
  "data": [
    {
      "chatinitiated_time": "1459751530696",
      "visitor_name": "Tom",
      "question": "Hi"
    },
    {
      "sender": "5000000000005",
      "time": "1459751548932",
      "dname": "Patricia",
      "msg": "Hello!"
    },
    {
      "sender": "5000000000005",
      "time": "1459751549695",
      "dname": "Patricia",
      "msg": "How may i help you ?"
    },
    {
      "sender": "5000000000005",
      "time": "1459751550483",
      "dname": "Tom",
      "msg": "For how many days do you provide free subscription?"
    },
    {
      "sender": "5000000000005",
      "time": "1459751551267",
      "dname": "Tom",
      "msg": "Thankyou"
    }
  ]
}

Error Codes

1. General Error

This error is sent in case of internal server error while retrieving chat transcript.code : 2030Error Message : "Unable to retrieve chat transcript for the given chat_id	"

2. Invalid chat_id

This error is sent when the chat_id given is wrong.code : 2031Error Message : "Invalid chat_id"

3. Requested transcript for missed chat

This error is sent when the given chat_id corresponds to a missed chat.code : 2032Error Message : "No Chat Transcript Available : Missed Chat"

4. Requested Non-Department Chat Transcript

This error is sent when the chat corresponding to the given chat_id  does not belong to user's department.code : 2033Error Message : "This chat belongs to a department you do not belong to"

Error Response - Example

Copied{
 "error" :
  {
         "message":"Invalid chat_id",
         "code":2031
  }
}