You can call this operation to batch add up to 100 users to a specified group chat. If you need a higher limit, contact ZEGOCLOUD technical support.
After users are added, all group members, including newly added ones, receive the notification in the following ZIM SDK callbacks.
iOS | Android | macOS | Windows | Web |
---|---|---|---|---|
Flutter | Unity3D | React Native | ||
The following table describes only the operation-specific request parameters and some common request parameters. For the complete list of common request parameters, see the Public request parameters section of the Accessing Server APIs topic.
Parameter | Type | Required | Description |
---|---|---|---|
FromUserId |
String |
Yes |
Operator user ID. Users need to have registered for the ZIM service. |
GroupId |
String |
Yes |
Group ID. |
UserIds |
Array of String |
Yes |
List of user IDs to join the group. By default, a maximum of 100 user IDs are supported.
|
GroupMemberInfos |
Array of Object |
Yes |
List of user information that joins the group. By default, it supports a maximum of 100 user information. |
UserId |
String |
Yes |
The ID of the user joining the group. |
EnterGroupTime |
Number |
No |
Group entry timestamp (millisecond level).
|
IsInvite |
Number |
No |
The user's group joining mode.
|
The FromUserId
, GroupId
, and UserIds
parameters can contain only digits, letters, and the following characters: '!', '#', '$', '%', '&', '(', ')', '+', '', ':', ';', '<', '=', '.', '>', '?', '@', '[', ']', '^', '_', '{', '}', '|', '~'.
Request URL
https://zim-api.zego.im/?Action=InviteUsersIntoGroup
&<Common request parameters>
Request body
{
"FromUserId": "zego_user",
"GroupId": "groupA",
"UserIds": [
"usera",
"userb"
]
}
Parameter | Type | Description |
---|---|---|
Code |
Number |
The return code. |
Message |
String |
The description of the operation result. |
RequestId |
String |
The request ID. |
ErrorList |
Array of Object |
The list of failed results.
|
UserId |
String |
The ID of the user who fails to be added. |
SubCode |
Number |
The code returned when the request fails. |
{
"FromUserId": "zego_user",
"GroupId": "groupA",
"GroupMemberInfos": [
{
"UserId": "user_a",
"EnterGroupTime": 123
},
{
"UserId": "user_b",
"EnterGroupTime": 0
}
]
}
The following table describes only the return codes related to the business logic of the operation. For the complete list of return codes, see Return codes.
Return Code | Description | Solution |
---|---|---|
660000002 |
Invalid parameter. |
Check the input parameter. |
660300006 |
The QPS limit is exceeded. |
Please try again later, or check the QPS limit. |
660500002 |
The operator is not registered. |
Register the operator. |
660600001 |
The group chat does not exist. |
Check whether the value of the GroupID parameter is valid. |
660000011 |
Too many users are included in the list. |
Check the number of users. |