Query User Bill Usage Details
Updated: 2026-08-03 16:22:07
API Description
1、查询用户账单使用明细数据
2、接口支持https协议
API URL
http://api.polyv.net/live/v4/channel/use-detail/list
Request Method
GET
API Constraints
- The API supports both HTTP and HTTPS. HTTPS is recommended for security. API calls have frequency limits. See details
Request Parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
| appId | true | String | Account appId See details on obtaining keys |
| timestamp | true | String | 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 never be stored directly on the client. All APIs must be called from your own server to the POLYV server to obtain response data. See signature generation rules |
| itemCategory | true | String | Billing item, required; duration: live streaming minutes; concurrence: live streaming concurrency; mic_duration: co-hosting minutes; ppt_anim: PPT animation transcoding; guide_duration: director console; ppt_composite : courseware remake; distribute: cloud distribution; aiPPTVideoEnabled: smart course creation (excluding digital humans); aiPPTVideoWithDigital: smart course creation (including digital humans); aiAssistantEnabled: AI assistant Q&A; aiSmartClipEnabled: smart clipping |
| startDate | true | String | Start date, required, format: yyyy-MM-dd, cross-month queries not allowed |
| endDate | true | String | End date, required, format: yyyy-MM-dd, cross-month queries not allowed |
| channelId | false | String | Channel ID, optional |
| pageNumber | false | String | Current page number |
| pageSize | false | String | Page size |
Example
http://api.polyv.net/live/v4/channel/use-detail/list?pageNumber=1&endDate=2023-08-04&itemCategory=duration&appId=frlr1zazn3&sign=EAD6F8790A2AD758C4D15FD81216E074&pageSize=10&startDate=2023-08-04×tamp=1691131787072
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Status code, same as HTTP status code, used to determine basic response status |
| data | Object | See Data parameter description |
| error | Object | Error information when status code is not 200 See Error parameter description |
| requestId | String | Request ID, a unique UUID generated for each request, only for troubleshooting and debugging, should not be tied to business logic |
| status | String | Response result, determined by business logic, returns success on success, error on failure |
| success | Boolean | Whether the response was successful |
Data Parameter Description
| Parameter | Type | Description |
|---|---|---|
| contents | Array | Paginated data collection See Contents parameter description |
| pageNumber | Integer | Current page number |
| pageSize | Integer | Page size |
| totalItems | Integer | Total number of records |
| totalPages | Integer | Total number of pages |
Contents Parameter Description
| Parameter | Type | Description |
|---|---|---|
| channelId | Integer | Channel ID |
| consumeUnit | String | Usage unit |
| consumed | Integer | Usage amount |
| endTime | String | End time |
| itemCategory | String | Billing item, duration: live streaming minutes; concurrence: live streaming concurrency; mic_duration: co-hosting minutes; ppt_anim: PPT animation transcoding; guide_duration: director console; ppt_composite: courseware remake; distribute: cloud distribution |
| itemName | String | Item details, e.g., domestic viewing duration, 1v1~6 co-hosting, etc. |
| production | String | Product, e.g., live |
| recordId | String | Record ID |
| remark | String | Remarks |
| sessionId | String | Session ID, empty when no session data exists |
| avgBitRate | String | Average bitrate, unit: kbps, empty when no bitrate data exists |
| startTime | String | Start time |
| statDate | String | Billing date |
Error Parameter Description
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Error code, used to determine the specific error cause |
| desc | String | Error description, corresponds to error.code |
Java Request Example
For quick integration of basic code, download the relevant dependency source code. Click to download source code. After downloading, add it to your own source project. HttpUtil.java and LiveSignUtil.java in the test cases are included in the download 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 pools.
private static final Logger log = LoggerFactory.getLogger(getClass());
/**
* 查询用户账单使用明细数据
* @throws IOException
* @throws NoSuchAlgorithmException
*/
@Test
public void useDetailListTest() 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/use-detail/list";
String startDate = "2023-08-04";
String endDate = "2023-08-04";
String itemCategory = "duration";
String pageNumber = "1";
String pageSize = "10";
//http 调用逻辑
Map<String, String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("endDate", endDate);
requestMap.put("itemCategory", itemCategory);
requestMap.put("startDate", startDate);
requestMap.put("timestamp", timestamp);
requestMap.put("pageNumber", pageNumber);
requestMap.put("pageSize", pageSize);
requestMap.put("sign", LiveSignUtil.getSign(requestMap, appSecret));
String response = HttpUtil.get(url, requestMap);
log.info("测试查询用户账单使用明细数据成功:{}", response);
//do somethings
}
Response Example
See Global Error Description for system-wide error explanations.
Success Example
{
"code": 200,
"status": "success",
"requestId": "f2d3faf76c90440b80b91a21a36df545.67.16911317891895057",
"data": {
"pageNumber": 1,
"pageSize": 10,
"totalPages": 1,
"totalItems": 1,
"contents": [
{
"statDate": "2023-08-04",
"production": "直播",
"itemCategory": "直播分钟数",
"itemName": "国内观看时长",
"channelId": 3346714,
"recordId": "test-001234",
"consumed": 1,
"consumeUnit": "分钟",
"startTime": "2023-08-04 13:03:01",
"endTime": "2023-08-04 14:48:36",
"remark": "测试-001234",
"sessionId": "20230804130301999999",
"avgBitRate": "1200"
}
]
},
"success": true
}
Error Example
{
"code": 400,
"status": "error",
"requestId": "d310b70bc329403f87f77f9203d50f89.128.16360831552223589",
"error": {
"code": 20001,
"desc": "application not found."
},
"success": false
}
