Create a Group

Groups is the simplest way to chat with multiple user at any given time.

caution

If GroupChat feature is unavailable for your plan, then the below methods will not be able to access and throw 403 exception

Create Group#

To create a new group use below method. Once the request is made successfully, an groupProfileListener callback will be triggered. Response will be of two types, one is for successfull adding of participant with both party details and other one is for group profile udpate.

While creating the group, we can set whether the users joining in the group can see the history of messages. This can be achieved through an optional parameter IS_HISTORY_ON.

await SDK.createGroup(`GROUP_NAME`, [`USER_JID`], `GROUP_IMAGE`, `IS_HISTORY_ON`);

Request Params#

StatusDescriptionTypeRequired
GROUP_NAMEGroup NameStringtrue
USER_JIDArray of User JIDJID Stringtrue
GROUP_IMAGEProfile Image - Upload an image file or image URLFile / Stringfalse
IS_HISTORY_ONisHistoryOn - Whether previous chat history is enabled or notBooleanfalse
note

The default value for IS_HISTORY_ON is false.

Example Response#

{
statusCode: 200,
message: "Success",
data: {
groupId: "0f617991-08d0-4474-ae6c-f070dc63bb1a"
groupJid: "0f617991-08d0-4474-ae6c-f070dc63bb1a@mix.xmppdomain"
}
}