新東方-取得PPT檔案資訊
更新時間:2023-11-14 14:07:19
介面URL
https://document-2.polyv.net/api/live/user/get
介面說明
1、取得PPT檔案資訊
2、介面支援https協定
支援格式
JSON
請求方式
GET
請求數限制
TRUE
請求參數
| 參數名 | 必選 | 類型 | 說明 |
|---|---|---|---|
| autoId | 是 | string | 記錄ID |
| fileId | 是 | string | 檔案ID |
| userId | 是 | string | 使用者ID |
回應成功JSON範例:
{
"code": 200,
"status": "success",
"message": "",
"data": {
"autoId": 1494154,
"fileId": "98700a88ade105294013703810fcfc13cf7f07e096animate",
"fileName": "animate.pptx",
"fileUrl": "http://doc-2.polyv.net/sources/20201028/98700a88ade105294013703810fcfc13cf7f07e096animate.pptx",
"fileType": ".pptx",
"totalPage": 2,
"channelId": "cf7f07e096",
"status": "normal",
"createTime": 1603873152000,
"convertType": "animate",
"smallImagesZip": "http://doc-2.polyv.net/images/2020/10/98700a88ade105294013703810fcfc13cf7f07e096animate/smallImages.zip",
"imagesZip": "http://doc-2.polyv.net/images/2020/10/98700a88ade105294013703810fcfc13cf7f07e096animate/images.zip",
"htmlUrlZip": "http://doc-2.polyv.net/images/2020/10/98700a88ade105294013703810fcfc13cf7f07e096animate/98700a88ade105294013703810fcfc13cf7f07e096animate.zip"
}
}
回應失敗JSON範例:
記錄ID非法
{
"code": 400,
"status": "error",
"message": "autoId is illegal",
"data": ""
}
欄位說明
| 參數名 | 說明 |
|---|---|
| code | 請求狀態回應碼 |
| status | 請求狀態 |
| message | 錯誤訊息 |
| data | 請求失敗時為空,請求成功為成功資訊 |
| data.autoId | 記錄ID |
| data.fileId | 檔案ID |
| data.status | PPT狀態,“normal” 正常,不需要重複上傳檔案,已經有上傳成功的相同PPT,可以直接進入輪詢。“waitConvert”轉換PPT中,已經有相同的檔案正在轉換中,直接進入輪詢。“waitUpload” 等待上傳狀態,進入上傳阿里雲步驟。“failConvert” 轉換失敗 |
| data.fileUrl | 檔案位址 |
| data.fileType | 檔案類型 |
| data.totalPage | 總頁數 |
| data.convertType | 轉換類型 |
| data.smallImagesZip | 小圖ZIP位址 |
| data.imagesZip | 大圖ZIP位址 |
| data.htmlUrlZip | 動效檔案ZIP位址 |
| data.fileName | 檔案名稱 |
java請求範例
public static void test() {
String url = "https://document-2.polyv.net/api/live/user/get";
Map<String, String> params = new HashMap<>();
params.put("fileId", "d8700a88ade105294013703810fcfc13cf7f07e096animate");
params.put("autoId", "1492485");
params.put("userId", "cf7f07e096");
// 调用Polyv的httpClient工具类发送请求
String content = HttpClientUtil.getInstance().sendHttpPost(url, params);
System.out.println(content);
}
