取得帳單列表
更新時間:2022-09-02 18:08:07
介面URL
http://api.polyv.net/live/v3/finance/bill/list
介面說明
分頁取得帳號日帳單列表
介面支援https
請求方式
GET
請求參數
| 參數名 | 必填 | 類型及範圍 | 說明 |
|---|---|---|---|
| sign | 是 | String | 簽名,為32位大寫的MD5值,產生簽名的appSecret金鑰作為通訊資料安全的關鍵資訊,嚴禁儲存在用戶端直接使用,所有API都必須透過客戶自己伺服器中轉呼叫POLYV伺服器取得回應資料【詳見簽名產生規則】 |
| appId | true | string | 開發者帳號下的appId |
| timestamp | true | string | 13位當前時間的時間戳 |
| type | false | string | 帳單類型,live:雲直播,mic:連線麥克風 , 預設:live |
| page | false | int | 第幾頁 |
| pageSize | false | int | 每頁大小 |
| startDay | false | string | 開始時間,格式:YYYY-MM-DD |
| endDay | false | string | 結束時間,格式:YYYY-MM-DD |
返回正確結果JSON範例
{
"code": 200,
"status": "success",
"message": "",
"data": {
"pageSize": 2,
"pageNumber": 1,
"totalItems": 78,
"contents": [
{
"userId": "ee7fe7fbda",
"inmonth": "2020-03",
"currentDay": "2020-03-25",
"total": 1,
"billingType": "duration",
"email": "moshunwei@polyv.net",
"unit": "分钟",
"consumerType": "后付费",
"productType": "云直播"
},
{
"userId": "ee7fe7fbda",
"inmonth": "2020-03",
"currentDay": "2020-03-24",
"total": 40,
"billingType": "duration",
"email": "moshunwei@polyv.net",
"unit": "分钟",
"consumerType": "后付费",
"productType": "云直播"
}
],
"startRow": 1,
"firstPage": true,
"lastPage": false,
"nextPageNumber": 2,
"prePageNumber": 1,
"limit": 2,
"totalPages": 39,
"endRow": 2,
"offset": 0
}
}
回應失敗JSON範例:
未輸入appId
{
"code": 400,
"status": "error",
"message": "appId is required.",
"data": ""
}
appId不正確
{
"code": 400,
"status": "error",
"message": "application not found.",
"data": ""
}
時間戳錯誤
{
"code": 400,
"status": "error",
"message": "invalid timestamp.",
"data": ""
}
簽名錯誤
{
"code": 403,
"status": "error",
"message": "invalid signature.",
"data": ""
}
非法帳單類型
{
"code": 400,
"status": "error",
"message": "invalid bill type",
"data": ""
}
欄位說明
| 欄位 | 類型及範圍 | 說明 |
|---|---|---|
| code | int | 介面請求狀態碼,200表示成功 |
| status | string | 介面請求狀態,"success"表示成功 |
| message | string | 請求失敗時返回的錯誤資訊 |
| data | Paginator |
帳單的分頁結果 |
資料物件欄位說明
Paginator
說明:抽獎記錄的分頁結果
| 欄位 | 類型及範圍 | 說明 |
|---|---|---|
| pageNumber | int | 當前的頁數 |
| totalItems | int | 總記錄數 |
| firstPage | boolean | 是否為第一頁,值為:true/false |
| lastPage | boolean | 是否為最後一頁,值為:true/false |
| nextPageNumber | int | 下一頁編號 |
| prePageNumber | int | 上一頁編號 |
| totalPages | int | 總頁數 |
| startRow | int | 當前頁第一條記錄在總記錄中的位置 |
| endRow | int | 當前頁最後一個記錄在總記錄中的位置 |
| limit | int | 當前頁記錄個數 |
| contents | List |
帳單列表 |
BillDailyModel
說明:抽獎記錄
| 欄位 | 類型及範圍 | 說明 |
|---|---|---|
| userId | string | 使用者userId |
| inmonth | string | 帳期 |
| currentDay | string | 消費日期 |
| total | int | 使用分鐘數,單位分鐘 |
| billingType | string | 帳單類型,live:雲直播,mic:連線麥克風 |
| string | 信箱 | |
| unit | string | 單位 |
| consumerType | string | 計費項目 |
| productType | long | 產品項目 |
PHP請求範例
<?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?".http_build_query($params);
echo "<script>window.location.href='$url'</script>";
?>
