Add members

To add one or more members to an existing group use below API.

info

{your-domain-name} can be obtained from the MirrorFly console.

HTTP request#

curl -X PUT "https://{your-domain-name}/api/v1/group/addParticipant"
-H "accept: */*"
-H "Authorization: xxxxxxxxxxxxxxxxxx"
-H "Content-Type: application/json"
-d "{ \"groupId\": \"xxxxxxx\", \"groupMembers\": [{\"admin\": xxxx, \"jid\": \"xxxxxxxxx\"}] }"

Request Params#

ParamDataTypeRequiredDescription
groupIdStringYesId of the group to add members
groupMembersArray of objectsYesList of members to be added to this group
groupMembers.adminbooleanYesWhether to add this member as admin
groupMembers.jidStringYesId of the member to be added

Responses#

If successful, this action adds one or more provided members to this group.

{
"status": 200,
"data": {
"groupId": "Sample group name"
},
"message": "Group participant added successfully"
}

Error#

In the case of an error, an error object like below is returned.

When the token passed in Headers is expired

{
"status": 401,
"message": "Token Expired"
}

In the case of a Bad Request, an error message is returned

{
"status": 400,
"message": "Error Message"
}