Query Channel Co-Streaming Detail Data
API Description
1、接口用于查询某个频道的一段时间区间内的连麦详情数据,支持分页
2、接口支持https协议
API URL
http://api.polyv.net/live/v3/channel/mic/log/list-detail
Request Method
GET
API Constraints
The API supports both HTTP and HTTPS. HTTPS is recommended for security. API calls have frequency limits. See details
The data queried by this API is not real-time. Data for the current day is only generated starting from the afternoon of the following day. Processing and generation times vary by RTC vendor, typically taking approximately 6 to 48 hours.
The interval between startDate and endDate must not exceed 30 days.
Request Parameter Description
| Parameter | Required | Type | Description |
|---|---|---|---|
| appId | true | String | Account appId See details for obtaining secret key |
| 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 critical for communication data security. It must not be 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 | true | String | Channel ID |
| startDate | true | String | Start date, format: yyyy-MM-dd, e.g., 2020-10-01. Time range must not exceed 30 days. |
| endDate | true | String | End date, format: yyyy-MM-dd, e.g., 2020-10-01. Time range must not exceed 30 days. |
| page | false | Integer | Current page number, defaults to 1 |
| pageSize | false | Integer | Number of records per page, defaults to 500, maximum 5000. For more than 5000 records, fetch in batches by incrementing page until the contents list is empty. |
Example
http://api.polyv.net/live/v3/channel/mic/log/list-detail?endDate=2020-12-03&appId=frlr1zazn3&sign=F8ABBFE2C714CE6601D2551928EA704A&pageSize=2&page=1&userId=1b448be323&channelId=1965681&startDate=2020-12-01×tamp=1621842680333
Response Parameter Description
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Response status code, 200 for success, non-200 for failure See global error description |
| status | String | Response status text |
| message | String | Response description, provides error details when code is 400 or 500 |
| data | Object | Co-streaming detail information on success [See Data parameter description](/live/api/channel/viewdata/link_mic_detail_list.md?id=polyv1], empty on failure |
Data Parameter Description
| Parameter | Type | Description |
|---|---|---|
| page | Integer | Current page number, defaults to 1 |
| pageSize | Integer | Number of records per page, defaults to 500, maximum 5000. For more than 5000 records, fetch in batches by incrementing page until the contents list is empty. |
| contents | Array | Query result list See Contents parameter description |
Contents Parameter Description
| Parameter | Type | Description |
|---|---|---|
| channelId | String | Channel ID |
| sessionId | String | Session ID |
| viewerId | String | Viewer ID |
| identity | String | Identity guest: Guest student: Student |
| nickname | String | Nickname |
| joinTime | Long | Time of joining RTC, 13-digit millisecond timestamp |
| leaveTime | Long | Time of leaving RTC, 13-digit millisecond timestamp |
| duration | Integer | Co-streaming duration (in minutes) |
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(ChannelViewDataTest.class);
/**
* 查询频道连麦详情数据
* @throws IOException
*/
@Test
public void testLinkMicDetailList() throws IOException, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String appId = super.appId;
String appSecret = super.appSecret;
String userId = super.userId;
String timestamp = String.valueOf(System.currentTimeMillis());
//业务参数
String url = "https://api.polyv.net/live/v3/channel/mic/log/list-detail";
String channelId = "1965681";
String startDate = "2020-12-01";
String endDate = "2020-12-03";
String page = "1";
String pageSize = "2";
//http 调用逻辑
Map<String,String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("timestamp",timestamp);
requestMap.put("userId",userId);
requestMap.put("channelId",channelId);
requestMap.put("startDate",startDate);
requestMap.put("endDate",endDate);
requestMap.put("page",page);
requestMap.put("pageSize",pageSize);
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":{
"page":1,
"pageSize":2,
"contents":[
{
"channelId":"1965681",
"identity":"student",
"viewerId":"1606986299073",
"nickname":"",
"joinTime":1606986326000,
"leaveTime":1606986413000,
"sessionId":"ftmnaan4l3"
}
]
}
}
Error Example
{
"code": 400,
"status": "error",
"message": "invalid signature.",
"data": ""
}
