Post Conversation
LikeMinds React Chat SDK allows you to conveniently post a conversation in an existing chatroom by specifying the chatroom ID. This powerful feature enables you to contribute to ongoing discussions, share important information, or engage with other participants in real-time.
Steps to Post a Conversation
- To post a conversation, use the
postConversation()
method provided by the client. - Pass in the required parameter.
- Process the response as per your requirement.
const payload: any = {
text: "", // The text string representing your message
chatroomId: 89899, // Your chatroom id
hasFiles: false, // true if the conversation inclued attachments
};
const response = await lmChatClient.postConversation(payload);
if (response.success) {
// your function to process the response data
processResponse(response);
} else {
// your function to process error message
processError(response);
}
Post Conversation Payload
List of parameters provided by postConversation()
Variable | Type | Description | Optional |
---|---|---|---|
chatroomId | number | Chatroom Id | |
text | string | Text to be posted | |
hasFiles | boolean | Whether the conversation has files | |
attachmentCount | number | Number of attachments in the conversation | ✔️ |
Post Conversation Response
List of parameters in the response.
Variable | Type | Description |
---|---|---|
success | boolean | API success status |
error_message | String | Error message in case of failure |
conversation | Object | Conversation object |