Get Conversations
Simplify your chat application development with LikeMinds React Chat SDK. Enhance user conversations, enable real-time messaging, and provide seamless communication experiences with minimal coding effort. By utilizing this feature you can view all the conversations in the chatroom.
Steps to fetch Conversations inside a Chatroom
- To fetch conversations for a chatroom, use the method
getConversation()
provided by the client. - Pass in the required parameter
chatroomID
andpage
. - Process the response as per your requirement.
const payload: any = {
chatroomID: 89899, // Pass in the chatroomId
paginateBy: 10, // Pass in the page size.
topNavigate: false,
};
const response = await lmChatClient.getConversation(payload);
if (response.success) {
// your function to process the response data
processResponse(response);
} else {
// your function to process error message
processError(response);
}
Get Conversation Payload
List of parameters provided by getConversation()
.
Variable | Type | Description | Optional |
---|---|---|---|
chatroomID | number | Chatroom Id | |
paginateBy | number | Page size for API response | ✔️ |
conversationID | number | Last conversation id | ✔️ |
scrollDirection | number | scroll direction | ✔️ |
Get 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 |
conversations | List | List of conversations |