Registration Viewing Data Query
Updated: 2022-09-02 18:08:07
Interface URL
https://api.polyv.net/live/v3/channel/enroll/list
Interface Description
1、接口用于查询频道报名观看数据
2、接口支持https
Supported Format
JSON
Request Method
GET、POST
Request Limit
TRUE
Request Parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
| appId | Yes | string | Obtained from API settings, the appId registered in the live streaming system |
| timestamp | Yes | long | Current 13-digit millisecond timestamp |
| sign | Yes | String | Signature, a 32-character uppercase MD5 value. The appSecret key used to generate the signature is critical for communication data security. It must not 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 |
| channelId | Yes | int | Channel ID |
Successful Response JSON Example:
{
"code": 200,
"status": "success",
"message": "",
"data": {
"list": [
{
"viewerId": "1617162437311",
"mobile": "15814534111",
"createTime": 1617162473000,
"hasWatched": "Y",
"promoteId": "ppp",
"fields": [
{
"name": "手机号码",
"value": "15814534111"
},
{
"name": "隐私声明",
"value": "√"
},
{
"name": "文本1",
"value": ""
},
{
"name": "地域",
"value": "广东省/广州市/黄埔区"
},
{
"name": "自定义选项",
"value": "选项B"
},
{
"name": "邮箱",
"value": "luoyuanbin@polyv.net"
},
{
"name": "姓名",
"value": "luo"
},
{
"name": "自定义填空题",
"value": "tk"
}
]
}
]
}
}
Response Field Description
| Parameter | Description |
|---|---|
| code | Status code: 200 for success, 403 for signature failure, 400 for parameter error, 500 for server error |
| status | "success" for success, "error" for error |
| message | Empty string for success, error description for failure |
| data | Response data |
| data.list.viewerId | User ID |
| data.list.mobile | Phone number |
| data.list.createTime | Registration time, timestamp |
| data.list.hasWatched | Whether watched: Y for Yes, N for No |
| data.list.promoteId | Promotion channel ID |
| data.list.fields | Registration information |
| data.list.fields.name | Registration field name |
| data.list.fields.value | Registration field value |
Failed Response JSON Example:
Parameter error
{
"code": 400,
"status": "error",
"message": "param validate error",
"data": ""
}
appId not provided
{
"code": 400,
"status": "error",
"message": "appId is required.",
"data": ""
}
Incorrect appId
{
"code": 400,
"status": "error",
"message": "application not found.",
"data": ""
}
Timestamp error
{
"code": 400,
"status": "error",
"message": "invalid timestamp.",
"data": ""
}
Signature error
{
"code": 403,
"status": "error",
"message": "invalid signature.",
"data": ""
}
Invalid channel ID
{
"code": 403,
"status": "error",
"message": "illegal channel id: %s",
"data": ""
}
Java Request Example
public void testAddRecordTask() {
String url = "https://api.polyv.net/live/v3/channel/enroll/list";
// appId和加密串
String appId = "xxxxxxx";
String appSecret = "xxxxxxxxxxxxxxxxxx";
int channelId = 123;
Map<String, String> params = new HashMap<>();
params.put("channelId", String.valueOf(channelId));
// 调用Polyv的工具类方法设置sign
PolyvTool.setLiveSign(params, appId, appSecret);
String content = HttpClientUtil.getInstance()
.sendHttpPost(url, params);
System.out.println(content);
}
