Query Lottery Activity
Updated: 2026-10-12 10:24:30
API Description
1、查询抽奖活动
2、接口支持https协议
API URL
http://api.polyv.net/live/v4/channel/lottery-activity/get
Request Method
GET
API Constraints
- The API supports both HTTP and HTTPS. It is recommended to use HTTPS to ensure API security. There is a frequency limit for API calls. For details, please see
- If the parameters are incorrect, a 400 exception will be returned.
Request Parameter Description
| Parameter Name | Required | Type | Description |
|---|---|---|---|
| appId | true | String | Account appId [See Get Key for details] |
| timestamp | true | Long | Current 13-digit millisecond timestamp, valid within 3 minutes |
| sign | true | String | Signature, a 32-bit uppercase MD5 value, The appSecret key used to generate the signature is key information for communication data security. It is strictly prohibited to save it on the client for direct use. All APIs must be called through the customer's own server as an intermediary to obtain response data from the POLYV server. [See Signature Generation Rules for details] |
| channelId | true | Integer | Channel ID |
| id | true | Long | Lottery activity ID |
Example
http://api.polyv.net/live//v4/channel/lottery-activity/get?appId=frlr1zazn3×tamp=1665629374000&sign=6CFA3141718E1AF0155889EEA2988206&channelId=2974342&id=1
Response Description
| Parameter Name | Type | Description |
|---|---|---|
| code | Integer | Status code, same as the HTTP status code, used to determine the basic response status |
| status | String | Response result, determined by the business. Returns success on success and error on failure |
| success | Boolean | Whether the response is successful |
| requestId | String | Request ID, a unique UUID generated for each request. It can only be used for troubleshooting and debugging, and should not be tied to business logic |
| error | Object | Error information when the status code is not 200 [See Error Field Description for details] |
| data | Object | Response details [See data Field Description for details] |
Error Response Description
| Parameter Name | Type | Description |
|---|---|---|
| code | Integer | Error code, used to determine the specific cause of the error |
| desc | String | Error description, corresponding to error.code |
data Response Description
| Parameter Name | Type | Description |
|---|---|---|
| id | Long | Lottery activity ID |
| activityName | String | Lottery activity name |
| lotteryCondition | String | Lottery type |
| status | String | Lottery activity status |
| amount | Integer | Number of winners |
| hiddenWinnerAmount | String | Whether to hide the number of winners |
| lotteryRange | String | Type of users participating in the lottery: all: all, notWinning: users who have not won, customGroup: custom group, userLabel: user label |
| customGroup | Array | Custom group information [See CustomGroup for details] |
| customGroupLotteryType | String | Group draw method, average: equal draw, random: random draw, specified: specified number per group |
| customGroupLotteryAmount | Integer | Number to draw per group, returned when the group draw method is average |
| customGroupLotterySpecified | Array | Number to draw per group, returned when the group draw method is specified [See CustomGroupLotterySpecified Response Description for details] |
| userLabels | Array | User label IDs |
| hiddenAttendeeNumber | String | Whether to hide the number of participants |
| repeatWinEnabled | String | Allow repeated winning |
| receiveEnabled | String | Whether to fill in shipping information |
| receiveInfo | Array | List of shipping field information, filled in for unconditional lottery [See ReceiveInfo for details] |
| prizeName | String | Prize name |
| thumbnail | String | Prize image |
| activityDuration | String | Activity duration (minutes) |
| inviteType | String | Invitation method |
| externalListLink | String | External list link |
| externalInviteNumLink | String | Link to get the number of invitees |
| inviteNum | Integer | Number of invitees |
| duration | Integer | Viewing duration |
| comment | String | Comment content |
| acceptType | String | Prize claim method, form: form, link: external link, qrCode: scan QR code, |
| formInfo | Array | Form field information for the prize claim method [See ReceiveInfo for details] |
| prizeUrl | String | Prize link for the prize claim method |
| qrCode | String | QR code link for the prize claim method |
| qrCodeTips | String | QR code prompt text for the prize claim method |
| realPrice | BigDecimal | Discounted price |
| price | BigDecimal | Original prize price |
| prizeInfo | Array | Prize information [See PrizeInfo for details] |
| questionGroupId | Long | Question group template ID |
| perAnswerDuration | Integer | Answer duration for each question |
| lotteryOnlineEnabled | String | Viewers must be online when the lottery is drawn. Value: Y/N, default Y (effective when set for unconditional group lottery) |
CustomGroup Response Description
| Parameter Name | Type | Description |
|---|---|---|
| id | Long | Group ID |
| title | String | Group title |
| type | String | Group type |
| count | String | Number of people in the group |
CustomGroupLotterySpecified Response Description
| Parameter Name | Type | Description |
|---|---|---|
| customGroupId | Long | Custom group ID |
| amount | Integer | Number to draw for this group |
ReceiveInfo Response Description
| Parameter Name | Type | Description |
|---|---|---|
| type | String | Type, userName: name, userPhone: mobile phone number, custom: custom |
| field | String | Field name |
| tips | String | Prompt text |
| required | Boolean | Whether required, true/false |
PrizeInfo Response Description
| Parameter Name | Type | Description |
|---|---|---|
| prizeItem | String | Prize item name |
| correctAnswerCount | Integer | Number of correctly answered questions |
| prizeName | String | Prize name |
| thumbnail | String | Prize image |
| realPrice | BigDecimal | Discounted price |
| price | BigDecimal | Original prize price |
| acceptType | String | Prize claim method, form: form, link: external link, qrCode: scan QR code |
| formInfo | Array | Form field information for the prize claim method [See ReceiveInfo for details] |
| prizeUrl | String | Prize link for the prize claim method |
| qrCode | String | QR code link for the prize claim method |
| qrCodeTips | String | QR code prompt text for the prize claim method |
| amount | Integer | Number of winners |
| hiddenWinnerAmount | String | Whether to hide the number of winners |
Java Request Example
For quick integration of the basic code, please download the relevant dependency source code, click to download the source code, and add it to your own source project after downloading. The HttpUtil.java and LiveSignUtil.java in the test cases are both included in the downloaded file.
It is strongly recommended that you use the Live Java SDK to complete the API integration. The Live Java SDK uniformly encapsulates and optimizes API call logic, exception handling, data signing, and the HTTP request thread pool.
Response Example
For system global error descriptions, see Global Error Description
Success example
{
"code": 200,
"status": "success",
"requestId": "723ed01861804e9aa3dc1cf1aced83d5.72.17097790901718347",
"data": {
"id": 20521,
"activityName": "无条件抽奖",
"lotteryCondition": "none",
"amount": 1,
"receiveEnabled": "Y",
"receiveInfo": [
{
"type": "userName",
"field": "姓名",
"tips": "请输入您的名称",
"required": true
},
{
"type": "userPhone",
"field": "手机",
"tips": "请输入您的手机号码",
"required": true
}
],
"prizeName": "键盘",
"activityDuration": null,
"inviteType": "poster",
"inviteNum": null,
"duration": null,
"comment": null,
"externalListLink": null,
"externalInviteNumLink": null,
"acceptType": null,
"formInfo": null,
"prizeUrl": null,
"qrCode": null,
"qrCodeTips": null,
"thumbnail": null,
"realPrice": null,
"price": null,
"status": null,
"prizeInfo": null,
"questionGroupId": null,
"perAnswerDuration": null,
"lotteryRange": "all",
"repeatWinEnabled": "N",
"customGroup": [],
"hiddenWinnerAmount": "N",
"hiddenAttendeeNumber": "N",
"customGroupLotteryType": "random",
"customGroupLotteryAmount": null
},
"success": true
}
Exception example
{
"code": 400,
"status": "error",
"requestId": "d310b70bc329403f87f77f9203d50f89.128.16360831552223589",
"error": {
"code": 20001,
"desc": "application not found."
},
"success": false
}
