保利威文档中心

幫助中心

設定頻道頁面皮膚介面

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

介面URL

https://api.polyv.net/live/v3/channel/theme/set

介面說明

1、接口用于设置频道页面皮肤接口
2、接口支持https

回傳結果格式

JSON

請求方式

POST

請求參數

參數名 必選 類型 說明
appId string 從API設定中取得,在直播系統登記的appId
timestamp long 當前13位毫秒級時間戳,3分鐘內有效
sign String 簽名,為32位大寫的MD5值,產生簽名的appSecret金鑰作為通訊資料安全的關鍵資訊,嚴禁儲存在用戶端直接使用,所有API都必須透過客戶自己伺服器中轉呼叫POLYV伺服器取得回應資料【詳見簽名產生規則
channelId int 頻道號
watchLayout string 觀看佈局,直播助手(純影片)場景下取值:normal 常規直播 portrait 豎屏直播 ,雲課堂場景:video 影片為主 ppt 文件為主
mobileWatchLayout string 行動端觀看佈局,直播助手(純影片)場景下取值:normal 常規直播 portrait 豎屏直播 ,雲課堂場景:normal 常規直播 portrait 豎屏直播
templateType string 觀看頁模板,old 為舊版 new為新版
pageSkin string 皮膚風格 ,black white blue red green

回應成功JSON範例:

{
    "code": 200,
    "status": "success",
    "message": "",
    "data":  ""
}

回應失敗JSON範例:

未輸入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": 400,
    "data": "",
    "message": "illegal channel id: 10001",
    "status": "error"
}

非法的參數值

{
    "code": 400,
    "data": "",
    "message": "illegal param type: watchLayout",
    "status": "error"
}
{
    "code": 400,
    "data": "",
    "message": "illegal param type: mobileWatchLayout",
    "status": "error"
}

欄位說明

參數名 說明
code 回應代碼,成功為200,失敗為400,簽名錯誤為403,異常錯誤500
status 成功為success,失敗為error
message 錯誤時為錯誤提示訊息
data 成功資料

Java請求範例

public static void test() {
        String url = "https://api.polyv.net/live/v3/channel/theme/set";
        // 用户对应的appId和加密串
        String appId = "xxxxxxxxx";
        String appSecret = "xxxxxxxxxxxxxxxxxxxxxxxxxx";
        int channelId = 10001;
        Map<String, String> params = new HashMap<>();
        params.put("channelId", channelId);
        params.put("watchLayout", "normal");
        PolyvTool.setLiveSign(params, appId, appSecret);
        // 调用Polyv的httpClient工具类发送请求
        String content = HttpClientUtil.getInstance()
                .sendHttpPost(url + "?" + PolyvTool.mapJoinNotEncode(params));
        System.out.println(content);
    }
联系客服,在线咨询