# 获取频道文档列表接口

### 接口URL

```
http://api.polyv.net/live/v3/channel/document/list
```

### 接口说明

```
1、接口用于频道文档列表接口
2、接口支持https
```

### 支持格式

```
JSON
```

### 请求方式

```
GET
```

### 请求参数

| 参数名       | 必选 | 类型     | 说明                                                                                                                                                                                                        |
| --------- | -- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| appId     | 是  | string | 管理员的appId                                                                                                                                                                                                 |
| timestamp | 是  | long   | 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    | 频道号                                                                                                                                                                                                       |
| status    | 否  | String | 文档状态，不传查询所有（“normal” ：正常，“waitUpload”：等待上传,“failUpload”：上传失败，"waitConvert":转换PPT中,"failConvert":转换PPT失败）                                                                                                  |
| page      | 否  | int    | 第几页，默认不传显示第一页                                                                                                                                                                                             |
| limit     | 否  | int    | 每页显示几条数据，默认不传显示100条                                                                                                                                                                                       |
| isShowUrl | 否  | string | 是否展示PPT原文件地址，该参数不传默认不展示，’Y‘：是，’N‘：否                                                                                                                                                                       |

### 响应成功JSON示例：

```json
// 响应成功
{
    "code": 200,
    "status": "success",
    "message": "",
    "data": {
	"pageSize": 10,
	"pageNumber": 1,
	"totalItems": 1,
	"contents": [{
		"autoId": 111111,
		"fileId": "xxxxxxxxx",
		"fileName": "关于xxxx的通知.pdf",
		"fileUrl": "http://doc-2.polyv.net/sources/20190614/xxxxxxxxxxxxxxxxxxxx.pdf",
		"fileType": ".pdf",
		"totalPage": 1,
		"channelId": "254318",
		"status": "normal",
		"createTime": 1560476703000,
		"convertType": "common",
		"type": "new",
		"previewImage": "http://doc-2.polyv.net/images/2019/06/xxxxxxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxxxxxx_0000_s.jpeg"
	}],
	"startRow": 1,
	"firstPage": true,
	"lastPage": true,
	"nextPageNumber": 1,
	"prePageNumber": 1,
	"totalPages": 1,
	"endRow": 5,
	"limit": 5,
	"offset": 0
}
}

```

### 响应失败JSON示例：

未输入appId

```json
{
    "code": 400,
    "status": "error",
    "message": "appId is required.",
    "data": ""
}
```

appId不正确

```json
{
    "code": 400,
    "status": "error",
    "message": "application not found.",
    "data": ""
}
```

时间戳错误

```json
{
    "code": 400,
    "status": "error",
    "message": "invalid timestamp.",
    "data": ""
}
```

签名错误

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

### 字段说明

| 参数名                            | 说明                                                                                                   |
| ------------------------------ | ---------------------------------------------------------------------------------------------------- |
| code                           | 响应代码，成功为200，失败为400，签名错误为403，异常错误500                                                                  |
| status                         | 成功为success，失败为error                                                                                  |
| message                        | 错误时为错误提示消息                                                                                           |
| data                           | 分页的文档列表                                                                                              |
| data.pageNumber                | 当前页码                                                                                                 |
| data.totalPages                | 页面总数                                                                                                 |
| data.pageSize                  | 每页数据量                                                                                                |
| data.contents                  | 当前页面内容                                                                                               |
| data.contents\[0].autoId       | 文档ID                                                                                                 |
| data.contents\[0].fileId       | 文件ID                                                                                                 |
| data.contents\[0].fileName     | 文件名                                                                                                  |
| data.contents\[0].fileUrl      | 文件url                                                                                                |
| data.contents\[0].fileType     | 文件类型                                                                                                 |
| data.contents\[0].totalPage    | PPT总页数                                                                                               |
| data.contents\[0].channelId    | 频道ID                                                                                                 |
| data.contents\[0].status       | ppt转换状态（“normal” ：正常，“waitUpload”：等待上传,“failUpload”：上传失败，"waitConvert":转换PPT中,"failConvert":转换PPT失败） |
| data.contents\[0].createTime   | 创建时间                                                                                                 |
| data.contents\[0].convertType  | 转换类型（"common"："普通PPT"，"animate"： "动画PPT"）                                                            |
| data.contents\[0].type         | 类型，区分旧版PPT还是新版PPT，新版值为“new”，旧版值为“old”                                                                |
| data.contents\[0].previewImage | ppt预览小图地址                                                                                            |

### 请求示例

```php
<?php

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

//接口URL上变量
$channelId = "123456";
//接口需要的参数（非sign）赋值
$params = array(
    'appId'=>$appId,
    'timestamp'=>$timestamp,
    'channelId'=>$channelId
  );

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

//接口请求url
$url = "http://api.polyv.net/live/v3/channel/document/list?appId=".$appId."&sign=".$sign."&timestamp=".$timestamp."&channelId=".$channelId;
//输出接口请求结果
echo file_get_contents($url);

?>
```


---

# 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/2019/b86e64177378d11e1c4e2c76daaca615.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.
