获取频道抽奖的中奖记录
更新时间:2022-09-02 18:08:07
接口URL
http://api.polyv.net/live/v3/channel/lottery/list
接口说明
1.获取频道抽奖的中奖记录
2.接口支持https
请求方式
GET
请求参数
返回错误结果JSON示例
签名错误:
{
"code": 403,
"status": "error",
"message": "invalid signature.",
"data": ""
}
时间戳错误:
{
"code": 400,
"status": "error",
"message": "invalid timestamp.",
"data": ""
}
返回正确结果JSON示例
{
"code": 200,
"status": "success",
"message": "",
"data": {
"pageSize": 10,
"pageNumber": 1,
"totalItems": 1,
"contents": [
{
"recordId": "69aacfc0b7",
"channelId": 108888,
"lotteryId": "feb34vwxyd",
"sessionId": "f6pxc1w8yb",
"viewerId": "plk",
"viewerName": "测试测试",
"winnerCode": "789",
"prize": "测试奖品",
"name": null,
"telephone": null,
"createdTime": 1563763798000,
"lastModified": 1563765266000,
"address": null,
"ext": "{\"receiveInfo\":[{\"field\":\"尊姓大名\",\"value\":\"测试测试\"},{\"field\":\"年龄\",\"value\":\"111\"},{\"field\":\"挖掘机技术哪家强\",\"value\":\"blueshit\"}]}"
}
],
"offset": 0,
"limit": 1,
"nextPageNumber": 1,
"startRow": 1,
"lastPage": true,
"prePageNumber": 1,
"firstPage": true,
"totalPages": 1,
"endRow": 1
}
}
}
字段说明
数据对象字段说明
Paginator
说明:抽奖记录的分页结果
WinnerRecordModel
说明:抽奖记录
WinnerRecordModelExt
说明:中奖记录的拓展信息
ReceiveInfoFieldModel
说明:中奖记录填写的领奖信息
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/list?".http_build_query($params);
$ch = curl_init() or die ( curl_error() );
curl_setopt( $ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 360);
$response = curl_exec ( $ch );
curl_close ( $ch );
echo $response;
?>