Query Channel Registration Viewing Configuration
For integrators to render a registration form consistent with the Polyv backend on their own pages/Apps, used together with Submit Viewer Registration Information and Query Viewer Registration and Audit Status.
API Description
1、查询频道报名观看的开关、审核开关及报名表单字段配置(字段、展示顺序、必填、选项、提示信息)
2、查询结果与保利威后台当前生效配置一致,后台修改配置后再次查询即可获取最新配置(接口有短暂缓存,最长延迟约1分钟)
3、接口支持https协议
API URL
http://api.polyv.net/live/v4/channel/enroll/setting/get
Request Method
GET
API Constraints
The API supports both HTTP and HTTPS. HTTPS is recommended to ensure API security. API calls are rate-limited; see details.
When the channel has not enabled the registration viewing feature,
enabledreturnsN, which is not considered an API call failure.
Request Parameter Description
| Parameter Name | Required | Type | Description |
|---|---|---|---|
| appId | true | String | Account appId [see Get Key] |
| timestamp | true | Long | Current 13-digit millisecond timestamp, valid within 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 never be stored on the client for direct use. All APIs must be called through the customer's own server relaying to the POLYV server to obtain response data [see Signature Generation Rules] |
| channelId | true | Integer | Channel ID |
Example
http://api.polyv.net/live/v4/channel/enroll/setting/get?appId=frlr1zazn3&sign=16DC042339E27BAD00452D004C1FA9CA&channelId=5588786×tamp=1731128494801
Response Parameter Description
| Parameter Name | Type | Description |
|---|---|---|
| code | Integer | Response status code, 200 for successful return, non-200 for failure |
| status | String | Response result, returns success on success, error on failure |
| success | Boolean | Response result, returns true on success, false on failure |
| data | Object | Registration configuration [see data Field Description] |
| error | Object | Error information when the status code is non-200 [see Error Field Description] |
| requestId | String | Request ID, a unique UUID generated for each request, usable only for troubleshooting and debugging, and should not be tied to business logic |
Error Parameter Description
| Parameter Name | Type | Description |
|---|---|---|
| code | Integer | Error code, used to determine the specific error cause |
| desc | String | Error description, corresponding to error.code |
data Parameter Description
| Parameter Name | Type | Description |
|---|---|---|
| enabled | String | Channel registration viewing switch, Y: enabled, N: disabled |
| auditEnabled | String | Registration audit switch, Y: enabled (requires audit in the Polyv backend after registration), N: disabled (registration is complete upon success) |
| title | String | Registration form title |
| entranceText | String | Registration viewing entrance text |
| banner | String | Registration viewing form header image URL, empty when not configured |
| fillTime | String | Registration fill timing, beforeEnter: when entering the live stream, beforeChat: when participating in interaction |
| fields | Array | Registration form field list, arranged in display order (rank descending) [see fields Field Description] |
fields Parameter Description
| Parameter Name | Type | Description |
|---|---|---|
| id | Integer | Field ID; when submitting registration, the form content uses this ID as the key |
| name | String | Field name (question) |
| rank | Integer | Display order, the larger the value, the earlier it appears |
| tips | String | Input placeholder text |
| required | String | Whether required, Y: required, N: optional |
| type | String | Field type, mobile: mobile phone name: name text: text input radio: single choice checkbox: multiple choice email: email area: region upload: image upload tips: text description privacy: privacy statement |
| options | String | Option content, a JSON array string (e.g. ["男", "女"]), only has a value for single/multiple choice types |
| smsCheck | String | Whether SMS verification is enabled, Y: enabled, N: disabled. This configuration only takes effect on the Polyv viewing page. When submitting registration via the open API, the SMS verification code is not validated; the authenticity of the mobile number is the responsibility of the integrator |
| authType | String | Verification method, has a value when type is mobile, mobile: mobile verification, email: email verification |
| showAreaCodeEnabled | String | Whether to show the area code, Y: show, N: do not show |
| chatNicknameEnabled | String | Whether to use as the source of the chat nickname, only used by the Polyv viewing page, integrators may ignore it |
Java Request Example
For quick integration of the basic code, please download the relevant dependency source code, click to download the source code, and add it to your own source project after downloading. HttpUtil.java and LiveSignUtil.java in the test cases are both included in the downloaded files.
It is strongly recommended that you use the Live Java SDK to complete API integration. The Live Java SDK uniformly encapsulates and optimizes API call logic, exception handling, data signing, and HTTP request thread pools.
private static final Logger log = LoggerFactory.getLogger(ChannelEnrollControllerTest.class);
/**
* 查询频道报名观看配置
* @throws IOException
* @throws NoSuchAlgorithmException
*/
@Test
public void testGetEnrollSetting() 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/enroll/setting/get";
Integer channelId = 5588786;
Map<String, String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("timestamp", timestamp);
requestMap.put("channelId", String.valueOf(channelId));
requestMap.put("sign", LiveSignUtil.getSign(requestMap, appSecret));
String response = HttpUtil.get(url, requestMap);
log.info("查询频道报名观看配置,返回值:{}", response);
// do somethings
}
Response Example
For system global error descriptions, see Global Error Description
Success example
{
"code": 200,
"status": "success",
"success": true,
"requestId": "e1e1870c-89a0-4791-b04e-83fb8ddbe16e",
"data": {
"enabled": "Y",
"auditEnabled": "N",
"title": "填表报名",
"entranceText": "报名观看",
"banner": null,
"fillTime": "beforeEnter",
"fields": [
{
"id": 4085187,
"name": "性别",
"rank": 2,
"tips": "",
"required": "N",
"type": "radio",
"options": "[\"男\", \"女\"]",
"smsCheck": "N",
"chatNicknameEnabled": "N",
"authType": null,
"showAreaCodeEnabled": "Y"
},
{
"id": 4085178,
"name": "手机号码",
"rank": 0,
"tips": "请填写手机号码",
"required": "Y",
"type": "mobile",
"options": "[]",
"smsCheck": "N",
"chatNicknameEnabled": "N",
"authType": "mobile",
"showAreaCodeEnabled": "Y"
}
]
}
}
Exception example
{
"code": 400,
"status": "error",
"success": false,
"error": {
"code": 400,
"desc": "找不到频道"
}
}
