接口URL
http://api.polyv.net/live/v3/channel/lottery/download-winner-detail
接口说明
(接口调用有频率限制,详细请查看)
1.导出频道的单场抽奖的中奖记录
2.导出表格格式可具体参考直播后台的导出中奖记录功能
3.接口支持https
请求方式
GET
请求参数
参数名 | 必选 | 类型及范围 | 说明 |
---|---|---|---|
sign | true | string | 校验签名 |
appId | true | string | 开发者账号下的appId |
timestamp | true | string | 13位当前时间的时间戳 |
channelId | true | int | 频道号 |
lotteryId | true | string | 抽奖ID |
返回正确结果JSON示例
响应成功时,接口将返回文件流,格式为.xls,内容为导出的中奖记录数据。
响应失败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": 404,
"status": "error",
"message": "channel not found.",
"data": ""
}
字段说明
参数名 | 说明 |
---|---|
code | 响应代码,失败为400,签名错误为401,异常错误500 |
status | 成功为success,失败为error |
message | 错误时为错误提示消息 |
data | 错误时为空串 |
PHP请求示例
<?php
//引用config.php
include 'config.php';
$channelId = "322120";
$params = array(
'appId'=>$appId,
'lotteryId'=>"ff9yv31sud",
'channelId'=>$channelId,
'timestamp'=>$timestamp
);
//生成sign
$sign = getSign($params); //详细查看config.php文件
$params['sign'] = $sign;
$url="http://api.polyv.net/live/v3/channel/lottery/download-winner-detail?".http_build_query($params);
echo "<script>window.location.href='$url'</script>";
?>