Conversation Message Object
This is the JSON structure of the Conversation object returned in the GetMessages API. The object attributes are described below.
Attribute | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|
messageId | Unique ID of a message generated by the system for each new message. | ||||||||
conversationId | Unique ID for individual chat sessions. | ||||||||
| 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
It is an array, it can have multiple participants. | ||||||||
from | This attribute contains the sender information. From
JS
| ||||||||
| Possible values are:
| ||||||||
| Timestamp of the message at which message is received in the chat server. The format for the timestamp is UTC. | ||||||||
| It is an optional attribute. Possible values are:
| ||||||||
refId | It 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 | ||||||||
processByBot | Once 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. | ||||||||
language | It is an optional attribute, contains the language code of the customer browser. | ||||||||
channel | It 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. | ||||||||
updatedAt | Timestamp at which message was updated in the database. | ||||||||
text | Text of the message, only used for message type ChatMessage | ||||||||
input | This attribute contains text that consists of bot suggestions for the customer message. | ||||||||
attachments | It is an optional attribute. It contains an array of attachments, although a single attachment is supported at the moment. | ||||||||
activityType | It is related to messageType ActivityMessage. Possible values are participantJoined | participantAdded | participantLeft | handoff | noAgentAvailable | ||||||||
intents | List of intents identified by the bot for a customer message, by default it is an empty array | ||||||||
output | List of possible responses identified by the bot for a customer message, by default it is an empty array | ||||||||
entities | It is always an empty array, can be used in the future. | ||||||||
botResponseType | It is an optional attribute. Possible values are simple | structured.
| ||||||||
structuredData | It is an optional attribute. | ||||||||
location | This attribute is only available in location messages, it contains the location. | ||||||||
contact | It 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