Skip to main content

Get Conversation

LikeMinds React Native Chat SDK offers this feature which enables you to access and analyze individual conversations, empowering you to implement customized functionalities or perform specific operations within your chat application.

Steps to Get a Single Conversation

  1. Create a syncConversationRequest object using SyncConversationRequest.builder class by passing all the required parameters.
  2. Call syncConversation() function using the instance of lmChatClient.
  3. Process the response LMResponse<SyncConversationResponse> as per your requirement.
const syncConversationRequest = SyncConversationRequest.builder()
.setChatroomId(86490)
.setPage(1)
.setMinTimestamp(0)
.setMaxTimestamp(Date.now())
.setPageSize(500)
.setConversationId(56656)
.build();
const repsonse = lmChatClient?.syncConversation(syncConversationRequest);

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

Sync Conversation Payload

List of parameters provided by syncConversation().

VariableTypeDescriptionOptional
chatroomIdnumberchatroom Id
conversationIdnumber?conversation id for which you want to get the conversation
pagenumberpage number
pageSizenumberpage size for paginated response
maxTimestampnumbermaximum timestamp
minTimestampnumberminimum timestamp

Sync Conversation Response

List of parameters in the response.

VariableTypeDescriptionOptional
successbooleanAPI success status
error_messagestringError message in case of failure✔️
userMetaMemberUser data
conversationMetaConversationConversation data
conversationDataConversation[]List of conversations
communityMetaCommunityCommunity data
chatroomsMetaChatroomChatroom data
chatroomReactionsMetaReactionMeta[]List of reactions
convReactionsMetaReactionMeta[]List of reactions
convAttachmentsMetaAttachment[]List of attachments
convPollsMetaPoll[]List of Polls