Polyv Help Center

Help Center

Update Lottery Activity

Updated: 2025-05-07 09:00:51

API Description

1、更新抽奖活动
2、接口支持https协议

API URL

http://api.polyv.net/live/v4/channel/lottery-activity/update

Request Method

POST

API Constraints

  1. The API supports both HTTP and HTTPS. HTTPS is recommended for security. API calls have frequency limits. See details
  2. Incorrect parameters will result in a 400 error response.

Request Parameter Description

Parameter Required Type Description
appId true String Account appId [See Get Secret Key]
timestamp true Long Current 13-digit millisecond timestamp, valid for 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 stored or used directly on the client side. All APIs must be called through the customer's own server to relay requests to the POLYV server to obtain response data. [See Signature Generation Rules]
channelId true Integer Channel ID

Request Body Parameter Description

Parameter 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: quiz lottery
amount true Integer Number of winners
hiddenWinnerAmount false String Whether to hide the number of winners, values: Y/N, default N
lotteryRange false String User type for lottery participation: all: all users, customGroup: custom group
customGroupIds false Array Custom group IDs, valid when lottery user type is custom
customGroupLotteryType false String Group draw method, average: equal draw, random: random draw
customGroupLotteryAmount false Integer Number of draws per group
hiddenAttendeeNumber false String Whether to hide the number of participants, values: Y/N, default N
repeatWinEnabled false String Allow repeated winning, values: Y/N, default N
receiveEnabled false String Whether to fill in shipping information, values: Y/N, default N
receiveInfo false Array List of shipping field information, filled in for unconditional lottery [See ReceiveInfo]
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 with external invitation method
externalInviteNumLink false String Link to get invitation count, required for invitation lottery with external invitation method
inviteNum false Integer Number of invitations, 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: QR code scan, required for non-unconditional and non-quiz lottery
formInfo false Array Form field information for prize claim method, when claim method is form [See ReceiveInfo]
prizeUrl false String Prize link for claim method, required when claim method is external link
qrCode false String QR code link for claim method, required when claim method is QR code
qrCodeTips false String QR code prompt text for claim method, filled when claim method is QR code
realPrice false BigDecimal Discounted price
price false BigDecimal Original prize price
prizeInfo false Array Prize information, required for quiz lottery [See PrizeInfo]
questionGroupId false Long Quiz group template ID, required for quiz lottery
perAnswerDuration false Integer Answer duration per question, required for quiz lottery
lotteryOnlineEnabled false String Winners must be online when drawing, values: Y/N, default Y (effective for unconditional group lottery)
answerType false String Quiz lottery answer method, pushQuestion: answer while pushing, autonomyAnswer: self-paced answer, default: pushQuestion

ReceiveInfo Parameter Description

Parameter Required Type Description
type false String Type, userName: name, userPhone: 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 Required Type Description
prizeItem true String Prize item name
correctAnswerCount true Integer Number of correct answers
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: QR code scan
formInfo false Array Form field information for prize claim method, when claim method is form [See ReceiveInfo]
prizeUrl false String Prize link for claim method, required when claim method is external link
qrCode false String QR code link for claim method, required when claim method is QR code
qrCodeTips false String QR code prompt text for claim method, filled when claim method is QR code
amount true Integer Number of winners
hiddenWinnerAmount false String Whether to hide the number of winners, values: Y/N, default N

Example

http://api.polyv.net/live//v4/channel/lottery-activity/update?appId=frlr1zazn3&timestamp=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 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, 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 for troubleshooting and debugging, should not be tied to business logic
error Object Error information when status code is not 200 [See Error Field Description]
data Object Response data

Error Response Description

Parameter Type Description
code Integer Error code, used to determine the specific error reason
desc String Error description, corresponds to error.code

Java Request Example

For quick integration of basic code, please download the relevant dependency source code. Click here to download the source code. After downloading, add it to your own source code project. 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 function integration. The Live Java SDK provides unified encapsulation and optimization for API call logic, exception handling, data signing, and HTTP request thread pools.


Response Example

For global system error descriptions, see Global Error Description

Success Example

{
    "code": 200,
    "status": "success",
    "requestId": "723ed01861804e9aa3dc1cf1aced83d5.72.17097790901718347",
    "data": null,
    "success": true
}

Error Example

{
    "code": 400,
    "status": "error",
    "requestId": "d310b70bc329403f87f77f9203d50f89.128.16360831552223589",
    "error": {
        "code": 20001,
        "desc": "application not found."
    },
    "success": false
}
联系客服,在线咨询