保利威文档中心

帮助中心

获取账单详情列表

更新时间: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>";
?>
联系客服,在线咨询