保利威文档中心

幫助中心

重製課件參數獲取

更新時間:2022-09-02 18:08:07

介面URL

https://api.polyv.net/live/v3/channel/pptRecord/get-setting

介面說明

1、接口用于设置重制课件参数
2、接口支持https

支援格式

JSON

請求方式

GET、POST

請求數限制

TRUE

請求參數

參數名 必選 類型 說明
appId string 從API設定中獲取,在直播系統登記的appId
timestamp long 13位當前毫秒級時間戳
sign String 簽名,為32位大寫的MD5值,生成簽名的appSecret金鑰作為通訊資料安全的關鍵資訊,嚴禁儲存在客戶端直接使用,所有API都必須透過客戶自己伺服器中轉呼叫POLYV伺服器獲取響應資料【詳見簽名生成規則
channelId int 頻道號

響應成功JSON範例:

{
    "code": 200,
    "status": "success",
    "message": "",
    "data": {
        "channelId": 1947328,
        "userId": "cf7f07e096",
        "type": 0,
        "globalSettingEnabled": "N",
        "backgroundImg": "http://liveimages.videocc.net/uploaded/images/2020/12/fu9tqrl4wj.jpg",
        "videoRatio": "0",
        "brandImg": "http://liveimages.videocc.net/uploadimage/20201224/remakeCoursewareBg_1608804635322_7656406.png",
        "createdTime": 1602471455000,
        "lastModified": 1608859631000
    }
}

響應欄位說明

參數名 說明
code 狀態碼,成功為200,簽名失敗為403,參數錯誤為400,服務端錯誤為500
status 成功為success,錯誤時為error
message 成功為"",錯誤時為錯誤描述資訊
data 響應資料
data.globalSettingEnabled 是否使用通用設定,Y.是、N.否
data.type 影片佈局方式,0.三分屏、1.純文件
data.videoRatio 攝影機畫面比例,0表示16:9、1表示4:3
data.brandImgFile 展示圖片
data.backgroundImgFile 背景圖片

響應失敗JSON範例:

參數錯誤

{
    "code": 400,
    "status": "error",
    "message": "param validate error",
    "data": ""
}

未輸入appId

{
    "code": 400,
    "status": "error",
    "message": "appId is required.",
    "data": ""
}

appId不正確

{
    "code": 400,
    "status": "error",
    "message": "application not found.",
    "data": ""
}

時間戳錯誤

{
    "code": 400,
    "status": "error",
    "message": "invalid timestamp.",
    "data": ""
}

簽名錯誤

{
    "code": 403,
    "status": "error",
    "message": "invalid signature.",
    "data": ""
}

非法頻道號

{
    "code": 403,
    "status": "error",
    "message": "illegal channel id: %s",
    "data": ""
}

java請求範例

public void testAddRecordTask() {
        String url = "https://api.polyv.net/live/v3/channel/pptRecord/get-setting";
        // appId和加密串
        String appId = "xxxxxxx";
        String appSecret = "xxxxxxxxxxxxxxxxxx";
        int channelId = 123;
        Map<String, String> params = new HashMap<>();
        params.put("channelId", String.valueOf(channelId));

        // 调用Polyv的工具类方法设置sign
        PolyvTool.setLiveSign(params, appId, appSecret);
        String content = HttpClientUtil.getInstance()
                .sendHttpPost(url, params);
        System.out.println(content);
}
联系客服,在线咨询