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”

“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.

...

Code Block
languagejson
{
    "data" : {
        "replyTo" : "",
        "id" : "17909c52-1f26-402c-90cb-3106ba80bb3b",
        "messageType" : "LINK",
        "content" : {
            "url" : "https://www.google.it",
            "user" : {
                "id" : "USER_gverde1@acd.enghouse.com",
                "isAgent" : true
            }
        },
        "ts" : 1643191666618.0,
        "deliverySuccess" : true,
        "deliveryErrorReason" : ""
    },
    "_id" : ObjectId("61f11d7cd42454470cb22da7"),
    "room" : "CHAT_DEFAULT_a098a0bc-b34c-452c-829c-1b03aa7a67ee"
}

Menu message (bot):

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.

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.

Example

Code Block
languagejson
        {
            "data" : {
                "replyTo" : "",
                "id" : "d77210fa-4aa2-4876-8fcc-8eaf43122987",
                "messageType" : "MENU",
                "content" : {
                    "text" : "Scegli un'opzione:",
                    "options" : [ 
                        {
                            "id" : 0,
                            "command" : "load-item",
                            "text" : "prenotazione volo",
                            "targetUrl" : "vorrei prenotare un volo"
                        }, 
                        {
                            "id" : 1,
                            "command" : "open-url",
                            "params" : [ 
                                {
                                    "name" : "method",
                                    "text" : "GET"
                                }, 
                                {
                                    "name" : "where",
                                    "text" : "_blank"
                                }
                            ],
                            "text" : "google",
                            "targetUrl" : "https://www.google.it"
                        }, 
                        {
                            "id" : 2,
                            "command" : "open-url",
                            "params" : [ 
                                {
                                    "name" : "method",
                                    "text" : "GET"
                                }, 
                                {
                                    "name" : "where",
                                    "text" : "_blank"
                                }
                            ],
                            "text" : "enghouse",
                            "targetUrl" : "https://enghouseinteractive.it/"
                        }
                    ],
                    "user" : {
                        "id" : "BOT_BOT1",
                        "isAgent" : true
                    }
                },
                "ts" : 1655210172935.0,
                "deliverySuccess" : true,
                "deliveryErrorReason" : ""
            },
            "_id" : ObjectId("62a880c20ece623848eb290a"),
            "room" : "CHAT_DEFAULT_84afbdd3-a4be-4057-ae49-32edc6802658"
        }

Menu response message (bot):

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

option object:

Name

Type

Description

id

Status
titlestring

Id of the response chosen

targetUrl

Status
titlestring

query sent to the bot

Example

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"
        }

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"
}