Remove users from a room
Description
By this API, you can remove the specified users from a room. When you find that a user violates the room rules, the user can be removed from the room through this method.
The client will receive notifications through the following event callbacks when an existing user is removed from the room, or in-room users leave.
Platform | User being removed from the room | User status changes in the room |
---|---|---|
iOS/macOS | zim:roomStateChanged:event:extendedData: | zim:roomMemberLeft:roomID: |
Android | onRoomStateChanged | onRoomMemberLeft |
Windows | onRoomStateChanged | onRoomMemberLeft |
Web | roomStateChanged | roomMemberLeft |
Request method and endpoint
- Request method: GET
- Request URL:
https://zim-api.zego.im/?Action=KickoutRoomUser
- Transmission protocol: HTTPS
- QPS limit: 20 requests/second
Request parameters
Listed below are the parameters specific to this request and part of the common request parameters. For the complete list of common request parameters, see Accessing Server APIs - Common parameters.
Parameter | Type | Required | Description |
---|---|---|---|
RoomId | String | Yes | Room ID. |
UserId[] | Array of String | Yes | The list of user IDs to be removed, up tp 50 user IDs are supported.
For example: UserId[]=a&UserId[]=b |
CustomReason | String | No | The reason for removing the user. Shorter than 32 bytes is recommended. |
The RoomId
and UserId
can only contain numbers, letters, and the following special characters: !#$%&()+-:;<=.>?@[]^_{}|~.
Sample request
https://zim-api.zego.im/?Action=KickoutRoomUser
&RoomId=123
&UserId[]=a&UserId[]=b
&CustomReason=reason
&<Common parameters>
Response parameters
Parameter | Type | Description |
---|---|---|
Code | Number | Return code. |
Message | String | Description of the request execution result. |
RequestId | String | Request ID. |
Sample response
{
"Code":0,
"Message":"success",
"RequestId":"343649807833778782"
}
Return codes
Listed below are the return codes related to this API. For the complete list of return codes, see Return codes.
Return code | Description |
---|---|
660000011 | The number of users exceeds the limit. |
660300001 | The room does not exist. |
660300002 | The user is not in this room. |