Polyv Help Center

Help Center

Reset Courseware Parameter Settings

Updated: 2023-06-09 09:08:29

Interface URL

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

Interface Description

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

Supported Format

JSON

Request Method

POST

Request Limit

TRUE

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 millisecond timestamp (13 digits)
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
globalSettingEnabled Yes string Whether to use global settings, Y for yes, N for no
type Yes int Video layout mode, 0. Three-panel, 1. Document only
videoRatio No int Camera aspect ratio, valid for new version reset, default 0, 0 for 16:9, 1 for 4:3
brandImgFile No File Display image, valid for new version reset. Size is 480X810 when camera ratio is 16:9, 480X720 when camera ratio is 4:3. Supports jpg and png formats
backgroundImgFile No File Background image, valid for old version reset. Size is 1280X720. Supports jpg and png formats

Successful Response JSON Example:

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

Response Field Description

Parameter Description
code Status code, 200 for success, 403 for signature failure, 400 for parameter error, 500 for server error
status "success" for success, "error" for error
message Empty string for success, error description for error
data Response data
data.result Processing result, true for success

Failed Response JSON Example:

Parameter error

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

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

Invalid channel ID

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

Java Request Example

public void testAddRecordTask() {
        String url = "https://api.polyv.net/live/v3/channel/pptRecord/setting";
        // appId和加密串
        String appId = "xxxxxxx";
        String appSecret = "xxxxxxxxxxxxxxxxxx";
        int channelId = 123;
        Map<String, String> params = new HashMap<>();
        params.put("channelId", String.valueOf(channelId));
        params.put("globalSettingEnabled", "N");
        params.put("type", "0");
        params.put("videoRatio", "0");
        // 调用Polyv的工具类方法设置sign
        PolyvTool.setLiveSign(params, appId, appSecret);
        String content = HttpClientUtil.getInstance()
                .sendHttpPost(url, params);
        System.out.println(content);
}
联系客服,在线咨询