Get Remake Courseware Parameters
Updated: 2022-09-02 18:08:07
Interface URL
https://api.polyv.net/live/v3/channel/pptRecord/get-setting
Interface Description
1、接口用于设置重制课件参数
2、接口支持https
Supported Format
JSON
Request Method
GET、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 13-digit millisecond timestamp |
| 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 number |
Successful Response JSON Example:
{
"code": 200,
"status": "success",
"message": "",
"data": {
"channelId": 1947328,
"userId": "cf7f07e096",
"type": 0,
"globalSettingEnabled": "N",
"backgroundImg": "http://liveimages.videocc.net/uploaded/images/2020/12/fu9tqrl4wj.jpg",
"videoRatio": "0",
"brandImg": "http://liveimages.videocc.net/uploadimage/20201224/remakeCoursewareBg_1608804635322_7656406.png",
"createdTime": 1602471455000,
"lastModified": 1608859631000
}
}
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.globalSettingEnabled | Whether to use global settings: Y. Yes, N. No |
| data.type | Video layout mode: 0. Triple screen, 1. Document only |
| data.videoRatio | Camera aspect ratio: 0 for 16:9, 1 for 4:3 |
| data.brandImgFile | Display image |
| data.backgroundImgFile | Background image |
Failed Response JSON Example:
Parameter error
{
"code": 400,
"status": "error",
"message": "param validate error",
"data": ""
}
appId not provided
{
"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 number
{
"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/get-setting";
// appId和加密串
String appId = "xxxxxxx";
String appSecret = "xxxxxxxxxxxxxxxxxx";
int channelId = 123;
Map<String, String> params = new HashMap<>();
params.put("channelId", String.valueOf(channelId));
// 调用Polyv的工具类方法设置sign
PolyvTool.setLiveSign(params, appId, appSecret);
String content = HttpClientUtil.getInstance()
.sendHttpPost(url, params);
System.out.println(content);
}
