Skip to main content

Search Conversation

LikeMinds React Chat SDK provides you with the ability to search for the conversations inside a chatroom. This enables you to quickly look for the conversation through a search key instead of endlessly scrolling up for that.

Steps to Search for a conversation inside a chatroom

  1. To search for the desired chatroom use the searchConversation() function provided by the SDK.
  2. Pass in the essential payload.
  3. Parse the response as per your requirement.
const payload: any = {
chatroomId: 89899,
search: "search key",
followStatus: true,
page: 1,
pageSize: 10,
};
const response = await lmChatClient.searchConversation(payload);

if (response.success) {
// your function to process the response data
processResponse(response);
} else {
// your function to process error message
processError(response);
}

Search Chatroom payload

List of parameters provided by the searchConversation()

VariableTypeDescriptionOptional
followStatusbooleanTo indicate whther to search for an already following chatroom or run for unfollowed one
pagenumberPage
pageSizenumberQueries returned in each pagesize
searchTypestringCan take two values, header or title string
searchstringKey to search for
chatroomIdstringId of the chatroom

Search Chatroom Payload

List of parameters in the response.

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