保利威文档中心

幫助中心

新東方-上傳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

請求參數(FORM表單)

參數名 必選 類型 說明
userId string 使用者ID
type string PPT類型,"common" 普通ppt , "animate"動畫PPT
callback string 回呼位址
file file 上傳檔案
timestamp long 時間戳記
sign string 簽章,簽章方式:'POLYV_USER_PPT'+ 'userId' + userId + 'timestamp' + timestamp + 'POLYV_USER_PPT' 字串進行MD5大寫

回應成功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": ""
}

欄位說明

參數名 說明
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 檔案名稱

回呼說明

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"
}

回呼資料說明

欄位名 說明
autoId 記錄ID
fileId 檔案ID
status PPT狀態,"normal" 正常,不需要重複上傳檔案,已經有上傳成功的相同PPT,可以直接進入輪詢。"waitConvert"轉換PPT中,已經有相同的檔案正在轉換中,直接進入輪詢。"waitUpload" 等待上傳狀態,進入上傳阿里雲步驟。"failConvert" 轉換失敗
fileUrl 檔案位址
fileType 檔案類型
totalPage 總頁數
convertType 轉換類型
smallImagesZip 小圖ZIP位址
imagesZip 大圖ZIP位址
htmlUrlZip 動效檔案ZIP位址
fileName 檔案名稱

回呼回應資料JSON範例:

{
    "code": 200
}

回應欄位說明

參數名 說明
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);
    }
联系客服,在线咨询