# 修改视频审核状态的接口

### 接口URL

```
https://api.polyv.net/v2/video/{userid}/audit-video
```

### 接口说明

```
修改视频审核状态的接口
```

### 支持格式

```
JSON
```

### 请求方式

```
POST
```

### 请求数限制

```
TRUE
```

### 请求参数

| 参数名          | 必选 | 类型     | 说明                      |
| ------------ | -- | ------ | ----------------------- |
| userid       | 是  | string | 用户ID                    |
| ptime        | 是  | string | 当前时间的毫秒级时间戳（13位），3分钟内有效 |
| vid          | 是  | string | 视频ID                    |
| reviewResult | 是  | string | 审核的状态，例如：pass,目前仅支持pass |
| sign         | 是  | string | 签名，为40位大写的SHA1值         |

### JSON示例

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

```json
{
  code: 400,
  status: "error",
  message: "vid不能为空",
  data: ""
}
```

```json
{
  code: 400,
  status: "error",
  message: "reviewResult不能为空",
  data: ""
}
```

```json
{
  code: 400,
  status: "error",
  message: "reviewResult值不对",
  data: ""
}
```

```json
{
  code: 400,
  status: "error",
  message: "视频ID和用户不对应",
  data: ""
}
```

```json
{
  code: 400,
  status: "error",
  message: "账号没有操作该接口的权限",
  data: ""
}
```

```json
{
  code: 400,
  status: "error",
  message: "视频不存在",
  data: ""
}
```

```json
{
  code: 400,
  status: "error",
  message: "只有审核不通过的视频才可以修改审核状态",
  data: ""
}
```

```json
{
  code: 400,
  status: "error",
  message: "视频被判定为确认违规，无法修改审核状态，如有疑问请联系客服处理",
  data: ""
}
```

### 字段说明

| 字段      | 说明      |
| ------- | ------- |
| status  | 成功/失败状态 |
| code    | 成功/失败代码 |
| message | 成功/失败信息 |
| data    | 成功/失败数据 |

### php请求示例

```php
<?php
  $userid="8f8482aaab";
  $secretkey="AiDQw1mAmi";
  $vid="8f8482aaab8fe7ea12e3314a11a061fc_8";
  $reviewResult="pass";
  $ptime=time()*1000;
  $str="ptime=$ptime&reviewResult=$reviewResult&vid=$vid".$secretkey;
  $sign=strtoupper(sha1($str));
  $url="http://api.polyv.net/v2/video/$userid/audit-video?ptime=$ptime&reviewResult=$reviewResult&vid=$vid&sign=$sign";
  $content = file_get_contents($url);
  echo $content;
?>
```

### 签名规则

将请求参数（sign除外）按照参数名字典顺序排列，用“&”连接参数名与参数值,并在最后加上secretkey的值，生成40位大写的SHA1值，作为sign。

以下是示例过程：

**1. 将请求参数按照参数名字典顺序排列为：**

```javascript
reviewResult="pass"
ptime="1476753635000";
vid="8f8482aaab8fe7ea12e3314a11a061fc_8";
```

**2. 连接字符串** 用“&”连接参数名与参数值,并在最后加上secretkey的值，生成40位大写的SHA1值，作为sign（本示例的值为AiDQw1mAmi），如下：

```javascript
ptime=1476753635000&reviewResult=pass&vid=8f8482aaab8fe7ea12e3314a11a061fc_8AiDQw1mAmi
```

**3. 生成签名sign**

sign为40位大写的SHA1值：

```javascript
B2E2D7AAB9DFCC8CBFE7EDC919B5F8F6F4E104BC
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://polyv.gitbook.io/document/docs/unclassified/2020/ec245f94dc774f916e93bbee7eb63b4c.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
