https://document-2.polyv.net/api/live/user/upload/token
1、获取上传PPT文件token
2、接口支持https协议
3、上传文件到OSS参考 https://www.alibabacloud.com/help/zh/doc-detail/31927.htm
{
"code": 200,
"status": "success",
"message": "",
"data": {
"encodedCallback": "eyJjYWxsYmFja1VybCI6Imh0dHA6Ly9kb2N1bWVudC0yLnBvbHl2Lm5ldC90ZXN0L2FsaS9vc3MvY2FsbGJhY2svdXBsb2FkIiwiY2FsbGJhY2tIb3N0IjoiZG9jdW1lbnQtMi5wb2x5di5uZXQiLCJjYWxsYmFja0JvZHkiOiJvYmplY3Q9JHtvYmplY3R9JnNpemU9JHtzaXplfSZidWNrZXQ9JHtidWNrZXR9JmV0YWc9JHtldGFnfSZhdXRvSWQ9MTQ5MzcxNyZmaWxlSWQ9ZDg3MDBhODhhZGUxMDUyOTQwMTM3MDM4MTBmY2ZjMTNjZjdmMDdlMDk2YW5pbWF0ZSIsImNhbGxiYWNrQm9keVR5cGUiOiJhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQifQ==",
"signature": "fcrT21oNF7CMxAdI70D20hUu1fE=",
"autoId": "1493717",
"dir": "sources/20201028/",
"bucket": "polyvppt",
"accessId": "LTAIjy1Mrh8QQcQH",
"endpoint": "oss-cn-shenzhen.aliyuncs.com",
"expire": "1603941652",
"host": "http://polyvppt.oss-cn-shenzhen.aliyuncs.com",
"callback": "{\"callbackUrl\":\"http://document-2.polyv.net/test/ali/oss/callback/upload\",\"callbackHost\":\"document-2.polyv.net\",\"callbackBody\":\"object=${object}&size=${size}&bucket=${bucket}&etag=${etag}&autoId=1493717&fileId=d8700a88ade105294013703810fcfc13cf7f07e096animate\",\"callbackBodyType\":\"application/x-www-form-urlencoded\"}",
"convertStatus": "waitUpload",
"fileId": "d8700a88ade105294013703810fcfc13cf7f07e096animate",
"object": "sources/20201028/d8700a88ade105294013703810fcfc13cf7f07e096animate.pptx",
"policy": "eyJleHBpcmF0aW9uIjoiMjAyMC0xMC0yOVQwMzoyMDo1Mi42OTJaIiwiY29uZGl0aW9ucyI6W1siY29udGVudC1sZW5ndGgtcmFuZ2UiLDAsMzIyMTIyNTQ3MjBdLFsic3RhcnRzLXdpdGgiLCIka2V5Iiwic291cmNlcy8yMDIwMTAyOC8iXV19"
}
}
{
"code": 200,
"status": "success",
"message": "",
"data": {
"autoId": "1492485",
"convertStatus": "waitConvert",
"fileId": "18947167af136724418f3cfa32343b29cf7f07e096animate"
}
}
{
"code": 200,
"status": "success",
"message": "",
"data": {
"autoId": "1493717",
"convertStatus": "normal",
"fileId": "d8700a88ade105294013703810fcfc13cf7f07e096animate"
}
}
{
"code": 400,
"status": "error",
"message": "file type is wrong",
"data": ""
}
public static void test() {
String url = "https://document-2.polyv.net/api/live/user/upload/token";
Map<String, String> params = new HashMap<>();
params.put("fileId", "d8700a88ade105294013703810fcfc13cf7f07e096animate");
params.put("type", "animate");
params.put("fileName", "animate.pptx");
params.put("userId", "cf7f07e096");
// 调用Polyv的httpClient工具类发送请求
String content = HttpClientUtil.getInstance().sendHttpPost(url, params);
System.out.println(content);
}