Polyv Help Center

Help Center

Get Channel Skin Settings API

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

API URL

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

API Description

1、接口用于获取频道的皮肤设置信息
2、接口支持https

Response Format

JSON

Request Method

GET

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 timestamp
sign Yes String Signature, a 32-character uppercase MD5 value. The appSecret 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 and obtain response data. See signature generation rules
channelId Yes int Channel ID

Successful Response JSON Example:

{
"code": 200,
"status": "success",
"message": "",
"data": {
    "pageSkin": "green",
    "watchLayout": "video",
    "watchTemplateType": "new",
    "scene": "ppt",
    "mobileWatchLayout": "normal",
    "globalSettingEnabled": "Y"
  }
}

Failed Response JSON Examples:

Parameter error

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

Missing appId

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

Field Description

Parameter Type Description
code int Response code: 200 for success, 400 for failure, 401 for signature error, 500 for server error
status string "success" for success, "error" for failure
message string Error message when applicable
data Returned result data
pageSkin Channel skin style, e.g., blue, green, etc.
scene Channel live streaming scene, e.g., ppt (triple-screen), alone, etc.
mobileWatchLayout Mobile viewing layout: normal (standard live), portrait (vertical live)
watchLayout PC viewing layout: normal (standard live), portrait (vertical live). In ppt triple-screen mode: document-focused; in video triple-screen mode: video-focused
watchTemplateType Viewing page template type, e.g., old (legacy), new (new version), etc.
globalSettingEnabled Whether global settings are applied: Y (yes), N (no)

Java Request Example

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