# 获取聊天审核开关

### 接口URL

```
https://api.polyv.net/live/v3/channel/chat/get-censor-enabled
```

### 接口说明

```
1、作用：用于获取聊天审核开关接口
2、接口支持https协议
```

### 支持格式

```
JSON
```

### 请求方式

```
GET
```

### 请求数限制

```
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    | 频道号                                                                                                                                                                                                       |

### 操作成功响应示例

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

### 操作失败响应示例

签名错误

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

### 响应字段说明

| 名称      | 类型      | 说明                                  |
| ------- | ------- | ----------------------------------- |
| code    | string  | 响应代码，成功为200，失败为400，签名错误为403，异常错误500 |
| status  | string  | 成功为success，失败为error                 |
| message | string  | 错误时为错误提示消息                          |
| data    | boolean | 成功返回是否开启了聊天审核开关，开启为true，没开启为false   |

### php请求示例

```php
<?php

//引用config.php
include 'config.php';

$params = array(
        'appId'=>$appId,
        'channelId'=>$channelId,
        'timestamp'=>$timestamp
    );

//生成sign
$sign = getSign($params); //详细查看config.php文件
$params['sign'] = $sign;
$url="https://api.polyv.net/live/v3/channel/chat/get-censor-enabled?".http_build_query($params);
echo "<script>window.location.href='$url'</script>";
?>

```
