Query Viewer Enrollment and Audit Status
Used by integrators to query a viewer's enrollment status by channel ID + integrator viewer ID before the viewer enters to watch, so as to determine whether the viewer meets the enrollment viewing requirements. Used together with Query Channel Enrollment Viewing Configuration and Submit Viewer Enrollment Information.
API Description
1、按频道号和接入方观众ID查询该观众的报名及审核状态,无需获取频道全部报名记录
2、观众无有效报名记录时返回未报名(hasEnroll=N),不作为接口调用失败
3、提交报名成功或保利威后台完成审核后,再次查询即可获取更新后的状态(接口有短暂缓存,提交报名后立即查询返回最新值,后台审核结果最长延迟约1分钟)
4、接口支持https协议
API URL
http://api.polyv.net/live/v4/channel/enroll/record/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. For details, please see
It is recommended to call the API when the viewer enters the viewing page (e.g., query once before entering the live page) to avoid high-frequency polling at fixed intervals.
Request Parameter Description
| Parameter Name | Required | Type | Description |
|---|---|---|---|
| appId | true | String | Account appId [see Obtain Key for details] |
| 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 key information for communication data security. It is strictly prohibited to save it on the client for direct use. All APIs must be called through the customer's own server to relay to the POLYV server to obtain response data [see Signature Generation Rules for details] |
| channelId | true | Integer | Channel ID |
| viewerId | true | String | Integrator viewer ID, the viewer ID passed when submitting enrollment |
Example
http://api.polyv.net/live/v4/channel/enroll/record/get?appId=frlr1zazn3&sign=16DC042339E27BAD00452D004C1FA9CA&channelId=5588786&viewerId=viewer001×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 | Enrollment status [see data field description for details] |
| error | Object | Error information when the status code is non-200 [see Error field description for details] |
| requestId | String | Request ID, a unique UUID generated for each request, which can only be used 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 enrollment viewing switch, Y: enabled, N: disabled |
| auditEnabled | String | Enrollment audit switch, Y: enabled, N: disabled |
| hasEnroll | String | Whether the viewer has enrolled, Y: enrolled, N: not enrolled (not enrolled does not count as an API call failure) |
| auditStatus | String | Audit status, W: pending review, P: approved, F: rejected; empty when not enrolled. When the channel does not enable audit (auditEnabled=N), successful enrollment means the viewing requirement is met, and this field does not need to be considered |
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 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 HTTP request thread pools.
private static final Logger log = LoggerFactory.getLogger(ChannelEnrollControllerTest.class);
/**
* 查询观众报名及审核状态
* @throws IOException
* @throws NoSuchAlgorithmException
*/
@Test
public void testGetEnrollStatus() 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/record/get";
Integer channelId = 5588786;
String viewerId = "viewer001";
Map<String, String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("timestamp", timestamp);
requestMap.put("channelId", String.valueOf(channelId));
requestMap.put("viewerId", viewerId);
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 (not enrolled)
{
"code": 200,
"status": "success",
"success": true,
"data": {
"enabled": "Y",
"auditEnabled": "N",
"hasEnroll": "N",
"auditStatus": null
}
}
Success example (enrolled, pending review)
{
"code": 200,
"status": "success",
"success": true,
"data": {
"enabled": "Y",
"auditEnabled": "Y",
"hasEnroll": "Y",
"auditStatus": "W"
}
}
Exception example
{
"code": 400,
"status": "error",
"success": false,
"error": {
"code": 400,
"desc": "找不到频道"
}
}
