Class

VisitorMessage

VisitorMessage

Message sent by the visitor.

Members

object

# nullable attachment

Attachments add more context to a message, enhance user experience and make it more interactive. Typically a response to OperatorMessage.

File information properties depend on whether the VisitorMessage object is used to send an outbound message from the visitor or it's constructed as a part of an API response (e.g fetching chat history).

Note that for sending a message with file, only file ID is required. When receiving a message (e.g fetching chat history), the file information contains `id`, `size`, `content_type` and other properties.

Properties:
Name Type Description
type string must be one of VisitorMessage#ATTACHMENT_RESPONSE_TYPES
selected_option string Used with SINGLE_CHOICE type. Must be one of provided options value.
files Array.<object> Used with FILES type. Must be an array of objects containing file information.
files[].id string File ID
files[].size string File size in bytes. Used only when receiving a message.
files[].content_type string File mimetype, for example `application/pdf`. Used only when receiving a message.
files[].deleted string Whether the file has been deleted. Used only when receiving a message.
files[].url string URL to download the file. This is null if `deleted` is true. Used only when receiving a message.
object

# ATTACHMENT_RESPONSE_TYPES

Properties:
Name Type Description
SINGLE_CHOICE_RESPONSE string
FILES string
string

# content

Content of the message.
string

# created_at

An ISO-8601 timestamp of when the message was sent.
string

# id

Identifier of the message. This identifier can be used to track a single message's status updates through time and to avoid re-rendering the entire list of messages when the status of only a single message has changed.
string

# sender

Sender type, always Chat#SENDERS.VISITOR.
string

# nullable status

Message delivery status, see VisitorMessage#STATUSES. Null if the object was received using Chat#event:MESSAGES event.

object

# STATUSES

Properties:
Name Type Description
SENDING string The message is being sent but has not yet been received by the operator.
DELIVERED string The message has been successfully sent and the operator has received it.
FAILED string The message's delivery has failed. This may sometimes happen in poor network conditions.