保利威文档中心

幫助中心

取得帳單明細列表

更新時間:2022-09-02 18:08:07

介面URL

http://api.polyv.net/live/v3/finance/bill/list-detail

介面說明

分頁取得帳號日帳單列表
介面支援https

請求方式

GET

請求參數

參數名 必填 類型及範圍 說明
sign true 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
channelId false int 頻道號

返回正確結果JSON範例

{
    "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
    }
}

回應失敗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 帳單列表
BillDetailModel

說明:抽獎記錄

欄位 類型及範圍 說明
id string 字串,連麥和雲直播有不同,連麥自增,雲直播可能為空
total int 總消費時長,單位分鐘
channelId string 頻道號
joinTime int 加入時間
leaveTime string 離開時間
resumeDate string 消費時間
productType string 產品項
uid string 使用者Id
desc string 明細
nick 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-detail?".http_build_query($params);
echo "<script>window.location.href='$url'</script>";
?>
联系客服,在线咨询