取得頻道文件詳細資訊
更新時間:2022-09-02 18:08:07
介面URL
https://api.polyv.net/live/v3/channel/document/get
介面說明
1、接口用于频道的文档详情信息
2、接口支持https
支援格式
JSON
請求方式
GET
請求參數
| 參數名 | 必填 | 類型 | 說明 |
|---|---|---|---|
| appId | 是 | string | 管理員的appId |
| timestamp | 是 | long | 13位當前時間戳 |
| sign | 是 | String | 簽名,為32位大寫的MD5值,生成簽名的appSecret金鑰作為通訊資料安全的關鍵資訊,嚴禁儲存在用戶端直接使用,所有API都必須透過客戶自己的伺服器中轉呼叫POLYV伺服器取得回應資料【詳見簽名生成規則】 |
| channelId | 是 | int | 頻道id |
| fileId | 是 | string | 檔案ID |
| type | 否 | string | 文件新舊類型(新版:new, 舊版 :old),不傳預設為new |
回應成功JSON範例:
{
"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"]
}
}
回應失敗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.channelId | 頻道號 |
| data.autoId | ppt自增ID |
| data.fileId | ppt檔案ID |
| data.fileName | 檔案名稱 |
| data.fileType | 檔案類型 |
| data.fileUrl | 檔案地址 |
| data.totalPage | 總頁數 |
| data.status | PPT狀態(‘normal’:正常,“waitUpload”:等待上傳,“failUpload”:上傳失敗,"waitConvert":轉換PPT中,"failConvert":轉換PPT失敗 ) |
| data.convertType | 轉換類型,(普通: "common", 動畫: "animate") |
| data.type | ppt新舊類型(新版ppt:"new", 舊版ppt:"old") |
| data.previewImage | 預覽小圖 |
| data.previewBigImage | 預覽大圖 |
| data.images | 大圖列表 |
| data.smallImages | 小圖列表 |
請求範例
<?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);
?>
