replyMessage(options);
Call this method to reply to a message.
JavaScript
sdk.replyMessage(messageId, message);
Example
In the example below we have replied to a message with ID: "6323922af0357f1c64879198" and our reply is I am fine.
sdk.replyMessage("6323922af0357f1c64879198", "I am fine");
replyMessage(options)
Parameter Name | Description | Type | Required |
---|---|---|---|
messageId | the id of the message that you want to reply to. | String | Yes |
message | the message that you want to send as reply | String | Yes |
Properties
Reply Message Object
Properties | Description | Type |
---|---|---|
_id | id of the reply message | String |
likes | number of likes of the message | Array |
chatRoom | Chat Room to which message was sent | String |
message | the message itself | String |
user | user object that contains details about the user | Object |
Customer | customerId | String |
repliedTo | The message to which this message is the reply to | Object |
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 |
repliedTo
Properties | Description | Type |
---|---|---|
_id | id of the reply message | String |
message | message | String |
username | username of the user that sent the original message | String |
messageCreatedAt | date and time when the message was created | String |
userId | user id of the user who sent the message | String |
messageId | id of the original message | String |
Sample Response
JSON Sample Response
{
"_id": "6323922af0357f1c64879197",
"likes": [],
"created": "2022-09-15T20:59:22.593Z",
"chatRoom": "631794a83671700c713b1ce6",
"message": "I am fine",
"user": {
"_id": "63233015c3aa3508a4c8fc34",
"username": "steve",
"claimed": true,
"verified": true,
"customer": "631794a83671700c713b1ce5",
"email": "user@deadsimplechat.com",
"parentCustomerAccount": "631794a83671700c713b1ce5",
"created": "2022-09-15T14:00:53.180Z",
"updated": "2022-09-15T19:39:37.169Z",
"__v": 0,
"webSocketId": "buKg7oFyMMQkmFP7AAAD"
},
"customer": "631794a83671700c713b1ce5",
"repliedTo": {
"_id": "6323922af0357f1c64879198",
"message": "How are you?",
"username": "mike",
"messageCreatedAt": "2022-09-15T19:39:58.157Z",
"userId": "63233015c3aa3508a4c8fc34",
"messageId": "63237f8ef0357f1c64879194"
}
}
Response
This method provides no response