你可以使用此接口在直播群中批量禁言或拉黑会话成员。
你可以调用BatchAddBlockParticipants
接口,指定你所属的AppId
、会话 ID、 会话成员 UserId 和具体的操作行为,来批量禁言或者拉黑会话成员。
目前仅直播群支持此接口
关于调用接口的服务地址、通信协议、字符编码和签名机制,参看调用 OpenAPI。
QPS 不得超过 50。
下表仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数。
参数 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | BatchAddBlockParticipants | 接口名称。当前 API 的名称为 BatchAddBlockParticipants 。 |
Version | String | 是 | 2020-12-01 | 接口版本。当前 API 的版本为 2020-12-01 。 |
参数 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
AppId | Integer | 是 | 000000 | 应用的唯一标志 |
ConversationShortId | Long | 是 | 000001 | 会话 ID |
BlockAction | Integer | 否 |
| 操作行为
|
ParticipantBlockInfos | JSON Map | 是 | {"10001":6000} | key 为群成员 ID,类型:String,只能传userId,value 为禁言或者拉黑时长,类型:int,单位为秒。 |
下表仅列出本接口特有的返回参数。更多信息请参见返回结构。
参数 | 类型 | 示例值 | 描述 |
---|---|---|---|
FailedParticipantUserIds | Array of Long | [11] | 禁言或者拉黑失败的会话成员 UserId |
POST https://rtc.volcengineapi.com?Action=BatchAddBlockParticipants&Version=2020-12-01
{
"AppId": 000000,
"ConversationShortId": 000001,
"BlockAction": 0,
"ParticipantBlockInfos": {
"10001": 6000,
"10002": 5000
}
}
{
"ResponseMetadata": {
"RequestId": "Your_RequestId",
"Action": "BatchAddBlockParticipants",
"Version": "2020-12-01",
"Service": "rtc",
"Region": "cn-beijing"
},
"Result": {
"FailedParticipantUserIds": [
10001
]
}
}
您可访问公共错误码,获取更多错误码信息。