获取账单列表
接口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>";
?>
Last updated
Was this helpful?