Get Channel Document Details
Updated: 2022-09-02 18:08:07
Interface URL
https://api.polyv.net/live/v3/channel/document/get
Interface Description
1、接口用于频道的文档详情信息
2、接口支持https
Supported Format
JSON
Request Method
GET
Request Parameters
| Parameter | 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 never be 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 |
| fileId | Yes | string | File ID |
| type | No | string | Document type (new version: "new", old version: "old"). Defaults to "new" if not provided. |
Successful Response JSON Example:
{
"code": 200,
"status": "success",
"message": "",
"data": {
"autoId": xxxx,
"fileId": "6fcf5fa1c48bf427515a0fe47d3b3a5d330282",
"fileName": "xxxx.ppt",
"fileUrl": "http://doc.polyv.net/xxxx.ppt",
"fileType": '.ppt',
"totalPage": 1,
"channelId": "330282",
"status": "normal",
"createTime": null,
"convertType": "common",
"type": "old",
"previewImage": "http://doc.polyv.net/xxxx_s.jpeg",
"previewBigImage": "http://doc.polyv.net/xxxx.jpeg",
"images": ["http://doc.polyv.net/xxxx.jpeg"],
"smallImages": ["http://doc.polyv.net/xxxx_s.jpeg"]
}
}
Failed Response JSON Example:
No appId 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 | 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 status is "error" |
| data.channelId | Channel number |
| data.autoId | PPT auto-increment ID |
| data.fileId | PPT file ID |
| data.fileName | File name |
| data.fileType | File type |
| data.fileUrl | File URL |
| data.totalPage | Total number of pages |
| data.status | PPT status ("normal": normal, "waitUpload": waiting for upload, "failUpload": upload failed, "waitConvert": converting PPT, "failConvert": PPT conversion failed) |
| data.convertType | Conversion type ("common": standard, "animate": animated) |
| data.type | PPT type (new version: "new", old version: "old") |
| data.previewImage | Small preview image |
| data.previewBigImage | Large preview image |
| data.images | List of large images |
| data.smallImages | List of small images |
Request Example
<?php
//引用config.php
include 'config.php';
//接口URL上变量
$channelId = "123456";
$fileId = "xxxxxxxx";
//接口需要的参数(非sign)赋值
$params = array(
'appId'=>$appId,
'timestamp'=>$timestamp,
'channelId'=>$channelId,
'fileId'=>$fileId
);
//生成sign
$sign = getSign($params); //详细查看config.php文件的getSign方法
//接口请求url
$url = "http://api.polyv.net/live/v3/channel/document/get?appId=".$appId."&sign=".$sign."×tamp=".$timestamp."&channelId=".$channelId."&fileId=".$fileId;
//输出接口请求结果
echo file_get_contents($url);
?>
