Skip to main content

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

  1. To fetch conversations for a chatroom, use the method getConversation() provided by the client.
  2. Pass in the required parameter chatroomID and page.
  3. 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().

VariableTypeDescriptionOptional
chatroomIDnumberChatroom Id
paginateBynumberPage size for API response✔️
conversationIDnumberLast conversation id✔️
scrollDirectionnumberscroll direction✔️

Get Conversation Response

List of parameters in the response.

VariableTypeDescription
successbooleanAPI success status
error_messageStringError message in case of failure
conversationsListList of conversations