Polyv Help Center

Help Center

Query Viewer Winning Records

Updated: 2022-10-13 10:52:53

API Description

1、查询观众中奖记录
2、接口支持https协议

API URL

http://api.polyv.net/live/v4/channel/lottery/query-winner-viewer

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. If the viewer's winning record does not exist, a 400 error will be returned.

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 through the customer's own server to relay requests to the POLYV server for response data. See signature generation rules
channelId true String Channel ID
lotteryId true String Lottery ID
viewerId true String Viewer ID

Example

http://api.polyv.net/live//v4/channel/lottery/query-winner-viewer?appId=frlr1zazn3&timestamp=1665629374000&sign=6CFA3141718E1AF0155889EEA2988206&channelId=2974342&lotteryId=g9pf1atsa3&viewerId=ovtl9twa7JHyHBBA8QUNVjjM4WIs

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 the 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 used for troubleshooting and debugging, not for business logic
error Object Error information when status code is not 200 See Error field description
data Object List of winning records See data field description

Error Parameter Description

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

data Parameter Description

Parameter Type Description
recordId String Winning record ID
channelId Integer Channel ID
lotteryId String Lottery ID
sessionId String Live session ID at the time of the lottery
viewerId String Viewer ID
viewerName String Viewer nickname
winnerCode String Winning code
prize String Prize name
name String Winner's name
telephone String Winner's contact number
createdTime Long Creation time, can represent the winning time, 13-digit millisecond timestamp
lastModified Long Last update time, 13-digit millisecond timestamp
address String Winner's address
ext Object Additional extended information for the winning record See ext field description
param4 String User-defined parameter, may be passed during direct authorization or independent authorization
param5 String User-defined parameter, may be passed during direct authorization or independent authorization
userId String Account ID
avatar String Avatar URL
totalUsers Integer Total number of participants in the lottery

ext Parameter Description

Parameter Type Description
receiveInfo Array Additional extended information for the winning record See receiveInfo field description

receiveInfo Parameter Description

Parameter Type Description
field String Field name
value String Field value

Java Request Example

For quick integration, download the relevant dependency source code. Click here to download the source code. After downloading, add it to your own source project. The test cases include HttpUtil.java and LiveSignUtil.java, both contained 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 system error descriptions, see Global Error Description

Success Example

{
    "code": 200,
    "status": "success",
    "requestId": "fc0894ce-08df-4376-92e2-fd0531cbe8ba",
    "data": {
        "recordId": "22ad8e0518",
        "channelId": 2974342,
        "lotteryId": "g9pf1atsa3",
        "sessionId": "g9pf13d8bo",
        "viewerId": "ovtl9twa7JHyHBBA8QUNVjjM4WIs",
        "viewerName": "神经蛙",
        "winnerCode": "OOf6jo74",
        "prize": "百万   大礼包",
        "name": null,
        "telephone": null,
        "createdTime": 1652341190000,
        "lastModified": 1652341226000,
        "address": null,
        "ext": {
            "receiveInfo": [
                {
                    "field": "姓名:",
                    "value": "我"
                },
                {
                    "field": "手机:",
                    "value": "18888888888"
                }
            ]
        },
        "param4": "oi_ubsz8bujEA8TXdMzPpAxbC0ZI",
        "param5": null,
        "userId": "1b448be323",
        "avatar": "https://thirdwx.qlogo.cn/mmopen/vi_32/Q3auHgzwzM48yCrkV6bNEauNqC60hZJ38eZkVt5YBiasWbq4MA9I5kgs6Oodicc5vpXSICosTibybCT5mgibhIwCNA/132",
        "totalUsers": 2
    },
    "success": true
}

Error Example

{
    "code": 400,
    "status": "error",
    "requestId": "d310b70bc329403f87f77f9203d50f89.128.16360831552223589",
    "error": {
        "code": 20001,
        "desc": "application not found."
    },
    "success": false
}

Winning record not found

{
    "code": 400,
    "status": "error",
    "requestId": "d29944cb-66ac-4694-a844-5ec619e17abd",
    "error": {
        "code": 40031,
        "desc": "中奖记录不存在"
    },
    "data": null,
    "success": false
}
联系客服,在线咨询