新东方-上传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);
}