Polyv Help Center

Help Center

Batch Modify Channel Skin

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

API Description

1、批量修改频道装修皮肤
2、接口支持https协议

API URL

http://api.polyv.net/live/v4/channel/decorate/skin/update-batch

Online API Call

Request Method

POST

API Constraints

  1. The API supports both HTTP and HTTPS. HTTPS is recommended to ensure interface security. API calls have frequency limits. See details

  2. Only the new backend is supported. If the old backend has the general settings enabled for this channel ID, the modification will not succeed.

Request Parameter Description

Parameter Required Type Description
appId true String Account appId See details for obtaining secret key
timestamp true Long Current 13-digit millisecond timestamp, valid for 3 minutes
sign true String Signature, a 32-character uppercase MD5 value. The appSecret key used to generate the signature is critical information for communication data security. It must not be saved or used directly on the client side. All APIs must be relayed through the customer's own server to call the POLYV server for response data. See details for signature generation rules
channelIds true String Channel IDs separated by commas, e.g., 10000,100001. Maximum 500 IDs.
skin true String Skin
black: Fashion Black
red: Festive Red
blue: Tech Blue
white: Classic White
green: Mint Green
golden: Rich Gold

Example

http://api.polyv.net/live/v4/channel/decorate/skin/update-batch?appId=frlr1zazn3&skin=green&sign=3BF08DAE570AAA601D2E12A3AA85E622&channelIds=2272655%2C1965681%2C2477096&timestamp=1646289479777

Response Parameter Description

Parameter Type Description
code Integer Response status code, 200 for success, non-200 for failure
status String Response result, determined by business logic. Returns success on success, error on failure
success Boolean Response result, determined by business logic. Returns true on success, false on failure
data Object Returns true on successful response, false on failure
error Object Error information when status code is non-200 See details for Error field description
requestId String Request ID, a unique UUID generated for each request. Only used for troubleshooting and debugging, should not be tied to business logic

Error Parameter Description

Parameter Type Description
code Integer Error code, used to identify the specific error reason
desc String Error description, corresponding to error.code

Java Request Example

For quick integration of the basic code, please download the relevant dependency source code. Click here to download the source code. After downloading, add it to your own source code project. HttpUtil.java and LiveSignUtil.java in the test cases are included in the downloaded file.

It is strongly recommended to use the Live Java SDK to complete API functionality integration. The Live Java SDK provides unified encapsulation and optimization for API call logic, exception handling, data signing, and HTTP request thread pools.

/**
 * 批量修改频道皮肤
 * @throws IOException
 * @throws NoSuchAlgorithmException
 */
@Test
public void updateSkin() throws IOException, NoSuchAlgorithmException {
    String appId = super.appId;
    String appSecret = super.appSecret;
    String timestamp = String.valueOf(System.currentTimeMillis());
    //业务参数
    String url = "http://api.polyv.net/live/v4/channel/decorate/skin/update-batch";
    String channelIds = "2272655,1965681,2477096";
    String skin = "green";
    
    //http 调用逻辑
    Map<String, String> requestMap = new HashMap<>();
    requestMap.put("appId", appId);
    requestMap.put("timestamp", timestamp);
    
    requestMap.put("channelIds", channelIds);
    requestMap.put("skin", skin);
    requestMap.put("sign", LiveSignUtil.getSign(requestMap, appSecret));
    
    url = HttpUtil.appendUrl(url, requestMap);
    String response = HttpUtil.postFormBody(url, null);
    
    log.info("测试批量修改频道皮肤,返回值:{}", response);
}

Response Example

Success Example

{
    "code": 200,
    "status": "success",
    "requestId": "9975d9a5cfb04944a89c7c7e14868ac2.70.16462894821814759",
    "data": true,
    "success": true
}

Error Example

{
    "code": 400,
    "status": "error",
    "requestId": "d310b70bc329403f87f77f9203d50f89.128.16360828899123425",
    "error": {
        "code": 30004,
        "desc": "找不到频道"
    },
    "success": false
}
联系客服,在线咨询
在线咨询