Remove users in the group by specifying their user IDs.
User IDs in the group can be obtained by Query group member list.
After a user is successfully removed, all group members (including the group owner and the removed member) will receive a ZIM SDK callback interface:
iOS | Android | macOS | Windows |
---|---|---|---|
Web | Flutter | Reactive Native | Unity3D |
Listed below are the parameters specific to this request and part of the public request parameters. For the complete list of public request parameters, see Accessing Server APIs - Public parameters.
Parameter | Type | Required | Description |
---|---|---|---|
FromUserId |
String |
Yes |
User ID of the operator. |
GroupId |
String |
Yes |
Group ID. |
UserId[] |
Array of String |
Yes |
A list of user IDs to be removed, supporting up to 50 user IDs. Example: "UserId": ["usera","userb"] |
CustomReason |
String |
No |
The reason for removal, with a length limit of 32 bytes. |
FromUserId, GroupId, UserId[], and CustomReason only support numbers, English characters, and '!', '#', '$', '%', '&', '(', ')', '+', '-', ':', ';', '<', '=', '.', '>', '?', '@', '[', ', ',']', '^', '_', '{', '|', '}', '~', and ' '.
Sample request URL:
https://zim-api.zego.im/?Action=KickoutGroupUser
&<public request parameter>
Request body:
{
"FromUserId":"zego_user",
"GroupId":"groupA",
"CustomReason":"reason",
"UserId":["userA"]
}
Parameter | Type | Description |
---|---|---|
Code |
Number |
Return code.
If you remove multiple users at the same time:
|
Message |
String |
The description information of the request result. |
RequestId |
String |
Request ID. |
ErrorList |
Array of String |
A list of failed operations. |
UserId |
String |
User ID of the removal failure. |
SubCode |
Number |
Error code of the removal failure. |
{
"Code":0,
"Message":"success",
"RequestId":"343649807833778782",
"ErrorList": [
{
"UserId":"u2",
"SubCode":660000012
}
]
}
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 | Processing Suggestions |
---|---|---|
660000002 |
Parameter error. |
Please refer to the correct parameters in Request Parameters. |
660000011 |
The number of users to be removed exceeds the limit. |
The number should not exceed 50. |
660600001 |
The group does not exist. |
Please confirm the GroupId is correct. |
660600005 |
The call frequency of the KickoutGroupUser interface exceeds the limit. |
The rate limit is 20 requests/second, please do not exceed the limit. |
61103 |
The user to be removed is not in the group. |
No need to process. |