Skip to main content

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 NameDescriptionTypeRequired
messageIdthe id of the message that you want to reply to.StringYes
messagethe message that you want to send as replyStringYes

Properties

Reply Message Object

PropertiesDescriptionType
_idid of the reply messageString
likesnumber of likes of the messageArray
chatRoomChat Room to which message was sentString
messagethe message itselfString
useruser object that contains details about the userObject
CustomercustomerIdString
repliedToThe message to which this message is the reply toObject

user

PropertiesDescriptionType
_idid of the userString
usernameusername of the userString
claimedthe user profile is claimed or not (to be deprecated)Boolean
verifiedthe user profile is verified or not (to be deprecated)Boolean
customercustomer idString
emailuser emailString
parentCustomerAccountcustomer idString
createdwhen the message was createdString
updatedwhen the message was updatedString

repliedTo

PropertiesDescriptionType
_idid of the reply messageString
messagemessageString
usernameusername of the user that sent the original messageString
messageCreatedAtdate and time when the message was createdString
userIduser id of the user who sent the messageString
messageIdid of the original messageString

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