# 通过频道聊天审核内容

### 接口URL

```
https://api.polyv.net/live/v3/channel/chat/pass-censor-content
```

### 接口说明

```
1、作用：用于通过聊天审核内容接口
2、接口支持https协议
```

### 支持格式

```
JSON
```

### 请求方式

```
POST
```

### 请求数限制

```
TRUE
```

### 请求参数

| 参数名       | 必选 | 类型     | 说明                                                                                                                                                                                                        |
| --------- | -- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| appId     | 是  | string | 从API设置中获取，在直播系统登记的appId                                                                                                                                                                                   |
| timestamp | 是  | string | 当前时间的秒级时间戳（13位）                                                                                                                                                                                           |
| sign      | 是  | String | 签名，为32位大写的MD5值,`生成签名的appSecret密钥作为通信数据安全的关键信息，严禁保存在客户端直接使用，所有API都必须通过客户自己服务器中转调用POLYV服务器获取响应数据`【详见[签名生成规则](https://git.polyv.net/help-center/document-center/-/blob/master/live/api/buildSign/README.md)】 |
| channelId | 是  | int    | 频道号                                                                                                                                                                                                       |
| passType  | 是  | string | 通过类型，“all”: 全部通过， “time”：当前时间段通过， “id”：通过聊天审核内容ID通过                                                                                                                                                       |
| id        | 否  | string | 聊天审核内容ID（当passType为“id”时必传）                                                                                                                                                                               |
| time      | 否  | long   | 13位时间戳（当passType为“time”时必传），会通过所传时间戳之前的所有聊天审核内容消息                                                                                                                                                         |

### 操作成功响应示例

```json
{
  "code": 200,
  "message": "",
  "status": "success",
  "data": ""
}
```

### 操作失败响应示例

签名错误

```json
{
    "code": 403,
    "status": "error",
    "message": "invalid signature.",
    "data": ""
}
```

### 响应字段说明

| 名称      | 类型     | 说明                                  |
| ------- | ------ | ----------------------------------- |
| code    | string | 响应代码，成功为200，失败为400，签名错误为403，异常错误500 |
| status  | string | 成功为success，失败为error                 |
| message | string | 错误时为错误提示消息                          |
| data    | string | 成功返回信息                              |

### php请求示例

```php
<?php
//引用config.php
include 'config.php';

$params = array(
  'appId' => $appId,
  'timestamp' => $timestamp,
  'channelId' => '123456',
  'passType' => 'id',
  'id' => 'sdadada'
);

//生成sign
$sign = getSign($params); //详细查看config.php文件的getSign方法
$params['sign'] = $sign;

$url = "https://api.polyv.net/live/v3/channel/chat/pass-censor-content?".http_build_query($params);

$curl = curl_init();
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_TIMEOUT, 500);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, 1);
$res = curl_exec($curl);
curl_close($curl);

echo $res;
?>
```
