Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Name

Type

Description

id

Status
titlestring

message unique identifier

messageType

Status
titleSTRING

Type of the message. Can assume one of the following values:

“TEXT”

“IMAGE”

“DOCUMENT”

“LINK”

“AUDIO”

“VIDEO”

“MENU”

“MENU_RESPONSE”

“QUICK_REPLY”

“QUICK_REPLY_RESPONSE”

“FORM”

“FORM_RESPONSE”

“REACTION”

“CONTACTS”

“LOCATION”

“videoRequestedByAgent”

“videoRequestedByCustomer”

“videoAccepted”

“videoRejected”

“videoStarted”

“videoEnded”

“screenSharingStarted”

“screenSharingEnded”

“endChat”

“leave”

ts

Status
titleNUMBER

Timestamp of when message was sent

deliverySuccess

Status
titleboolean

Indicates if the message has been succesfully delivered

deliveryErrorReason

Status
titlestring

In case of delivery failed, describes the error occurred

replyTo

Status
titlestring

Message ID you are replying to

content

Status
titleobject

Message content. See message content object for more details.

...

Text message

Name

Type

Description

text

Status
titleSTRING

Only in “TEXT” message, contains the message sent

user

Status
titleobject

Semplified user object containing only user id and isAgent properties of the user who sent the message.

...

Name

Type

Description

text

Status
titlestring

Menu title

options

Status
titlearray

Array of objects for the various possibilities of choice. See the next section for more details.

user

Status
titleobject

Semplified user object containing only user id and isAgent properties of the user who sent the message.

option object:

Name

Type

Description

id

Status
titlenumber

Unique option id

command

Status
titlestring

Menu action. Can assume one of the following values:

  • “load-item”: to send the response selected as a next query to the bot

  • “open-url”: to open an external url

text

Status
titlestring

label shown in the option

targetUrl

Status
titlestring

text to send as a next query to the bot

params

Status
titlearray

array of two objects that specify how to open the external url. The first object has two properties:

  • “name”: “method”

  • “text”: method to open url. Can assume one of the following two values: “GET”, “POST”

The second object has two properties:

  • “name”:””where”

  • “text”: target to open url. Can assume one of the following values: “_blank” to open the url in a new browser tab.

...

Name

Type

Description

menuId

Status
titlestring

Id of the “MENU” message which was replied to

option

Status
titleobject

Response that was chosen by the user. See the next section for more details

user

Status
titleobject

Semplified user object containing only user id and isAgent properties of the user who sent the message.

option object:

Name

Type

Description

id

Status
titlestring

Id of the response chosen

targetUrl

Status
titlestring

query sent to the bot

...

Code Block
languagejson
        {
            "data" : {
                "replyTo" : "",
                "id" : "fdaa821a-4355-4f3a-9507-1184c3285701",
                "messageType" : "MENU_RESPONSE",
                "content" : {
                    "menuId" : "d77210fa-4aa2-4876-8fcc-8eaf43122987",
                    "option" : {
                        "id" : 0,
                        "targetUrl" : "vorrei prenotare un volo"
                    },
                    "user" : {
                        "id" : "USER_DEFAULT_9a0a411c-f9c7-4af7-9754-024bf157a3ef",
                        "isAgent" : false
                    }
                },
                "ts" : 1655210175559.0,
                "deliverySuccess" : true,
                "deliveryErrorReason" : ""
            },
            "_id" : ObjectId("62a880c20ece623848eb290b"),
            "room" : "CHAT_DEFAULT_84afbdd3-a4be-4057-ae49-32edc6802658"
        }

Quick reply message (bot):

Name

Type

Description

text

Status
titlestring

Title of the quick reply

header

Status
titlestring

header of the quick reply

footer

Status
titlestring

footer of the quick reply

quickReplies

Status
titlearray

array of strings containing the options (max 3 allowed)

user

Status
titleobject

Semplified user object containing only user id and isAgent properties of the user who sent the message.

Example

Code Block
languagejson
        {
            "data" : {
                "replyTo" : "",
                "id" : "5bd5fcd0-ee5e-48c9-b825-c3e42b85cc45",
                "messageType" : "QUICK_REPLY",
                "content" : {
                    "text" : "Do you want to continue?",
                    "quickReplies" : [ 
                        "No", 
                        "Yes", 
                        "Help"
                    ],
                    "header" : "Cool Title!",
                    "footer" : "Cool Footer!",
                    "user" : {
                        "id" : "BOT_BOT1",
                        "isAgent" : true
                    }
                },
                "ts" : 1679325011759.0,
                "deliverySuccess" : true,
                "deliveryErrorReason" : ""
            },
            "room" : "CHAT_DEFAULT_e7473a4a-88c7-415d-957b-01aac31673c0"
        }

Quick reply response message (bot):

Name

Type

Description

quickReplyId

Status
titlestring

id of the quick reply message whose response is referring to

reply

Status
titlestring

quick reply chosen

user

Status
titleobject

Semplified user object containing only user id and isAgent properties of the user who sent the message.

Example

Code Block
languagejson
        {
            "data" : {
                "replyTo" : "",
                "id" : "wamid.HBgMMzkzNDAzNjA5MTY5FQIAEhggMUM2MjFFNDYxMjIwRTYyQkNGRUVEMEVGMDE5RUVEQTcA",
                "messageType" : "QUICK_REPLY_RESPONSE",
                "content" : {
                    "quickReplyId" : "5bd5fcd0-ee5e-48c9-b825-c3e42b85cc45",
                    "reply" : "Yes",
                    "user" : {
                        "id" : "393403602702",
                        "isAgent" : false
                    }
                },
                "ts" : 1679325017885.0,
                "deliverySuccess" : true,
                "deliveryErrorReason" : ""
            },
            "room" : "CHAT_DEFAULT_e7473a4a-88c7-415d-957b-01aac31673c0"
        }

Video chat events messages:

...

Name

Type

Description

user

Status
titleobject

Semplified user object containing only user id and isAgent properties of the user who sent the message.

Example

Code Block
languagejson
{
    "data" : {
        "id" : "b88d3de0-23b8-41d1-95c3-1209dd4c8cff",
        "messageType" : "endChat",
        "ts" : 1617786896642.0,
        "deliverySuccess" : true,
        "deliveryErrorReason" : "",
        "content" : {
            "user" : {
                "isAgent" : false,
                "id" : "USER_DEFAULT_9a0a411c-f9c7-4af7-9754-024bf157a3ef"
            }
        }
    },
    "_id" : ObjectId("606d7810d6e88353f8873297"),
    "room" : "CHAT_DEFAULT_d06723cf-518e-4767-99b6-6d21d5998081"
}