Message
When a new chat message is sent this event is triggered.
JavaScript
frame1.on("message", (message) => {
console.log("new message", message);
});
Properties
Properties | Description | Type |
---|---|---|
_id | id of the message | String |
likes | array of likes | Array |
created | when the chat message was created | String |
chatRoom | chat room id | String |
message | message that was sent | String |
user | user object | Object |
Customer | customer id | String |
user
Properties | Description | Type |
---|---|---|
_id | id of the user | String |
username | username of the user | String |
claimed | the user profile is claimed or not (to be deprecated) | Boolean |
verified | the user profile is verified or not (to be deprecated) | Boolean |
customer | customer id | String |
user email | String | |
parentCustomerAccount | customer id | String |
created | when the message was created | String |
updated | when the message was updated | String |
JSON Sample Response
{
"_id": "632a11a5f0357f1c648791eb",
"likes": [],
"created": "2022-09-20T19:16:53.848Z",
"chatRoom": "631794a83671700c713b1ce6",
"message": "fsdfsdfsdfsdsdfsd",
"user": {
"_id": "63233015c3aa3508a4c8fc34",
"username": "support",
"claimed": true,
"verified": true,
"customer": "631794a83671700c713b1ce5",
"email": "support@deadsimplechat.com",
"parentCustomerAccount": "631794a83671700c713b1ce5",
"created": "2022-09-15T14:00:53.180Z",
"updated": "2022-09-20T14:50:58.055Z",
"__v": 0,
"webSocketId": "MbXsd2tLpqwhiAE3AAAh"
},
"customer": "631794a83671700c713b1ce5"
}