Query Channel Registration Viewing Records
Updated: 2024-12-26 23:26:21
API Description
1、获取频道的登记观看列表数据内容
2、接口支持https协议
API URL
http://api.polyv.net/live/v3/channel/auth/get-record-info
<a href="/req.html?api=http://api.polyv.net/live/v3/channel/auth/get-record-info"" target="_blank">Online API Call
Request Method
GET
API Constraints
- The API supports both HTTP and HTTPS. HTTPS is recommended to ensure security. API calls have frequency limits. See details
Request Parameters 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 within 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 your own server to relay requests to the POLYV server and retrieve responses. See details in Signature Generation Rules |
| channelId | true | String | Channel ID |
| startTime | false | Long | Registration start time. Only queries records later than this time. 13-digit millisecond timestamp. Leave empty for no limit. |
| endTime | false | Long | Registration end time. Only queries records earlier than this time. 13-digit millisecond timestamp. Leave empty for no limit. |
| page | false | Integer | Page number to retrieve, defaults to 1 |
| pageSize | false | Integer | Number of records per page, defaults to 10 |
Example
http://api.polyv.net/live/v3/channel/auth/get-record-info?appId=frlr1zazn3&sign=86CF32ED6AD3D9B9ED5B4459AE4BB2F4&channelId=1965681×tamp=1621844691740
Response Parameters 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. |
| data | Object | Paginated registration viewing list data. See details in data field description |
data Field Description
| Parameter | Type | Description |
|---|---|---|
| pageNumber | Integer | Current page number |
| totalPages | Integer | Total number of pages |
| pageSize | Integer | Number of records per page |
| contents | Array | Current page content. See details in contents field description |
contents Field Description
| Parameter | Type | Description |
|---|---|---|
| createdTime | Long | Registration time, 13-digit millisecond timestamp |
| userId | String | Registered user ID |
| params | String[] | Registration content data, format example: ["San Zang", "9999", "East"] |
Java Request Example
For quick integration of basic code, please download the relevant dependency source code. Click here to download the source code. After downloading, add it to your own source 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 integration. The Live Java SDK provides unified encapsulation and optimization for API call logic, exception handling, data signing, and HTTP request thread pooling.
private static final Logger log = LoggerFactory.getLogger(WatchConditionTest.class);
/**
* 查询频道登记观看记录
* @throws IOException
*/
@Test
public void testGetRecordInfo() throws IOException, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String appId=super.appId;
String appSecret=super.appSecret;
String userId = super.userId;
String timestamp=String.valueOf(System.currentTimeMillis());
//业务参数
String channelId = "1965681";
String url = "http://api.polyv.net/live/v3/channel/auth/get-record-info";
//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));
String response = HttpUtil.get(url, requestMap);
log.info("测试查询频道登记观看记录接口返回值:{}",response);
//do somethings
}
Response Example
For global error descriptions, see Global Error Description
Success Example
{
"code": 200,
"status": "success",
"message": "",
"data": {
"pageNumber": 1,
"totalPages": 1,
"pageSize": 10,
"contents": [{
"createdTime": 1605170081000,
"params": ["三藏", "9999", "东方"]
}, {
"createdTime": 1605170044000,
"params": ["悟空", "10000", "大唐"]
}]
}
}
Error Example
{
"code": 400,
"status": "error",
"message": "invalid signature.",
"data": ""
}
