Name | Type | Description |
---|---|---|
_id | STRING | Internal object identifier |
room | STRING | Chat unique identifier |
ctlive_type | STRING | Chat type according to the initiator. Can be one of the following values: “chat” “cbn” “cbl” “cbfs” “call” |
messages | ARRAY | Array containing chat messages. See Message Object for more details. |
Message Object
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” |
ts | NUMBER | Timestamp of when message was sent |
deliverySuccess | BOOLEAN | Indicates whether the message was sent successfully |
deliveryErrorReason | STRING | Error occurred if the message was not sent correctly |
replyTo | STRING | Message ID you are replying to |
content | OBJECT | Message content. See message content object for more details. |
Message Content Object
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. |
url | STRING | Contains the url of the link message |
Example
{ "_id" : "CHAT_DEFAULT_8857106a-55b8-4c47-a5af-a3aae7530e5a", "room" : "CHAT_DEFAULT_8857106a-55b8-4c47-a5af-a3aae7530e5a", "ctlive_type" : "chat", "messages" : [ { "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" }, { "data" : { "replyTo" : "", "id" : "fb32e661-136d-4867-a1f8-a31eca5b673a", "messageType" : "TEXT", "content" : { "text" : "Buongiorno, sono l'operatore Gabriele Verde, come posso esserle utile?", "user" : { "id" : "USER_gverde1@acd.enghouse.com", "isAgent" : true } }, "ts" : 1642604351616.0 }, "_id" : ObjectId("61e8277aef3d6b076066d288"), "room" : "CHAT_DEFAULT_8857106a-55b8-4c47-a5af-a3aae7530e5a" }, { "data" : { "replyTo" : "", "id" : "ba35d81d-d56e-49b4-ae17-020b9e477281", "messageType" : "endChat", "ts" : 1642604409492.0, "deliverySuccess" : true, "deliveryErrorReason" : "", "content" : { "user" : { "isAgent" : true, "id" : "USER_gverde1@acd.enghouse.com" } } }, "_id" : ObjectId("61e8277aef3d6b076066d289"), "room" : "CHAT_DEFAULT_8857106a-55b8-4c47-a5af-a3aae7530e5a" } ], "__v" : 0 }