Skip to main content

Secret Chatroom Invite

LikeMinds React Chat SDK offers a convenient feature for sending secret chatroom invites. It allows you to send invites to a specific user within a group chat.

Steps to send Secret Chatroom Invite to a participant

  1. Get the list of participants using getAllMembers() method.
  2. Send Invite to selected members using sendInvites() method.
  3. Pass in the required parameters chatroomId, isSecret and chatroomParticipants.
  4. Process the response as per your requirement.
const payload: any = {
chatroomId: 89899, // Id of the chatroom
isSecret: true, // false if chatroom is open
chatroomParticipants: [], // list of memberId's of selected members
};
const response = await lmChatClient.sendInvites(payload);

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

Secret Chatroom Invite Payload

List of parameters for the sendInvites function.

VariableTypeDescriptionOptional
chatroomIdnumberChatroom Id
isSecretbooleantrue if chatroom is secret
chatroomParticipantsarrayList of participants

Secret Chatroom Invite Response

List of parameters in the response.

VariableTypeDescription
successbooleanAPI success status
error_messagestringError message in case of failure