Get Channel Document List API
Updated: 2022-09-02 18:08:07
API URL
http://api.polyv.net/live/v3/channel/document/list
API Description
1、接口用于频道文档列表接口
2、接口支持https
Supported Format
JSON
Request Method
GET
Request Parameters
| Parameter Name | Required | Type | Description |
|---|---|---|---|
| appId | Yes | string | Admin's appId |
| timestamp | Yes | long | 13-digit current timestamp |
| sign | Yes | String | Signature, a 32-character uppercase MD5 value. The appSecret key used to generate the signature is critical for communication data security. It must not be stored or used directly on the client side. All APIs must be called through the customer's own server to relay requests to the POLYV server for response data. See signature generation rules |
| channelId | Yes | int | Channel ID |
| status | No | String | Document status. If not passed, query all. ("normal": normal, "waitUpload": waiting to upload, "failUpload": upload failed, "waitConvert": converting PPT, "failConvert": PPT conversion failed) |
| page | No | int | Page number. Defaults to page 1 if not passed. |
| limit | No | int | Number of items per page. Defaults to 100 if not passed. |
| isShowUrl | No | string | Whether to display the original PPT file URL. Defaults to not showing if not passed. 'Y': Yes, 'N': No. |
Successful Response JSON Example:
// 响应成功
{
"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
}
}
Failed Response JSON Examples:
appId not provided
{
"code": 400,
"status": "error",
"message": "appId is required.",
"data": ""
}
Incorrect appId
{
"code": 400,
"status": "error",
"message": "application not found.",
"data": ""
}
Timestamp error
{
"code": 400,
"status": "error",
"message": "invalid timestamp.",
"data": ""
}
Signature error
{
"code": 403,
"status": "error",
"message": "invalid signature.",
"data": ""
}
Field Description
| Parameter Name | Description |
|---|---|
| code | Response code. 200 for success, 400 for failure, 403 for signature error, 500 for server error. |
| status | "success" for success, "error" for failure. |
| message | Error message when an error occurs. |
| data | Paginated document list. |
| data.pageNumber | Current page number. |
| data.totalPages | Total number of pages. |
| data.pageSize | Number of items per page. |
| data.contents | Content of the current page. |
| data.contents[0].autoId | Document ID. |
| data.contents[0].fileId | File ID. |
| data.contents[0].fileName | File name. |
| data.contents[0].fileUrl | File URL. |
| data.contents[0].fileType | File type. |
| data.contents[0].totalPage | Total number of PPT pages. |
| data.contents[0].channelId | Channel ID. |
| data.contents[0].status | PPT conversion status. ("normal": normal, "waitUpload": waiting to upload, "failUpload": upload failed, "waitConvert": converting PPT, "failConvert": PPT conversion failed) |
| data.contents[0].createTime | Creation time. |
| data.contents[0].convertType | Conversion type. ("common": "normal PPT", "animate": "animated PPT") |
| data.contents[0].type | Type, distinguishes between old and new PPT versions. "new" for new version, "old" for old version. |
| data.contents[0].previewImage | PPT preview thumbnail URL. |
Request Example
<?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."×tamp=".$timestamp."&channelId=".$channelId;
//输出接口请求结果
echo file_get_contents($url);
?>
