Modify Default Template Role Permission Settings
Updated: 2024-07-22 09:16:03
API Description
1、修改角色权限默认模板设置
2、接口支持https协议
API URL
http://api.polyv.net/live/v4/user/template/role-config/update
Request Method
POST
API Constraints
- The API supports both HTTP and HTTPS. HTTPS is recommended to ensure API security. API calls have frequency limits. See details
Request Parameter Description
| Parameter | Required | Type | Description |
|---|---|---|---|
| appId | true | String | Account appId See details on obtaining keys |
| sign | true | String | Signature, a 32-character uppercase MD5 value. The appSecret key used to generate the signature is critical for communication data security. It must never 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 |
| timestamp | true | String | Current 13-digit millisecond timestamp, valid for 3 minutes |
Request Body Parameter Description
| Parameter | Required | Type | Description |
|---|---|---|---|
| teacherConfig | false | Object | Instructor role permission configuration See TeacherConfig parameter description |
| guestConfig | false | Object | Guest role permission configuration See GuestConfig parameter description |
TeacherConfig Parameter Description
| Parameter | Required | Type | Description |
|---|---|---|---|
| webStartCheckInDisplayEnabled | false | String | Broadcast end check-in function display toggle Y: Enable, N: Disable |
| webStartLotteryDisplayEnabled | false | String | Broadcast end lottery function display toggle Y: Enable, N: Disable |
| webStartQuestionnaireDisplayEnabled | false | String | Broadcast end questionnaire function display toggle Y: Enable, N: Disable |
| webStartAnswerDisplayEnabled | false | String | Broadcast end answer card function display toggle Y: Enable, N: Disable |
| webStartTimerDisplayEnabled | false | String | Broadcast end timer function display toggle Y: Enable, N: Disable |
| webStartRedPackDisplayEnabled | false | String | Broadcast end red packet function display toggle Y: Enable, N: Disable |
| webStartCardPushDisplayEnabled | false | String | Broadcast end card push function display toggle Y: Enable, N: Disable |
| webStartNotifyDisplayEnabled | false | String | Broadcast end announcement function display toggle Y: Enable, N: Disable |
| webStartLinkMicDisplayEnabled | false | String | Broadcast end link mic function display toggle Y: Enable, N: Disable |
| webStartMultiMediaDisplayEnabled | false | String | Broadcast end multimedia function display toggle Y: Enable, N: Disable |
| webStartMembersDisplayEnabled | false | String | Broadcast end member list function display toggle Y: Enable, N: Disable |
| screenShareRetainCameraEnabled | false | String | Screen share retain camera state toggle Y: Enable, N: Disable |
| multiplexingDefaultLayout | false | String | Multiplexing layout default application 1: Single mode, 2: Tile mode, 3: Presenter mode |
| cameraSingleModeEnabled | false | String | Camera single mode toggle Y: Enable, N: Disable |
| aiVirtualBgUrl | false | String | AI matting background image |
| remixDefaultEnabled | false | String | Audio remix default toggle Y: Enable, N: Disable |
| showSceneTemplateEnabled | false | String | Show scene template toggle Y: Enable, N: Disable |
| hideFramesDirectionEnabled | false | String | Hide frame direction switch entry toggle Y: Enable, N: Disable |
| defaultOpenMicLinkEnabled | false | String | Default link mic method video: Audio & Video, audio: Audio only |
GuestConfig Parameter Description
| Parameter | Required | Type | Description |
|---|---|---|---|
| webStartCheckInDisplayEnabled | false | String | Broadcast end check-in function display toggle Y: Enable, N: Disable |
| webStartLotteryDisplayEnabled | false | String | Broadcast end lottery function display toggle Y: Enable, N: Disable |
| webStartQuestionnaireDisplayEnabled | false | String | Broadcast end questionnaire function display toggle Y: Enable, N: Disable |
| webStartAnswerDisplayEnabled | false | String | Broadcast end answer card function display toggle Y: Enable, N: Disable |
| webStartRedPackDisplayEnabled | false | String | Broadcast end red packet function display toggle Y: Enable, N: Disable |
| webStartCardPushDisplayEnabled | false | String | Broadcast end card push function display toggle Y: Enable, N: Disable |
| webStartNotifyDisplayEnabled | false | String | Broadcast end announcement function display toggle Y: Enable, N: Disable |
| webStartLinkMicDisplayEnabled | false | String | Broadcast end link mic function display toggle Y: Enable, N: Disable |
| webStartMultiMediaDisplayEnabled | false | String | Broadcast end multimedia function display toggle Y: Enable, N: Disable |
| webStartMembersDisplayEnabled | false | String | Broadcast end member list function display toggle Y: Enable, N: Disable |
| screenShareRetainCameraEnabled | false | String | Screen share retain camera state toggle Y: Enable, N: Disable |
| cameraSingleModeEnabled | false | String | Camera single mode toggle Y: Enable, N: Disable |
| aiVirtualBgUrl | false | String | AI matting background image |
| remixDefaultEnabled | false | String | Audio remix default toggle Y: Enable, N: Disable |
| showSceneTemplateEnabled | false | String | Show scene template toggle Y: Enable, N: Disable |
| hideFramesDirectionEnabled | false | String | Hide frame direction switch entry toggle Y: Enable, N: Disable |
Example
http://api.polyv.net/live/v4/user/template/role-config/update?appId=frlr1zazn3&sign=9C73C7471CF969AD8AC042221C89551D×tamp=1677167340447
Request body JSON parameters:
{
"teacherConfig": {
"webStartCheckInDisplayEnabled": "N"
}
}
Response Parameter Description
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Status code, same as HTTP status code, used to determine the basic response status |
| data | Object | Successful response data |
| error | Object | Error information when status code is not 200 See Error parameter 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 |
| status | String | Response result, determined by business logic, returns success on success, error on failure |
| success | Boolean | Whether the response was successful |
Error Parameter Description
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Error code, used to determine the specific error reason |
| desc | String | Error description, corresponding to error.code |
Java Request Example
For quick integration of 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 for API integration. The Live Java SDK provides unified packaging and optimization for API call logic, exception handling, data signing, and HTTP request thread pooling.
private static final Logger log = LoggerFactory.getLogger(getClass());
/**
* 修改角色权限默认模板设置
* @throws IOException
* @throws NoSuchAlgorithmException
*/
@Test
public void updateRoleConfigTemplateTest() 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/user/template/role-config/update";
//http 调用逻辑
Map<String, String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("timestamp", timestamp);
Map<String, Object> teacherConfigMap = new HashMap<>();
teacherConfigMap.put("webStartCheckInDisplayEnabled", "N");
Map<String, Object> jsonMap = new HashMap<>();
jsonMap.put("teacherConfig", teacherConfigMap);
requestMap.put("sign", LiveSignUtil.getSign(requestMap, appSecret));
url = HttpUtil.appendUrl(url, requestMap);
String response = HttpUtil.postJsonBody(url, JSON.toJSONString(jsonMap), null);
log.info("测试修改角色权限默认模板设置成功:{}", response);
//do somethings
}
Response Example
For system-wide error descriptions, see Global Error Descriptions
Success Example
{
"code": 200,
"status": "success",
"requestId": "a5e9b1d15f544d7a9db6f038156a851d.71.16771673423081591",
"data": null,
"success": true
}
Error Example
{
"code": 400,
"status": "error",
"requestId": "d310b70bc329403f87f77f9203d50f89.128.16360831552223589",
"error": {
"code": 20001,
"desc": "application not found."
},
"success": false
}
