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 and text.
  2. Call postConversation() present in the LMChatClient class using your request object.
  3. Process the response LMResponse<PostConversationResponse> as per your requirement.
PostConversationRequest request = (PostConversationRequestBuilder()
..chatroomId("ENTER_CHATROOM_ID")
..text("ENTER_TEXT")
..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
replyIdint?ID of the conversation to which the reply is being posted✔️
temporaryIdStringTemporary ID of the conversation
hasFilesboolWhether the conversation has files
attachmentsList<Attachment>?List of attachments in the conversation✔️
ogTagsOgTags?Open Graph tags for the conversation✔️
shareLinkString?A link to be shared with the conversation✔️
triggerBotbool?Whether to trigger a bot after posting the conversation✔️

PostConversationResponse

List of parameters for the PostConversationResponse class

VariableTypeDescriptionOptional
conversationConversation?Conversation object✔️
idint?The ID of the posted conversation✔️