新東方-上傳PPT檔案
更新時間:2023-11-14 14:07:19
介面URL
https://document-2.polyv.net/api/live/user/upload/ppt
介面說明
1、上傳PPT檔案
2、介面支援https協定
支援格式
JSON
請求方式
POST
請求數限制
TRUE
回應成功JSON範例:
{
"code": 200,
"status": "success",
"message": "",
"data": {
"autoId": 1539983,
"fileId": "3872476de0879e8a3d76ecc344b899b1cf7f07e096animate",
"fileName": "123.pptx",
"fileUrl": "http://doc-2.polyv.net/sources/20201202/3872476de0879e8a3d76ecc344b899b1cf7f07e096animate.pptx",
"fileType": ".pptx",
"totalPage": null,
"channelId": "cf7f07e096",
"status": "waitConvert",
"createTime": 1606890386168,
"convertType": "animate",
"smallImagesZip": null,
"imagesZip": null,
"htmlUrlZip": null
}
}
回應失敗JSON範例:
{
"code": 400,
"status": "error",
"message": "file type is wrong",
"data": ""
}
欄位說明
回呼說明
1、PPT轉換完成後透過POST方式間資料回呼到使用者的callback位址
2、使用者成功接收回呼後需要回應回呼處理結果
3、沒有接收到成功的回應回呼結果,間隔5秒、10秒後會發起第二、第三次回呼
回呼請求資料JSON範例:
{
"autoId": 1539983,
"fileId": "3872476de0879e8a3d76ecc344b899b1cf7f07e096animate",
"fileName": "123.pptx",
"fileUrl": "http://doc-2.polyv.net/sources/20201202/3872476de0879e8a3d76ecc344b899b1cf7f07e096animate.pptx",
"fileType": ".pptx",
"totalPage": 2,
"channelId": "cf7f07e096",
"status": "normal",
"createTime": 1606890386000,
"convertType": "animate",
"smallImagesZip": "http://doc-2.polyv.net/images/2020/12/3872476de0879e8a3d76ecc344b899b1cf7f07e096animate/smallImages.zip",
"imagesZip": "http://doc-2.polyv.net/images/2020/12/3872476de0879e8a3d76ecc344b899b1cf7f07e096animate/images.zip",
"htmlUrlZip": "http://doc-2.polyv.net/images/2020/12/3872476de0879e8a3d76ecc344b899b1cf7f07e096animate/3872476de0879e8a3d76ecc344b899b1cf7f07e096animate.zip"
}
回呼資料說明
回呼回應資料JSON範例:
{
"code": 200
}
回應欄位說明
java請求範例
public static void test() {
String url = "https://document-2.polyv.net/api/live/user/upload/ppt";
Map<String, String> params = new HashMap<>();
params.put("callback", "http://biny.free.idcfengye.com/callback/ppt");
params.put("type", "animate");
params.put("userId", "cf7f07e096");
// 调用Polyv的httpClient工具类发送请求
String content = HttpClientUtil.getInstance().sendHttpPost(url, params);
System.out.println(content);
}