...
Name | Type | Description | ||||
---|---|---|---|---|---|---|
id |
| message unique identifier | ||||
messageType |
| Type of the message. Can assume one of the following values: “TEXT” “IMAGE” “DOCUMENT” “LINK” | ||||
ts |
| Timestamp of when message was sent | ||||
deliverySuccess |
| Indicates whether the message was sent successfully | ||||
deliveryErrorReason |
| Error occurred if the message was not sent correctly | ||||
replyTo |
| Message ID you are replying to | ||||
content |
| Message content. See message content object for more details. |
Message Content Object
Name | Type | Description | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
text |
| Only in “TEXT” message, contains the message sent | |||||||||||
user |
| Semplified user object containing only user id and isAgent properties of the user who sent the message. | |||||||||||
url |
| Contains the url of the link message | id [content object] |
| Contains the id of the multimedia message sent. |
Example
Code Block | ||
---|---|---|
| ||
{ "_id":"5d8dbcdaf6a71d3120275017", "room":"CHAT_1c5e4ed8-b675-46f9-866e-b4fc1d893a72", "messages":[ { "data":{ "id":"eee89a4f-8000-4589-a5ab-c52d3b520785", "messageType":"TEXT", "content":{ "text":"hello", "user":{ "id":"USER_gverde1@acd.enghouse.com", "isAgent":true } }, "ts":1569569940285.0 }, "_id":"5d8dbcdaf6a71d312027501b", "room":"CHAT_1c5e4ed8-b675-46f9-866e-b4fc1d893a72" }, { "data":{ "id":"df7da65a-099b-40b4-a076-ff486b245afd", "messageType":"LINK", "content":{ "url":"https://www.google.com/", "user":{ "id":"USER_c8e1eb84-60d3-4d69-b10b-96364845023e", "isAgent":false } }, "ts":1569569956940.0 }, "_id":"5d8dbcdaf6a71d312027501a", "room":"CHAT_1c5e4ed8-b675-46f9-866e-b4fc1d893a72" }, { "data": { "id": "a94118a5-9536-4c8c-a3db-18d6a66673b2", "messageType": "IMAGE", "content": { "caption": "AA", "documentType": "png", "user": { "id": "USER_gverde1@acd.enghouse.com", "isAgent": true } }, "ts": 1580293820154 }, "_id": "5e315ece8a595c36a05b8de9", "room": "CHAT_DEFAULT_990d3e8b-7b1d-402b-974b-69d57ba9eaae" }, { "data": { "id": "615424ff-994e-4403-88a7-6113b9e56795", "messageType": "DOCUMENT", "content": { "caption": "BB", "documentType": "pdf", "user": { "id": "USER__eada93a1-5b87-41dd-aa81-e8f7b64d33da", "isAgent": false } }, "ts": 1580293833802 }, "_id": "5e315ece8a595c36a05b8de8", "room": "CHAT_DEFAULT_990d3e8b-7b1d-402b-974b-69d57ba9eaae" } ], "__v":0 } |