Manage a Group

Add Participants#

To add a participants to a existing group use below method. You can add multiple participants by passing multiple USER_JID. Once the request is made successfully, an groupProfileListener callback will be triggered and response will be received for all group participants.

await SDK.addParticipants(`GROUP_JID`, `GROUP_NAME`, [`USER_JID`]);

Request Params#

StatusDescriptionTypeRequired
GROUP_JIDGroup JIDJID Stringtrue
GROUP_NAMEGroup NameStringtrue
USER_JIDArray of To User JIDJID Stringtrue

Remove Participant#

To remove a participant from a existing group use below method. Once the request is made successfully, an groupProfileListener callback will be triggered and response will be received for all group participants.

await SDK.removeParticipant(`GROUP_JID`, `USER_JID`, `IS_ADMIN`);

Request Params#

StatusDescriptionTypeRequired
GROUP_JIDGroup JIDJID Stringtrue
USER_JIDUser JIDJID Stringtrue
IS_ADMINWhether the To User is Admin or notBooleantrue

Make As Admin#

To make a participant as a admin to the group. Once the request is made successfully, an groupProfileListener callback will be triggered and response will be received for all group participants.

await SDK.makeAsAdmin(`GROUP_JID`, `USER_JID`);

Request Params#

StatusDescriptionTypeRequired
GROUP_JIDGroup JIDJID Stringtrue
USER_JIDUser JIDJID Stringtrue

Exit Group#

To leave a group for the participant use below method. If the user is admin pass isAdmin as a true, otherwise false. Once the request is made successfully, an groupProfileListener callback will be triggered and response will be received for all group participants.

await SDK.userExitGroup(`GROUP_JID`,`IS_ADMIN`);

Request Params#

StatusDescriptionTypeRequired
GROUP_JIDGroup JIDJID Stringtrue
USER_JIDUser JIDJID Stringtrue
IS_ADMINWhether the User is Admin or notStringtrue