Name | Type | Description |
---|---|---|
room | STRING | Chat unique identifier |
data | OBJECT | Object containing message info. See message data object for more details. |
Message Data Object
Name | Type | Description |
---|---|---|
id | STRING | message unique identifier |
messageType | STRING | Type of the message. Can assume one of the following values: “TEXT” “IMAGE” “DOCUMENT” “LINK” “videoRequestedByAgent” “videoRequestedByCustomer” “videoAccepted” “videoRejected” “videoStarted” “videoEnded” “screenSharingStarted” “screenSharingEnded” “endChat” “leave” |
ts | NUMBER | Timestamp of when message was sent |
deliverySuccess | BOOLEAN | Indicates if the message has been succesfully delivered |
deliveryErrorReason | STRING | In case of delivery failed, describes the error occurred |
replyTo | STRING | Message ID you are replying to |
content | OBJECT | Message content. See message content object for more details. |
Message Content Object
The structure of the message content depends on the messageType property
Text message
Name | Type | Description |
---|---|---|
text | STRING | Only in “TEXT” message, contains the message sent |
user | OBJECT | Semplified user object containing only user id and isAgent properties of the user who sent the message. |
Example
{ "data" : { "replyTo" : "", "id" : "e857df30-76a4-4c6c-b4a5-4faed2ed6f45", "messageType" : "TEXT", "content" : { "text" : "Buongiorno, sono l'operatore Gabriele Verde, come posso esserle utile?", "user" : { "id" : "USER_gverde1@acd.enghouse.com", "isAgent" : true } }, "ts" : 1643191581119.0, "deliverySuccess" : true, "deliveryErrorReason" : "" }, "_id" : ObjectId("61f11d7cd42454470cb22da4"), "room" : "CHAT_DEFAULT_a098a0bc-b34c-452c-829c-1b03aa7a67ee" }
Image message
Name | Type | Description |
---|---|---|
caption | STRING | Message caption |
fileName | STRING | Contains name of the document/image message |
documentType | STRING | Document format |
user | OBJECT | Semplified user object containing only user id and isAgent properties of the user who sent the message. |
Example
{ "data" : { "replyTo" : "", "id" : "03250778-0425-47c1-92c1-85d1840bef7c", "messageType" : "IMAGE", "content" : { "caption" : "", "fileName" : "45971097-illustrazione-di-happy-emoticon-dà-pollice-in-su-isolato-su-sfondo-bianco.jpg", "documentType" : "jpg", "user" : { "id" : "USER_DEFAULT_9a0a411c-f9c7-4af7-9754-024bf157a3ef", "isAgent" : false } }, "ts" : 1643191627987.0, "deliverySuccess" : true, "deliveryErrorReason" : "" }, "_id" : ObjectId("61f11d7cd42454470cb22da5"), "room" : "CHAT_DEFAULT_a098a0bc-b34c-452c-829c-1b03aa7a67ee" }
Document message:
Name | Type | Description |
---|---|---|
caption | STRING | Message caption |
fileName | STRING | Contains name of the document/image message |
documentType | STRING | Document format |
user | OBJECT | Semplified user object containing only user id and isAgent properties of the user who sent the message. |
Example
{ "data" : { "replyTo" : "", "id" : "16daf4d4-a77f-406f-ab75-0475f510bc95", "messageType" : "DOCUMENT", "content" : { "caption" : "", "fileName" : "WHATSAPP-TEMPLATE-AD-v09.xlsx", "documentType" : "xlsx", "user" : { "id" : "USER_gverde1@acd.enghouse.com", "isAgent" : true } }, "ts" : 1643191652417.0, "deliverySuccess" : true, "deliveryErrorReason" : "" }, "_id" : ObjectId("61f11d7cd42454470cb22da6"), "room" : "CHAT_DEFAULT_a098a0bc-b34c-452c-829c-1b03aa7a67ee" }
Link message:
Name | Type | Description |
---|---|---|
url | STRING | Contains the url of the link message |
user | OBJECT | Semplified user object containing only user id and isAgent properties of the user who sent the message. |
Example
{ "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" }
Video message:
All video messages have the audio and video boolean properties to indicate the channel used.
Name | Type | Description |
---|---|---|
audio | BOOLEAN | if true the audio chennel is engaged |
video | BOOLEAN | if true the video chennel is engaged |
Examples
videoRequestedByCustomer message
{ "data" : { "id" : "c6d3e132-4432-4208-943d-cc2b34ba3107", "messageType" : "videoRequestedByCustomer", "ts" : 1617786830148.0, "deliverySuccess" : true, "deliveryErrorReason" : "", "content" : { "user" : { "isAgent" : false, "id" : "USER_DEFAULT_9a0a411c-f9c7-4af7-9754-024bf157a3ef" }, "audio" : true, "video" : true } }, "_id" : ObjectId("606d7810d6e88353f88732a1"), "room" : "CHAT_DEFAULT_d06723cf-518e-4767-99b6-6d21d5998081" }
videoAccepted message:
{ "data" : { "id" : "715a2213-3123-4718-8266-a489bebc493b", "messageType" : "videoAccepted", "ts" : 1617786834240.0, "deliverySuccess" : true, "deliveryErrorReason" : "", "content" : { "user" : { "isAgent" : true, "id" : "USER_gverde1@acd.enghouse.com" }, "audio" : true, "video" : true } }, "_id" : ObjectId("606d7810d6e88353f88732a0"), "room" : "CHAT_DEFAULT_d06723cf-518e-4767-99b6-6d21d5998081" }
videoStarted message:
{ "data" : { "id" : "cfa53427-1ee7-4e8f-9848-e8e87523aec4", "messageType" : "videoStarted", "deliverySuccess" : true, "deliveryErrorReason" : "", "ts" : 1617786839849.0, "content" : { "user" : { "isAgent" : true, "id" : "USER_gverde1@acd.enghouse.com" }, "audio" : true, "video" : true } }, "_id" : ObjectId("606d7810d6e88353f887329f"), "room" : "CHAT_DEFAULT_d06723cf-518e-4767-99b6-6d21d5998081" }
screenSharingStarted message:
{ "data" : { "id" : "227130be-f490-4ef2-9923-9bb69ad6756c", "messageType" : "screenSharingStarted", "deliverySuccess" : true, "deliveryErrorReason" : "", "ts" : 1617786873764.0, "content" : { "user" : { "isAgent" : true, "id" : "USER_gverde1@acd.enghouse.com" }, "audio" : true, "video" : true } }, "_id" : ObjectId("606d7810d6e88353f887329c"), "room" : "CHAT_DEFAULT_d06723cf-518e-4767-99b6-6d21d5998081" }
videoEnded message:
{ "data" : { "id" : "a8ffdf71-ad3e-4495-ba91-057442df88c0", "messageType" : "videoEnded", "deliverySuccess" : true, "deliveryErrorReason" : "", "ts" : 1617786886374.0, "content" : { "user" : { "isAgent" : true, "id" : "USER_gverde1@acd.enghouse.com" }, "audio" : true, "video" : true } }, "_id" : ObjectId("606d7810d6e88353f887329a"), "room" : "CHAT_DEFAULT_d06723cf-518e-4767-99b6-6d21d5998081" }
endChat message:
Name | Type | Description |
---|---|---|
user | OBJECT | Semplified user object containing only user id and isAgent properties of the user who sent the message. |
Example
{ "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" }