Name | Type | Description |
---|---|---|
_id | STRING | Internal object identifier |
room | STRING | Chat unique identifier |
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 |
isAgent | BOOLEAN | Indicates if the person who sent the message is an agent |
id [user object] | STRING | user unique identifier |
firstIP | STRING | Agent/customer IP |
text | STRING | Only in “TEXT” message, contains the message sent |
img | STRING | Contains base64 image message |
caption | STRING | Message caption |
documentType | STRING | Document format |
fileName | STRING | Contains name of the document/image message |
url | STRING | Contains the url of the link message |
deliverySuccess | BOOLEAN | Indicates if the message has been succesfully delivered |
deliveryErrorReason | STRING | In case of delivery failed, describes the error occurred |
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" : "aWdfZAG1faXRlbToxOklHTWVzc2FnZAUlEOjE3ODQxNDUwODQxMzk0OTA4OjM0MDI4MjM2Njg0MTcxMDMwMDk0OTEyODE2NzQwNTg4MTcxMjQ0NzozMDMwMDcwMTg3NTA5MTIwMjkwMzUzNDkzMzgzMjEwNTk4NAZDZD", "messageType" : "TEXT", "content" : { "text" : "prova1", "user" : { "id" : "4747235938674011", "isAgent" : false } }, "ts" : 1642604343631.0, "deliverySuccess" : true, "deliveryErrorReason" : "" }, "_id" : ObjectId("61e8277aef3d6b076066d287"), "room" : "CHAT_DEFAULT_8857106a-55b8-4c47-a5af-a3aae7530e5a" }
Image 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" : { "id" : "781d3c44-f0b9-434b-9a09-6f5e5dcb69b0", "messageType" : "IMAGE", "content" : { "caption" : "IMG", "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" : 1617789849117.0, "deliverySuccess" : true, "deliveryErrorReason" : "" }, "_id" : ObjectId("606d83d5d6e88353f88732ac"), "room" : "CHAT_DEFAULT_18234ff1-4a0e-4668-b002-16bf3cfbdb7d" }
Document message:
{ "data" : { "id" : "01699cb3-f546-46a9-90ca-99920ab7a78b", "messageType" : "DOCUMENT", "content" : { "caption" : "DOC", "fileName" : "WhatsApp - omnichannel API quick guide.pdf", "documentType" : "pdf", "user" : { "id" : "USER_DEFAULT_9a0a411c-f9c7-4af7-9754-024bf157a3ef", "isAgent" : false } }, "ts" : 1617789899566.0, "deliverySuccess" : true, "deliveryErrorReason" : "" }, "_id" : ObjectId("606d83d5d6e88353f88732ab"), "room" : "CHAT_DEFAULT_18234ff1-4a0e-4668-b002-16bf3cfbdb7d" }
Link message:
{ "data" : { "id" : "e4d0124e-61f6-4853-bbb5-4e803a38c474", "messageType" : "LINK", "content" : { "url" : "https://www.google.it", "user" : { "id" : "USER_DEFAULT_9a0a411c-f9c7-4af7-9754-024bf157a3ef", "isAgent" : false } }, "ts" : 1617789824454.0, "deliverySuccess" : true, "deliveryErrorReason" : "" }, "_id" : ObjectId("606d83d5d6e88353f88732ad"), "room" : "CHAT_DEFAULT_18234ff1-4a0e-4668-b002-16bf3cfbdb7d" }
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:
{ "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" }