Get Bill Detail List
Updated: 2022-09-02 18:08:07
Interface URL
http://api.polyv.net/live/v3/finance/bill/list-detail
Interface Description
Paginated retrieval of daily account bill list.
Interface supports HTTPS.
Request Method
GET
Request Parameters
| Parameter | Required | Type & Range | Description |
|---|---|---|---|
| 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 the customer's own server to relay requests to the POLYV server and obtain response data. For details, see Signature Generation Rules. |
| appId | true | string | The appId under the developer account. |
| timestamp | true | string | 13-digit current timestamp. |
| type | false | string | Bill type: live (cloud live streaming), mic (mic connection). Default: live. |
| page | false | int | Page number. |
| pageSize | false | int | Number of items per page. |
| startDay | false | string | Start time, format: YYYY-MM-DD. |
| endDay | false | string | End time, format: YYYY-MM-DD. |
| channelId | false | int | Channel ID. |
Example of Successful JSON Response
{
"code": 200,
"status": "success",
"message": "",
"data": {
"pageSize": 2,
"pageNumber": 1,
"totalItems": 123,
"contents": [
{
"id": "xx",
"total": 1,
"channelId": 431596,
"joinTime": "09:46:35",
"leaveTime": "09:46:38",
"resumeDate": "2020-03-25",
"uid": "1585100782973",
"productType": "云直播",
"desc": "回放",
"nick": "肇庆观众/87907"
},
{
"id": "xxx",
"total": 2,
"channelId": 902256,
"joinTime": "15:09:06",
"leaveTime": "15:10:39",
"resumeDate": "2020-03-24",
"uid": "60806543b2",
"productType": "云直播",
"desc": "直播",
"nick": "huahua li"
}
],
"startRow": 1,
"firstPage": true,
"lastPage": false,
"nextPageNumber": 2,
"prePageNumber": 1,
"limit": 2,
"totalPages": 62,
"endRow": 2,
"offset": 0
}
}
Example of Failed JSON Response:
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 bill type
{
"code": 400,
"status": "error",
"message": "invalid bill type",
"data": ""
}
Field Description
| Field | Type & Range | Description |
|---|---|---|
| code | int | Interface request status code, 200 indicates success. |
| status | string | Interface request status, "success" indicates success. |
| message | string | Error message returned when the request fails. |
| data | Paginator |
Paginated result of the bill. |
Data Object Field Description
Paginator
Description: Paginated result of bill records.
| Field | Type & Range | Description |
|---|---|---|
| pageNumber | int | Current page number. |
| totalItems | int | Total number of records. |
| firstPage | boolean | Whether it is the first page, value: true/false. |
| lastPage | boolean | Whether it is the last page, value: true/false. |
| nextPageNumber | int | Next page number. |
| prePageNumber | int | Previous page number. |
| totalPages | int | Total number of pages. |
| startRow | int | Position of the first record on the current page within the total records. |
| endRow | int | Position of the last record on the current page within the total records. |
| limit | int | Number of records on the current page. |
| contents | List |
List of bills. |
BillDetailModel
Description: Bill record.
| Field | Type & Range | Description |
|---|---|---|
| id | string | String, differs between mic connection and cloud live streaming. Auto-increment for mic connection, may be empty for cloud live streaming. |
| total | int | Total consumption duration, in minutes. |
| channelId | string | Channel ID. |
| joinTime | int | Join time. |
| leaveTime | string | Leave time. |
| resumeDate | string | Consumption date. |
| productType | string | Product item. |
| uid | string | User ID. |
| desc | string | Details. |
| nick | long | Nickname. |
PHP Request Example
<?php
//引用config.php
include 'config.php';
$type = "mic";
$params = array(
'appId'=>$appId,
'type'=>$type,
'timestamp'=>$timestamp
);
//生成sign
$sign = getSign($params); //详细查看config.php文件
$params['sign'] = $sign;
$url="http://api.polyv.net/live/v3/finance/bill/list-detail?".http_build_query($params);
echo "<script>window.location.href='$url'</script>";
?>
