调用 UpdateActivityUserBanStatus
接口,在指定直播间内踢出或解除踢出一个或多个观众或设备。被踢出的观众或设备将无法再次进入该直播间。
调用该接口,您可以在指定直播间内完成以下操作:
BanStatus
取值设置为 1
,并至少传入 UserIds
和 Cookies
其中之一。
UserIds
时,将指定用户 ID 的观众踢出直播间。Cookies
时,将指定 ID 的设备踢出直播间。UserIds
和 Cookies
时,将指定用户 ID 的观众以及指定 ID 的设备踢出直播间。BanStatus
取值设置为 0
,并至少传入 UserIds
和 Cookies
其中之一。
UserIds
时,解除踢出指定用户 ID 的观众。Cookies
时,解除踢出指定 ID 的设备。UserIds
和 Cookies
时,解除踢出指定用户 ID 的观众以及指定 ID 的设备。下表仅列出该接口特有的请求参数和部分公共参数。更多信息详见公共参数。
参数 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | UpdateActivityUserBanStatus | 接口名称。当前 API 的名称为 UpdateActivityUserBanStatus 。 |
Version | String | 是 | 2023-08-01 | 接口版本。当前 API 的版本为 2023-08-01 。 |
参数 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
ActivityId | Long | 是 | 181917****140099 | 直播间 ID。您可通过调用 ListActivityAPI 接口获取 ID。 |
BanStatus | Integer | 是 |
| 踢出或解除踢出。取值如下:
|
UserIds | Array of Long | 否 |
| 踢出或解除踢出的用户 ID 列表。您可调用 ListUserBehaviorDataAPIV2 接口,通过返回参数 说明
|
Cookies | Array of String | 否 |
| 踢出或解除踢出的设备 ID 列表。您可调用 ListUserBehaviorDataAPIV2 接口,通过返回参数 说明
|
参数 | 类型 | 示例值 | 描述 |
---|---|---|---|
Status | Boolean | true | 是否成功踢出或解除踢出。成功返回 true 。 |
POST https://livesaas.volcengineapi.com/?Action=UpdateActivityUserBanStatus&Version=2023-08-01 { "ActivityId": 181917****140099, "BanStatus": 1, "UserIds": [ 182021****043371, 182021****043372, 182021****043373 ], "Cookies": [ "123", "345" ] }
{ "ResponseMetadata": { "RequestId": "20230604110420****100232280022D31", "Action": "UpdateActivityUserBanStatus", "Version": "2023-08-01", "Service": "livesaas", "Region": "cn-north-1", "SystemTime": 1735982834 }, "Result": { "Status": true } }
下表提供了该接口特有的错误码,公共错误码请参见公共错误码和错误码文档。
状态码 | 错误码 | 错误信息 | 说明 |
---|---|---|---|
400 | InvalidParameter.ArrayOverLimit | The array length exceeds the limit. | UserIds 或 Cookies 数组中的元素个数超出上限 50。请减少数组中的元素个数。 |
400 | InvalidParameter.UserIdNotRegistered | UserId xxx is not registered in the activity. | 当前用户 ID 在该直播间中不存在。请修改 UserIds 中的用户 ID 并重试。 |
400 | InvalidParameter.UserIdUnbanned | All userId has been unbanned in the activity. | UserIds 数组中的所有用户 ID 均已被解除踢出。请修改 UserIds 中的用户 ID 并重试。 |
400 | InvalidParameter.UserIdBanned | All userId has been banned in the activity. | UserIds 数组中的所有用户 ID 均已被踢出。请修改 UserIds 中的用户 ID 并重试。 |
400 | InvalidParameter.CookieUnbanned | All cookie has been unbanned in the activity. | Cookies 数组中的所有设备 ID 均已被解除踢出。请修改 Cookies 中的设备 ID 并重试。 |
400 | InvalidParameter.CookieBanned | All cookie has been banned in the activity. | Cookies 数组中的所有设备 ID 均已被踢出。请修改 Cookies 中的设备 ID 并重试。 |
400 | QuotaExceeded.CookieOverLimit | Cookie has exceeded the quota. | 当前直播间中,被踢出的设备数量已超出上限 1000。请减少 Cookies 中的设备 ID 数量,或者解除踢出部分设备。 |
400 | QuotaExceeded.UserIdOverLimit | UserId has exceeded the quota. | 当前直播间中,被踢出的观众人数已超出上限 1000。请减少 UserIds 中的用户 ID 数量,或者解除踢出部分观众。 |