Name | Type | Description |
---|---|---|
_id | STRING | Internal object identifier |
room | STRING | Chat unique identifier |
messages | ARRAY | Array containing chat messages |
id [message object] | STRING | message unique identifier |
messageType | STRING | Type of the message. Can assume one of the following values: “TEXT” “IMAGE” “DOCUMENT” “LINK” |
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. |
ts | NUMBER | Timestamp of when message was sent |
url | STRING | Contains the url of the link message |
id [content object] | STRING | Contains the id of the multimedia message sent. |
Example
{ "_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":"61837323-efd0-4876-82a4-e7078d7f79c0", "messageType":"IMAGE", "ts":1569569972480.0 }, "_id":"5d8dbcdaf6a71d3120275019", "room":"CHAT_1c5e4ed8-b675-46f9-866e-b4fc1d893a72" }, { "data":{ "id":"bb0d0faf-a650-4d9a-8fde-fb1b00bcf4d4", "messageType":"DOCUMENT", "ts":1569569995033.0 }, "_id":"5d8dbcdaf6a71d3120275018", "room":"CHAT_1c5e4ed8-b675-46f9-866e-b4fc1d893a72" } ], "__v":0 }