Paginated Query of Channel Lottery Statistics Records
Updated: 2026-03-12 18:04:00
Interface Description
1、分页查询频道抽奖统计记录
2、接口支持https协议
Interface URL
http://api.polyv.net/live/v4/channel/lottery/activity-record/list
Request Method
GET
Interface Constraints
- The interface supports both HTTP and HTTPS. HTTPS is recommended to ensure interface security. Interface calls have frequency limits. See details
Request Parameter Description
| Parameter | Required | Type | Description |
|---|---|---|---|
| appId | true | String | Account appId See details for obtaining secret key |
| timestamp | true | Long | Current 13-digit millisecond timestamp, valid within 3 minutes |
| sign | true | String | Signature, a 32-character uppercase MD5 value. The appSecret key used to generate the signature is critical for communication data security. It must not be saved on the client side for direct use. All APIs must be called through the customer's own server to relay requests to the POLYV server for response data. See details for signature generation rules |
| channelId | true | Integer | Channel ID |
| sessionId | false | String | Session ID |
| startTimeBegin | false | Long | Start time - beginning range, 13-digit millisecond timestamp |
| startTimeEnd | false | Long | Start time - end range, 13-digit millisecond timestamp |
| lotteryId | false | String | Lottery activity ID |
| pageNumber | false | Integer | Page number |
| pageSize | false | Integer | Page size |
Example
http://api.polyv.net/live/v4/channel/lottery/activity-record/list?appId=frlr1zazn3×tamp=1665629374000&sign=6CFA3141718E1AF0155889EEA2988206&channelId=5765904&pageNumber=1
Response Description
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Status code, same as HTTP status code, used to determine the basic response status |
| status | String | Response result, determined by business logic. Returns success on success, error on failure |
| success | Boolean | Whether the response was successful |
| requestId | String | Request ID, a unique UUID generated for each request. Only used for troubleshooting and debugging, should not be tied to business logic |
| error | Object | Error information when status code is not 200 See details for Error field description |
| data | Object | Detailed response information See details for data field description |
Error Response Description
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Error code, used to determine the specific error reason |
| desc | String | Error description, corresponding to error.code |
Data Response Description
| Parameter | Type | Description |
|---|---|---|
| pageNumber | Integer | Page number |
| pageSize | Integer | Page size |
| totalPages | Integer | Total number of pages |
| totalItems | Long | Total number of records |
| contents | Array | List of lottery activity statistics See details for contents field description |
Contents Response Description
| Parameter | Type | Description |
|---|---|---|
| lotteryId | String | Lottery ID |
| userId | String | User ID |
| channelId | Integer | Channel ID |
| lotteryCondition | String | Participation condition: none (unconditional), invite (invite friends), duration (watch duration), question (quiz), questionnaire (survey) |
| inviteType | String | Invitation method: poster (invitation poster), external (external invitation) |
| status | String | Lottery status: wait (not started), start (in progress), finish (ended), cancel (cancelled), lottery (drawing) |
| createTime | Long | Creation time, 13-digit millisecond timestamp |
| updateTime | Long | Update time, 13-digit millisecond timestamp |
| startTime | Long | Lottery start time, 13-digit millisecond timestamp |
| endTime | Long | Lottery end time, 13-digit millisecond timestamp |
| lotteryMode | String | Lottery mode: wait (scheduled), immediate (instant), task (task-based) |
| sessionId | String | Session ID |
| activityName | String | Activity name |
| subLotteryList | Array | Sub-lottery statistics list See details for SubLotteryList field description |
SubLotteryList Response Description
| Parameter | Type | Description |
|---|---|---|
| lotteryId | String | Sub-lottery ID |
| masterLotteryId | String | Master lottery ID |
| sort | Integer | Sort order |
| status | String | Sub-lottery status: wait (not started), lottery (drawing) |
| channelId | Integer | Channel ID |
| userId | String | Account userId |
| sessionId | String | Live session ID at the time of the lottery |
| lotteryRange | String | Candidate range for the lottery: notWinning (non-winners) |
| actor | String | Title name when drawing by title |
| prize | String | Prize name |
| amount | Integer | Number of winners (preset) |
| preset | String | Preset winners, separated by commas |
| ext | String | JSON format string representing additional lottery extension information |
| winnerCount | Integer | Actual number of winners |
| totalUsers | Integer | Number of participants in the lottery |
| createdTime | Long | Lottery time, 13-digit millisecond timestamp |
| lotteryExt | Object | Additional lottery extension information See details for LotteryExt field description |
LotteryExt Response Description
| Parameter | Type | Description |
|---|---|---|
| collectInfo | Array | List of winner prize collection information See details for CollectInfo field description |
CollectInfo Response Description
| Parameter | Type | Description |
|---|---|---|
| type | String | Type: userName (name), userPhone (phone number), custom (custom) |
| field | String | Field name |
| tips | String | Prompt text |
| required | Boolean | Whether required: true/false |
Java Request Example
For quick integration of basic code, please download the relevant dependency source code. Click to download source code. After downloading, add it to your own source code project. The HttpUtil.java and LiveSignUtil.java in the test cases are included in the downloaded file.
It is strongly recommended to use the Live Java SDK for API functionality integration. The Live Java SDK provides unified encapsulation and optimization for API call logic, exception handling, data signing, and HTTP request thread pools.
private static final Logger log = LoggerFactory.getLogger(ChannelLotteryTest.class);
/**
* 分页查询频道抽奖活动统计记录
* @throws IOException
* @throws NoSuchAlgorithmException
*/
@Test
public void testPageLotteryActivityRecord() throws IOException, NoSuchAlgorithmException {
// 公共参数,填写自己的实际参数
String appId = super.appId;
String appSecret = super.appSecret;
String timestamp = String.valueOf(System.currentTimeMillis());
// 业务参数
String url = "http://api.polyv.net/live/v4/channel/lottery/activity-record/list";
Integer channelId = 5765904;
Integer pageNumber = 1;
Map<String, String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("timestamp", timestamp);
requestMap.put("channelId", String.valueOf(channelId));
requestMap.put("pageNumber", String.valueOf(pageNumber));
requestMap.put("sign", LiveSignUtil.getSign(requestMap, appSecret));
String response = HttpUtil.get(url, requestMap);
log.info("测试分页查询频道抽奖活动统计记录,返回值:{}", response);
// do somethings
}
Response Example
For system-wide error descriptions, see Global Error Description
Success Example
{
"code": 200,
"status": "success",
"requestId": "48978442-c4a8-4e6d-a08e-cf3fdf6f2c1b",
"data": {
"pageNumber": 1,
"pageSize": 10,
"totalPages": 2,
"totalItems": 11,
"contents": [
{
"lotteryId": "h6udiwy1nj",
"userId": "2b3ccac944",
"channelId": 5765904,
"lotteryCondition": "questionnaire",
"inviteType": null,
"status": "cancel",
"createTime": 1745826290000,
"updateTime": 1745828914000,
"startTime": 1745996400000,
"endTime": 1745996460000,
"lotteryMode": "wait",
"sessionId": "",
"activityName": "问卷抽奖",
"subLotteryList": [
{
"lotteryId": "h6udixblav",
"masterLotteryId": "h6udiwy1nj",
"sort": 0,
"status": "wait",
"channelId": 5765904,
"userId": "2b3ccac944",
"sessionId": "",
"lotteryRange": "notWinning",
"actor": null,
"prize": "团购券100元",
"amount": 1,
"preset": "",
"ext": "{\"collectInfo\":[{\"type\":\"userName\",\"field\":\"姓名\",\"tips\":\"请输入您的名称\",\"required\":true},{\"type\":\"userPhone\",\"field\":\"手机\",\"tips\":\"请输入您的手机号码\",\"required\":true}]}",
"winnerCount": 0,
"totalUsers": 0,
"createdTime": 1745826290000,
"lotteryExt": {
"collectInfo": [
{
"field": "姓名",
"tips": "请输入您的名称",
"type": "userName",
"required": true
},
{
"field": "手机",
"tips": "请输入您的手机号码",
"type": "userPhone",
"required": true
}
]
}
},
{
"lotteryId": "h6udixerdd",
"masterLotteryId": "h6udiwy1nj",
"sort": 1,
"status": "wait",
"channelId": 5765904,
"userId": "2b3ccac944",
"sessionId": "",
"lotteryRange": "notWinning",
"actor": null,
"prize": "团购券50元",
"amount": 2,
"preset": "",
"ext": "{\"collectInfo\":[{\"type\":\"userName\",\"field\":\"姓名\",\"tips\":\"请输入您的名称\",\"required\":true},{\"type\":\"userPhone\",\"field\":\"手机\",\"tips\":\"请输入您的手机号码\",\"required\":true}]}",
"winnerCount": 0,
"totalUsers": 0,
"createdTime": 1745826290000,
"lotteryExt": {
"collectInfo": [
{
"field": "姓名",
"tips": "请输入您的名称",
"type": "userName",
"required": true
},
{
"field": "手机",
"tips": "请输入您的手机号码",
"type": "userPhone",
"required": true
}
]
}
}
]
},
{
"lotteryId": "h6qw06qmx8",
"userId": "2b3ccac944",
"channelId": 5765904,
"lotteryCondition": "none",
"inviteType": null,
"status": "finish",
"createTime": 1745553059000,
"updateTime": 1745553640000,
"startTime": 1745553600000,
"endTime": 1745553630000,
"lotteryMode": "task",
"sessionId": "",
"activityName": "抽奖",
"subLotteryList": [
{
"lotteryId": "h6qw06qmx8",
"masterLotteryId": "h6qw06qmx8",
"sort": 0,
"status": "wait",
"channelId": 5765904,
"userId": "2b3ccac944",
"sessionId": "h6que674kh",
"lotteryRange": "notWinning",
"actor": null,
"prize": "苹果",
"amount": 1,
"preset": "",
"ext": "{\"collectInfo\":[{\"field\":\"姓名\",\"tips\":\"请输入您的名称\",\"type\":\"userName\",\"required\":true},{\"field\":\"手机\",\"tips\":\"请输入您的手机号码\",\"type\":\"userPhone\",\"required\":true}]}",
"winnerCount": 0,
"totalUsers": 0,
"createdTime": 1745553600000,
"lotteryExt": {
"collectInfo": [
{
"field": "姓名",
"tips": "请输入您的名称",
"type": "userName",
"required": true
},
{
"field": "手机",
"tips": "请输入您的手机号码",
"type": "userPhone",
"required": true
}
]
}
}
]
}
]
},
"success": true
}
Error Example
{
"code": 400,
"status": "error",
"requestId": "d310b70bc329403f87f77f9203d50f89.128.16360831552223589",
"error": {
"code": 20001,
"desc": "application not found."
},
"success": false
}
