Skip to main content

Post Conversation

LikeMinds Flutter 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

  1. Create an object of the PostConversationRequest class using the PostConversationRequestBuilder class and specify the chatroom id, text.
  2. For posting a conversation call postConversation() present in LMChatClient class using your request object.
  3. Process the response (LMResponse<PostConversationResponse>) as per your requirement.
PostConversationRequest request = (PostConversationRequestBuilder()
..chatroomId(70989)
..text("This is a test message from the SDK")
..expiryTime(0))
.build();

LMResponse<PostConversationResponse> response =
await lmChatClient.postConversation(request);

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

Models

PostConversationRequest

List of parameters for the PostConversationRequest class

VariableTypeDescriptionOptional
chatroomIdintChatroom Id
textStringText to be posted
expiryTimeint?Expiry time of the conversation✔️
replyIdint?ID of the conversation to which the reply is being posted✔️
temporaryIdStringTemporary ID of the conversation
hasFilesboolWhether the conversation has files
attachmentCountintNumber of attachments in the conversation

PostConversationResponse

List of parameters for the PostConversationResponse class

VariableTypeDescriptionOptional
successboolAPI success status
errorMessageString?Error message in case of failure✔️
conversationConversation?Conversation object✔️