Polyv Help Center

Help Center

Query Lottery Activity

Updated: 2025-02-07 17:07:12

API Description

1、查询抽奖活动
2、接口支持https协议

API URL

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

Request Method

GET

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 Parameters

Parameter Required Type Description
appId true String Account appId See details on obtaining keys
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 from your server to the POLYV server to obtain response data. See signature generation rules
channelId true Integer Channel ID
id true Long Lottery activity ID

Example

http://api.polyv.net/live//v4/channel/lottery-activity/get?appId=frlr1zazn3&timestamp=1665629374000&sign=6CFA3141718E1AF0155889EEA2988206&channelId=2974342&id=1

Response Parameters

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 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 Detailed response information See data field description

Error Response Parameters

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

Data Response Description

Parameter 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 User type eligible for lottery: all: all users, customGroup: custom groups
customGroup Array Custom group information See CustomGroup
customGroupLotteryType String Group draw method, average: equal draw, random: random draw
customGroupLotteryAmount Integer Number drawn per group
hiddenAttendeeNumber String Whether to hide the number of participants
repeatWinEnabled String Allow repeated wins
receiveEnabled String Whether to fill in shipping information
receiveInfo Array Shipping field information list, filled in for unconditional lottery See ReceiveInfo
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 invitation count
inviteNum Integer Number of invitations
duration Integer Viewing duration
comment String Comment content
acceptType String Prize claim method, form: form, link: external link, qrCode: QR code
formInfo Array Form field information for prize claim See ReceiveInfo
prizeUrl String Prize link for claim method
qrCode String QR code link for claim method
qrCodeTips String QR code prompt text for claim method
realPrice BigDecimal Discounted price
price BigDecimal Original prize price
prizeInfo Array Prize information See PrizeInfo
questionGroupId Long Q&A group template ID
perAnswerDuration Integer Duration per question
lotteryOnlineEnabled String Whether viewers must be online when drawing, values: Y/N, default Y (effective when setting unconditional group lottery)

CustomGroup Response Description

Parameter Type Description
id Long Group ID
title String Group title
type String Group type
count String Number of people in group

ReceiveInfo 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

PrizeInfo Response Description

Parameter Type Description
prizeItem String Prize item name
correctAnswerCount Integer Number of correct answers
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: QR code
formInfo Array Form field information for prize claim See ReceiveInfo
prizeUrl String Prize link for claim method
qrCode String QR code link for claim method
qrCodeTips String QR code prompt text for claim method
amount Integer Number of winners
hiddenWinnerAmount String Whether to hide the number of winners

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 project. HttpUtil.java and LiveSignUtil.java in the test cases are included in the download file.

It is strongly recommended to use the Live Java SDK for API 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 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
}

Error Example

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