...
Name | Type | Description | ||||
---|---|---|---|---|---|---|
id |
| message unique identifier | ||||
messageType |
| 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 |
| Timestamp of when message was sent | ||||
deliverySuccess |
| Indicates if the message has been succesfully delivered | ||||
deliveryErrorReason |
| In case of delivery failed, describes the error occurred | ||||
replyTo |
| Message ID you are replying to | ||||
content |
| Message content. See message content object for more details. |
...
Code Block | ||
---|---|---|
| ||
{
"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 |
| Menu title | ||||
options |
| Array of objects for the various possibilities of choice. See the next section for more details. |
option object:
Name | Type | Description | ||||
---|---|---|---|---|---|---|
id |
| Unique option id | ||||
command |
| Menu action. Can assume one of the following values:
| ||||
text |
| label shown in the option | ||||
targetUrl |
| text to send as a next query to the bot | ||||
params |
| array of two objects that specify how to open the external url. The first object has two properties:
The second object has two properties:
|
Example
Code Block | ||
---|---|---|
| ||
{
"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 |
| Id of the “MENU” message which was replied to | ||||
option |
| Response that was chosen by the user. See the next section for more details |
option object:
Name | Type | Description | ||||
---|---|---|---|---|---|---|
id |
| Id of the response chosen | ||||
targetUrl |
| query sent to the bot |
Example
Code Block | ||
---|---|---|
| ||
{
"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 |
| Semplified user object containing only user id and isAgent properties of the user who sent the message. |
Example
Code Block | ||
---|---|---|
| ||
{ "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" } |