在你的音视频应用中,你可能会需要封禁整个房间或房间内指定用户,以解散整个房间或移除指定用户。你可以使用 BanRoomUser 这个 OpenAPI 实现这一功能。
你可以调用 BanRoomUser 接口,指定你所属的 AppId和RoomId,封禁整个房间,或指定 AppId、RoomId和UserId封禁并移除房间内指定用户。
关于调用接口的服务地址、通信协议、字符编码和签名机制,参看调用 OpenAPI。
QPS 不得超过 20。
使用 Post 方式发起请求。
以下是接口特有的请求参数。关于其他公共请求参数,参看请求参数。
| 参数名 | 类型 | 必填 | 示例值 | 描述 |
|---|---|---|---|---|
| Action | String | 是 | BanRoomUser | 接口名称,本接口取值:BanRoomUser |
| Version | String | 是 | 2020-12-01 | 接口版本,本接口取值:2020-12-01 |
| 参数名 | 类型 | 必填 | 示例值 | 描述 |
|---|---|---|---|---|
| AppId | String | 是 | Your_AppId | 你的音视频应用的唯一标志 |
| RoomId | String | 是 | Your_RoomId | 指定房间 ID |
| UserId | String | 否 | Your_UserId | 希望封禁用户的 ID |
| ForbiddenInterval | Int | 否 | 0 | 封禁时长,单位为秒,取值范围为[60,259290]。若传入值为空或 0表示允许用户重新进房。 若传入值大于 0,且小于60,自动修改为60。若传入值大于 259290,自动修改为259290。 |
https://rtc.volcengineapi.com?Action=BanRoomUser&Version=2020-12-01
postscript{
"AppId" : "Your_AppId",
"RoomId" : "Your_RoomId",
"UserId" : "Your_UserId",
"ForbiddenInterval" : 0
}
json返回值 Result 仅在请求成功时返回消息 "success", 失败时为空。
{
"ResponseMetadata": {
"RequestId": "Your_RequestId",
"Action": "BanRoomUser",
"Version": "2020-12-01",
"Service": "rtc",
"Region": "cn-north-1"
},
"Result": {
"message": "success"
}
json