取得頻道抽獎的中獎記錄
更新時間: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;
?>