Update 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/update
Request Method
POST
API Constraints
- The API supports both HTTP and HTTPS. HTTPS is recommended to ensure API security. There are frequency limits on API calls. For details, please see
- If the parameters are incorrect, a 400 exception will be returned.
- When the lottery user type is custom group and the group lottery method is specified, customGroupLotterySpecified cannot be empty and must exactly match the groups in customGroupIds (the lottery quantity must be specified for each group, no more and no less), otherwise error code 40218 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-character 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 the POLYV server to obtain response data. [See Signature Generation Rules for details] |
| channelId | true | Integer | Channel ID |
Request Body Parameter Description
| Parameter Name | Required | Type | Description |
|---|---|---|---|
| id | true | Long | Lottery activity ID |
| activityName | true | String | Lottery activity name |
| lotteryCondition | true | String | Lottery activity type, none: unconditional, invite: invite friends, duration: watch duration, comment: comment lottery, question: question lottery, questionnaire: questionnaire lottery |
| amount | true | Integer | Number of winners |
| hiddenWinnerAmount | false | String | Whether to hide the number of winners, value: Y/N, default N |
| lotteryRange | false | String | Type of users participating in the lottery: all: all, notWinning: users who have not won, customGroup: custom group, userLabel: user label |
| customGroupIds | false | Array | Custom group IDs, valid when the lottery user type is custom group, maximum 10 |
| customGroupLotteryType | false | String | Group lottery method, average: equal lottery, random: random lottery, specified: specified number per group |
| customGroupLotteryAmount | false | Integer | Number to draw per group, valid when the group lottery method is average |
| customGroupLotterySpecified | false | Array | Number to draw per group, required when the group lottery method is specified [See CustomGroupLotterySpecified Parameter Description for details] |
| userLabels | false | Array | User label IDs, valid when the lottery user type is userLabel, maximum 10 |
| hiddenAttendeeNumber | false | String | Whether to hide the number of participants, value: Y/N, default N |
| repeatWinEnabled | false | String | Allow repeated winning, value: Y/N, default N |
| receiveEnabled | false | String | Whether to fill in shipping information, value: Y/N, default N |
| receiveInfo | false | Array | List of shipping field information, filled in for unconditional lottery [See ReceiveInfo for details] |
| prizeName | true | String | Prize name |
| thumbnail | false | String | Prize image |
| activityDuration | false | String | Activity duration, required for non-unconditional lottery |
| activityDurationType | false | String | Activity duration unit (second, minute, hour), default minute |
| inviteType | false | String | Invitation method, poster: invitation poster, external: external invitation, required for invitation lottery |
| externalListLink | false | String | External list link, required for invitation lottery when the invitation method is external invitation |
| externalInviteNumLink | false | String | Link to get the number of invitees, required for invitation lottery when the invitation method is external invitation |
| inviteNum | false | Integer | Number of invitees, required for invitation lottery |
| duration | false | Integer | Watch duration, required for watch duration lottery |
| comment | false | String | Comment content, required for comment lottery |
| acceptType | false | String | Prize claim method, form: form, link: external link, qrCode: scan QR code, required for non-unconditional and question lottery |
| formInfo | false | Array | Form field information for the prize claim method, filled in when the prize claim method is form [See ReceiveInfo for details] |
| prizeUrl | false | String | Prize link for the prize claim method, required when the prize claim method is external link |
| qrCode | false | String | QR code link for the prize claim method, required when the prize claim method is QR code |
| qrCodeTips | false | String | QR code prompt text for the prize claim method, filled in when the prize claim method is QR code |
| realPrice | false | BigDecimal | Discounted price |
| price | false | BigDecimal | Original prize price |
| prizeInfo | false | Array | Prize information, required for question or questionnaire lottery [See PrizeInfo for details] |
| questionGroupId | false | Long | Question group template ID, required for question or questionnaire lottery |
| perAnswerDuration | false | Integer | Answer duration for each question, required for question lottery |
| lotteryOnlineEnabled | false | String | Viewers must be online when the lottery is drawn, value: Y/N, default Y (takes effect when set for unconditional group lottery) |
| answerType | false | String | Question lottery, answering method, pushQuestion: answer while pushing, autonomyAnswer: independent answering, default: pushQuestion |
CustomGroupLotterySpecified Parameter Description
| Parameter Name | Required | Type | Description |
|---|---|---|---|
| customGroupId | true | Long | Custom group ID, must match the groups in customGroupIds |
| amount | true | Integer | Number to draw for this group, 1-10000 |
ReceiveInfo Parameter Description
| Parameter Name | Required | Type | Description |
|---|---|---|---|
| type | false | String | Type, userName: name, userPhone: mobile phone number, custom: custom |
| field | true | String | Field name |
| tips | true | String | Prompt text |
| required | false | Boolean | Whether required, true/false |
PrizeInfo Parameter Description
| Parameter Name | Required | Type | Description |
|---|---|---|---|
| prizeItem | true | String | Prize item name |
| correctAnswerCount | true | Integer | Number of correctly answered questions |
| prizeName | true | String | Prize name |
| thumbnail | false | String | Prize image |
| realPrice | false | BigDecimal | Discounted price |
| price | false | BigDecimal | Original prize price |
| acceptType | true | String | Prize claim method, form: form, link: external link, qrCode: scan QR code |
| formInfo | false | Array | Form field information for the prize claim method, filled in when the prize claim method is form [See ReceiveInfo for details] |
| prizeUrl | false | String | Prize link for the prize claim method, required when the prize claim method is external link |
| qrCode | false | String | QR code link for the prize claim method, required when the prize claim method is QR code |
| qrCodeTips | false | String | QR code prompt text for the prize claim method, filled in when the prize claim method is QR code |
| amount | true | Integer | Number of winners |
| hiddenWinnerAmount | false | String | Whether to hide the number of winners, value: Y/N, default N |
Example
http://api.polyv.net/live//v4/channel/lottery-activity/update?appId=frlr1zazn3×tamp=1665629374000&sign=6CFA3141718E1AF0155889EEA2988206&channelId=2974342
Request body JSON parameters:
{
"id": 1,
"activityName": "无条件抽奖",
"lotteryCondition": "none",
"amount": 1,
"receiveEnabled": "Y",
"prizeName": "键盘",
"receiveInfo": [{
"field": "姓名",
"tips": "请输入您的名称",
"type": "userName",
"required": true
}, {
"field": "手机",
"tips": "请输入您的手机号码",
"type": "userPhone",
"required": true
}],
"lotteryRange": "all"
}
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, only 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 information |
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 |
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 functionality integration. The Live Java SDK uniformly encapsulates and optimizes the API call logic, exception handling, data signing, and 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": null,
"success": true
}
Exception example
{
"code": 400,
"status": "error",
"requestId": "d310b70bc329403f87f77f9203d50f89.128.16360831552223589",
"error": {
"code": 20001,
"desc": "application not found."
},
"success": false
}
