Skip to main content
Skip table of contents

Conversation Message Object

This is the JSON structure of the Conversation object returned in the GetMessages API. The object attributes are described below.


AttributeDescription
messageId

Unique ID of a message generated by the system for each new message.

conversationIdUnique ID for individual chat sessions. 

to

This is the list of the chat participants this message should be delivered. If empty, the message is expected to be delivered to all chat participants. 

To

JS
 {
            "id": "K1OywrAxN3EYG9Nc9N-f5",
            "name": "Rizwan",
            "type": "Customer"
 }


type

Possible values: 

  • Customer 
  • Bot
  • Agent
  • Supervisor

It is an array, it can have multiple participants.

from

This attribute contains the sender information.

From

JS
{
            "id": "K1OywrAxN3EYG9Nc9N-f5",
            "name": "Rizwan",
            "firstName": "Rizwan",
            "lastName": "",
            "alias": "undefined",
            "type": "Customer"
        }


idThe length of the Id goes up to 21 characters.
alias

Alias is always undefined for the customer and bot. For agent and supervisor, the value is set based on the AGENT_ALIAS configuration.

type

Possible values: 

  • Customer 
  • Bot
  • Agent
  • Supervisor

messageType

Possible values are:

  • ChatMessage - A regular conversation/message between the customer and agent.
  • ActivityMessage - An activity message is a triggered customer message, such as a pop-up box, emails or push notifications. 
  • BotMessage - When the DIRECT_HANDOFF is false, the message is sent and received by the bot.
  • ContactMessage - A ContactMessage as explained in Rich Media Messages.
  • LocationMessage - As explained in Rich Media Messages.

timestamp

Timestamp of the message at which message is received in the chat server. The format for the timestamp is UTC.

tag

It is an optional attribute.

Possible values are:

  • Default - By default, the chat is routed to the agent directly.
  • Whisper - When the supervisor can barge in and write whisper messages to instruct the agent.
  • Bot_Only - When the message is sent and received by the bot only, and not to the agent.
refIdIt is the mandatory parameter, reference id of the customer,
In the case of web-chat, it is normally a phone number, for other channels, it can be different such as Facebook Id, viberId, phone number for SMS
processByBotOnce the bot joins the conversations, all the customer messages with processByBot=false are sent to the bot so the bot can return suggestions for the customer messages. This is important if the bot joins the conversation late or the chat-server is restarted For the transcript it has 0 value. This is a boolean value, for customer message it is set as false, once the bot processes the message and returns the response its value is set to true. For all other messages, its value is always true.
languageIt is an optional attribute, contains the language code of the customer browser.
channelIt is a mandatory attribute, contains channel label, possible values are web | SMS | WhatsApp | Viber | facebook
createdAt

Timestamp at which message was stored in the database.

updatedAtTimestamp at which message was updated in the database.
textText of the message,  only used for message type ChatMessage
inputThis attribute contains text that consists of bot suggestions for the customer message.
attachmentsIt is an optional attribute.
It contains an array of attachments, although a single attachment is supported at the moment.
activityTypeIt is related to messageType ActivityMessage.
Possible values are participantJoined | participantAdded | participantLeft | handoff | noAgentAvailable
intentsList of intents identified by the bot for a customer message, by default it is an empty array
outputList of possible responses identified by the bot for a customer message, by default it is an empty array
entitiesIt is always an empty array, can be used in the future.
botResponseType

It is an optional attribute.

Possible values are simple | structured.

Simple In the simple bot response type, a bot is able to respond with a simple chat message.                                                                      
StructuredIn the structured message, the bot is able to respond with enhanced functionalities. Further structured messages are explained here in Rich Media Messages.
structuredData

It is an optional attribute.
When botResponseType is structured, then structured message contains structuredData sent by bots, such as buttons and carousal object. Further structured data is explained here in Rich Media Messages.

locationThis attribute is only available in location messages, it contains the location.
contactIt is only available for ContactMessage, it contains a phone number and name attribute.

If optional attributes (limit, offset) are not passed along with the request, the response will be in ascending order, otherwise, if optional params are passed, the response will be in descending order i.e latest message first and the previous message order by timestamp attribute.

Values in from and text attributes are utf-8 encoded




JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.