Query Channel Registration and Viewing Configuration
This allows integrators to render a registration form consistent with the Polyv backend on their own pages/Apps, and to use it 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-for-viewing feature,
enabledreturnsN, which is not treated as 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 for 3 minutes |
| sign | 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 saved on the client for direct use. All APIs must be called through the customer's own server as a relay 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 not 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-for-viewing switch, Y: enabled, N: disabled |
| auditEnabled | String | Registration audit switch, Y: enabled (registration requires review in the Polyv backend), N: disabled (registration is complete upon success) |
| smsRemindEnabled | String | Registration SMS reminder switch, consistent with the backend "Marketing Interaction → Registration → SMS Reminder" configuration, Y: enabled, N: disabled |
| smsEnabled | String | Channel registration SMS feature switch, Y: enabled, N: disabled |
| title | String | Registration form title |
| entranceText | String | Registration-for-viewing entry text |
| banner | String | Registration-for-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 | List of registration form fields, 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 higher the position |
| tips | String | Input hint 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-choice/multiple-choice types |
| smsCheck | String | Whether to enable SMS verification, Y: enabled, N: disabled. This configuration only takes effect on the Polyv viewing page. When submitting registration through 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, used only by the Polyv viewing page, integrators may ignore it |
Java Request Example
For quick integration with 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 file.
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 the HTTP request thread pool.
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-wide 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",
"smsRemindEnabled": "N",
"smsEnabled": "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": "找不到频道"
}
}
