Modify Seminar Participation Conditions
Updated: 2024-11-18 15:58:35
API Description
1、修改研讨会的登录条件
2、主要参会条件不能关闭,否则返回参数错误
3、相同参会条件(主要参会条件/次要参会条件),不同角色的开关、认证类型必须相同,否则返回参数错误
4、相同参会条件(主要参会条件/次要参会条件),不同角色的密码/独立授权key必须不同,否则返回参数错误
4、当认证类型是密码登录时,密码不能为空;当认证类型是独立授权时,授权key不能为空,否则返回参数错误
5、主要参会条件和次要参会条件的类型为相同时,不能够同时打开,否则返回参数错误
6、(channelId, timestamp, appId)参与sign签名,并和sign一起通过url传递,请求体参数不参与签名,通过post请求体传递【请设置请求头contentType:application/json】
7、接口支持https协议
API URL
https://api.polyv.net/live/v3/channel/seminar/setting/auth/set
Request Method
POST
API Constraints
- The API supports both HTTP and HTTPS. HTTPS is recommended to ensure security. API calls have frequency limits. See details
Request Parameter Description
| Parameter | Required | Type | Description |
|---|---|---|---|
| appId | true | String | Account appId See details in Get 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 for communication data security. It must never be saved or used directly on the client side. All APIs must be called through the customer's own server to relay to the POLYV server to obtain response data. See details in Signature Generation Rules |
| channelId | true | String | Channel ID. If not provided, the global setting applies. |
Request Body Parameter Description
| Parameter | Required | Type | Description |
|---|---|---|---|
| authSettings | true | Array | Viewing condition settings See details in authSettings field description |
authSettings Field Description
| Parameter | Required | Type | Description |
|---|---|---|---|
| rank | true | Integer | Primary viewing condition is 1, secondary viewing condition is 2 |
| enabled | true | String | Whether to enable participation conditions: N: Disable, Y: Enable |
| roleCode | true | String | Role host: Host attendee: Attendee |
| authType | false | String | Participation condition type password: Password login direct: Independent authorization custom: Custom authorization phone: Whitelist viewing |
| password | false | String | When authType is password, the password for password login |
| directKey | false | String | When authType is direct, set the parameter (optional). Independent authorization SecretKey |
| customUri | false | String | When authType is custom, the custom authorization custom URL |
| customKey | false | String | When authType is custom, the custom authorization SecretKey |
| whiteListInputTips | false | String | When authType is phone, the whitelist input prompt |
Example
https://api.polyv.net/live/v3/channel/seminar/setting/auth/set?appId=frlr1zazn3&sign=E2B692768C6F467B1228B5876625B71E&channelId=2191532×tamp=1621843761626
Request Body Parameters
{
"authSettings": [{
"rank": 1,
"enabled": "Y",
"authType": "password",
"roleCode": "host",
"password": "464nk4"
}, {
"rank": 1,
"enabled": "Y",
"authType": "password",
"roleCode": "attendee",
"password": "w8u81f"
}, {
"rank": 2,
"enabled": "Y",
"authType": "direct",
"roleCode": "host",
"directKey": "b3z0fy1y3z"
}, {
"rank": 2,
"enabled": "Y",
"authType": "direct",
"roleCode": "attendee",
"directKey": "lv2n30e15i"
}]
}
Response Parameter Description
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Response status code. 200 indicates success, non-200 indicates failure See details in Global Error Description |
| status | String | Response status text |
| message | String | Response description. When code is 400 or 500, provides auxiliary error reason description |
| data | String | Returns true on success, empty on error |
Java Request Example
For quick integration of the base 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. The test cases include HttpUtil.java and LiveSignUtil.java in the downloaded file.
It is strongly recommended to use the Live Java SDK for 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.
private static final Logger log = LoggerFactory.getLogger(SeminarAuthTest.class);
/**
* 修改频道观看条件
* @throws IOException
*/
@Test
public void testSetSeminarAuth() throws IOException, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String appId=super.appId;
String appSecret=super.appSecret;
String userId = super.userId;
String timestamp=String.valueOf(System.currentTimeMillis());
//业务参数
String url = "https://api.polyv.net/live/v3/channel/seminar/setting/auth/set";
String channelId = "2191532";
String body = "{\n" +
"\t\"authSettings\": [{\n" +
" \"rank\": 1,\n" +
" \"enabled\": \"Y\",\n" +
" \"authType\": \"password\",\n" +
" \"roleCode\": \"host\",\n" +
" \"password\": \"464nk4\"\n" +
" }, {\n" +
" \"rank\": 1,\n" +
" \"enabled\": \"Y\",\n" +
" \"authType\": \"password\",\n" +
" \"roleCode\": \"attendee\",\n" +
" \"password\": \"w8u81f\"\n" +
" }, {\n" +
" \"rank\": 2,\n" +
" \"enabled\": \"Y\",\n" +
" \"authType\": \"direct\",\n" +
" \"roleCode\": \"host\",\n" +
" \"directKey\": \"b3z0fy1y3z\"\n" +
" }, {\n" +
" \"rank\": 2,\n" +
" \"enabled\": \"Y\",\n" +
" \"authType\": \"direct\",\n" +
" \"roleCode\": \"attendee\",\n" +
" \"directKey\": \"lv2n30e15i\"\n" +
" }]\n" +
"}";
//http 调用逻辑
Map<String,String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("timestamp",timestamp);
requestMap.put("channelId",channelId);
requestMap.put("sign",LiveSignUtil.getSign(requestMap, appSecret));
url = HttpUtil.appendUrl(url, requestMap);
String response = HttpUtil.postJsonBody(url, body, null);
log.info("测试修改频道观看条件接口返回值:{}",response);
//do somethings
}
Response Example
For system-wide global error descriptions, see Global Error Description
Success Example
{
"code": 200,
"status": "success",
"message": "",
"data": true
}
Error Example
{
"code": 400,
"status": "error",
"message": "invalid signature.",
"data": ""
}
{
"code": 400,
"status": "error",
"message": "invalid signature.",
"data": ""
}
{
"code": 10620,
"status": "error",
"message": "role rank empty",
"data": ""
}
{
"code": 10621,
"status": "error",
"message": "enabled cannot be different",
"data": ""
}
{
"code": 10622,
"status": "error",
"message": "auth cannot be different",
"data": ""
}
{
"code": 10623,
"status": "error",
"message": "password cannot be empty",
"data": ""
}
{
"code": 10624,
"status": "error",
"message": "secret key cannot be empty",
"data": ""
}
{
"code": 10625,
"status": "error",
"message": "duplicated seminar role secret key",
"data": ""
}
{
"code": 10601,
"status": "error",
"message": "duplicated seminar role password",
"data": ""
}
{
"code": 10626,
"status": "error",
"message": "unknown role",
"data": ""
}
{
"code": 10627,
"status": "error",
"message": "lack host or attendee",
"data": ""
}
{
"code": 10628,
"status": "error",
"message": "main auth cannot be disabled",
"data": ""
}
{
"code": 10629,
"status": "error",
"message": "duplicated auth",
"data": ""
}
