Polyv Help Center

Help Center

Set Channel Page Skin Interface

Updated: 2022-09-02 18:08:07

Interface URL

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

Interface Description

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

Response Format

JSON

Request Method

POST

Request Parameters

Parameter Required Type Description
appId Yes string Obtained from API settings, the appId registered in the live streaming system
timestamp Yes long Current 13-digit millisecond timestamp, valid within 3 minutes
sign Yes String Signature, a 32-character uppercase MD5 value. The appSecret key used to generate the signature is critical for communication data security. It must not be stored or used directly on the client side. All APIs must be called through the customer's own server to relay requests to the POLYV server for response data. See signature generation rules
channelId Yes int Channel ID
watchLayout No string Watch layout. For Live Assistant (video-only) scenarios: normal (standard live) or portrait (vertical live). For Cloud Classroom scenarios: video (video-focused) or ppt (document-focused)
mobileWatchLayout No string Mobile watch layout. For Live Assistant (video-only) scenarios: normal (standard live) or portrait (vertical live). For Cloud Classroom scenarios: normal (standard live) or portrait (vertical live)
templateType No string Watch page template: old (legacy) or new (new version)
pageSkin No string Skin style: black, white, blue, red, green

Successful Response JSON Example:

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

Failed Response JSON Examples:

No appId entered

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

Incorrect appId

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

Timestamp error

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

Signature error

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

Invalid channel ID

{
    "code": 400,
    "data": "",
    "message": "illegal channel id: 10001",
    "status": "error"
}

Invalid parameter value

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

Field Description

Parameter Description
code Response code: 200 for success, 400 for failure, 403 for signature error, 500 for exception error
status success for success, error for failure
message Error message when an error occurs
data Success data

Java Request Example

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