userBillService
Updated: 2025-09-11 15:18:09
1. Query User Bill Usage Details
Description
查询用户账单使用详情数据
接口地址(仅做说明使用):https://api.polyv.net/live//v4/channel/use-detail/list
Call Constraints
Unit Test
@Test
public void testGetBillUseDetailData() throws IOException, NoSuchAlgorithmException {
LiveGetBillUseDetailRequest liveGetBillUseDetailRequest = new LiveGetBillUseDetailRequest();
LiveGetBillUseDetailResponse liveGetBillUseDetailResponse;
try {
liveGetBillUseDetailRequest.setItemCategory("duration")
.setStartDate(super.getDate(2025, 2, 1))
.setEndDate(super.getDate(2025, 2, 31));
liveGetBillUseDetailResponse = new LiveUserBillServiceImpl().getBillUseDetail(liveGetBillUseDetailRequest);
Assert.assertNotNull(liveGetBillUseDetailResponse);
if (liveGetBillUseDetailResponse != null) {
log.debug("测试查询用户账单使用详情数据成功 {}", JSON.toJSONString(liveGetBillUseDetailResponse));
}
} catch (PloyvSdkException e) {
//参数校验不合格 或者 请求服务器端500错误,错误信息见PloyvSdkException.getMessage()
log.error(e.getMessage(), e);
// 异常返回做B端异常的业务逻辑,记录log 或者 上报到ETL 或者回滚事务
throw e;
} catch (Exception e) {
log.error("SDK调用异常", e);
throw e;
}
}
}
Unit Test Description
If the request is correct, a
LiveGetBillUseDetailResponseobject is returned. The B-end processes business logic based on this object.If the request parameter validation fails, a
PloyvSdkExceptionis thrown. The error message can be found inPloyvSdkException.getMessage(), e.g., [ Input parameter [xxx.chat.LivexxxRequest] object validation failed, failed fields [pic cannot be empty / msg cannot be empty] ]If the server encounters an exception, a
PloyvSdkExceptionis thrown. The error message can be found inPloyvSdkException.getMessage(), e.g., [ Error returned from Polyv request, request serial number: 66e7ad29fd04425a84c2b2b562d2025b, error reason: invalid signature. ]
Request Parameter Description
| Parameter Name | Required | Type | Description |
|---|---|---|---|
| itemCategory | true | String | Billing item, required; duration: Live streaming minutes; concurrence: Live streaming concurrency; mic_duration: Mic connection minutes; ppt_anim: PPT animation transcoding; guide_duration: Director console; ppt_composite: Courseware remastering; distribute: Cloud distribution; aiPPTVideoEnabled: Smart course creation (excluding digital human); aiPPTVideoWithDigital: Smart course creation (including digital human); aiAssistantEnabled: AI assistant Q&A; aiSmartClipEnabled: Smart clipping |
| startDate | true | Date | Start date, required, format: yyyy-MM-dd, cross-month queries are not allowed |
| endDate | true | Date | End date, required, format: yyyy-MM-dd, cross-month queries are not allowed |
| channelId | false | String | Channel ID |
| currentPage | false | Integer | Page number, default is 1 [corresponds to the pageNumber field in the API documentation] |
| pageSize | false | Integer | Number of data items per page, default is 20 items per page |
| appId | false | String | POLYV user APP_ID, required for multi-account calls (i.e., when initMultiAccount() is called to set up multi-account calls). Obtain it by registering on the Polyv official website: Official website -> Login -> Live Streaming (Development Settings) |
| appSecret | false | String | POLYV user APP_SECRET, required for multi-account calls (i.e., when initMultiAccount() is called to set up multi-account calls). Obtain it by registering on the Polyv official website: Official website -> Login -> Live Streaming (Development Settings) |
Return Object Description
| Parameter Name | Type | Description |
|---|---|---|
| contents | Array | Bill usage details [see BillUseDetail parameter description] |
| pageSize | Integer | Number of data items per page, default is 20 items per page |
| currentPage | Integer | Current page [corresponds to the pageNumber field in the API documentation] |
| totalItems | Integer | Total number of records |
| totalPage | Integer | Total number of pages [corresponds to the totalPages field in the API documentation] |
BillUseDetail Parameter Description
| Parameter Name | Type | Description |
|---|---|---|
| channelId | String | Channel ID |
| consumed | Integer | Usage amount |
| consumeUnit | String | Usage unit |
| endTime | Date | End time |
| itemCategory | String | Billing item, duration: Live streaming minutes; concurrence: Live streaming concurrency; mic_duration: Mic connection minutes; ppt_anim: PPT animation transcoding; guide_duration: Director console; ppt_composite: Courseware remastering; distribute: Cloud distribution |
| itemName | String | Item details, e.g., Domestic viewing duration, 1v1~6 mic connection, etc. |
| production | String | Product, e.g., live |
| recordId | String | Record ID |
| remark | String | Remark |
| startTime | Date | Start time |
| statDate | String | Billing date |
