Calling this interface will remove all users from the room and close the room.
If the developer has referred to Setting up server-to-server callbacks and configured Callback on logged out room and Callback on stream closed, when the server calls this interface:
After the room is closed, the client users will be kicked out of the room and will receive ZEGOCLOUD SDK callback interfaces:
ZegoExpress SDK | LiveRoom SDK | |
---|---|---|
iOS/macOS | onRoomStateChanged | onKickout |
Android | onRoomStateChanged | onKickout |
Windows | onRoomStateChanged | OnKickOut |
Web | roomStateChanged | onKickout |
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 Server APIs public request parameters.
Parameter | Type | Required | Description |
---|---|---|---|
RoomId |
String |
Yes |
Room ID. |
CustomReason |
String |
No |
Reason for closure, with a maximum length of 256 bytes. When using, please UrlEncode the content of this parameter. |
RoomCloseCallback |
Boolean |
No |
Whether to generate a room close callback, default is false. Since it is usually an actively initiated closure by the developer, there is no need to notify the developer through the room close callback. If you need to perform unified logic processing through the room close callback, you can modify it to true. This parameter only affects whether a room close callback is generated. Other callback notifications that cause the room to close (such as `exit room callback`) are not affected. |
https://rtc-api.zego.im/?Action=CloseRoom
&RoomId=room1
&CustomReason=clear
&RoomCloseCallback=false
&<Public Request Parameters>
Parameter | Type | Description |
---|---|---|
Code |
Int32 |
Return code. |
Message |
String |
Description of the operation result. |
RequestId |
String |
Request ID. |
{
"Code": 0,
"Message": "success",
"RequestId": "TestRequestId1642755866616219000"
}
Listed below are the return codes related to this API. For the complete list of return codes, see Return codes.
Return Code | Description | Suggested Action |
---|---|---|
5018 | The room has been destroyed or does not exist. | Please verify if the requested room with RoomId exists. |
5024 | The room does not exist, same as internal logic for 104 and 50001. | Please verify if the requested room with RoomId exists. |