取得頻道文件列表介面
更新時間:2022-09-02 18:08:07
介面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伺服器取得回應資料【詳見簽名生成規則】 |
| channelId | 是 | int | 頻道號 |
| status | 否 | String | 文件狀態,不傳查詢所有(“normal” :正常,“waitUpload”:等待上傳,“failUpload”:上傳失敗,"waitConvert":轉換PPT中,"failConvert":轉換PPT失敗) |
| page | 否 | int | 第幾頁,預設不傳顯示第一頁 |
| limit | 否 | int | 每頁顯示幾筆資料,預設不傳顯示100筆 |
| isShowUrl | 否 | string | 是否展示PPT原檔案地址,該參數不傳預設不展示,’Y‘:是,’N‘:否 |
回應成功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
{
"code": 400,
"status": "error",
"message": "appId is required.",
"data": ""
}
appId不正確
{
"code": 400,
"status": "error",
"message": "application not found.",
"data": ""
}
時間戳錯誤
{
"code": 400,
"status": "error",
"message": "invalid timestamp.",
"data": ""
}
簽名錯誤
{
"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
//引用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);
?>
