Polyv Help Center

Help Center

Query Channel Lottery Records

Updated: 2025-09-04 09:23:43

API Description

1、通过抽奖ID获取频道的单场抽奖的中奖用户列表
2、接口支持https协议

API URL

http://api.polyv.net/live/v3/channel/lottery/get-winner-detail

Online API Call

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

Request Parameters

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 never be saved or used directly on the client side. All APIs must be called through your 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, obtained from Query Channel Lottery Records
page false Integer Page number to query, defaults to 1
limit false Integer Number of records per page, defaults to 10

Example

http://api.polyv.net/live/v3/channel/lottery/get-winner-detail?appId=frlr1zazn3&sign=A53A9A7DB3B88442E3F433F8219C1029&channelId=2191532&timestamp=1621844963404&lotteryId=fwqs12puef

Response Parameters

Parameter Type Description
code Integer Response status code, 200 for success, non-200 for failure See Global Error Description
status String Response status text
message String Response description, assists in describing error reasons when code is 400 or 500
data Object Paginated results of intermediate records, returns empty on error See data field description

data Field Description

Parameter Type Description
pageSize Integer Current page size
pageNumber Integer Current page number
totalItems Integer Total number of records
contents Array List of intermediate records, lottery record list See contents field description
firstPage Boolean Whether it is the first page, values: true/false
lastPage Boolean Whether it is the last page, values: true/false
nextPageNumber Integer Next page number
prePageNumber Integer Previous page number
totalPages Integer Total number of pages
startRow Integer Position of the first record on the current page in the total records
endRow Integer Position of the last record on the current page in the total records
limit Integer Number of records on the current page
offset Integer Pagination data cursor

contents Field Description

Parameter Type Description
recordId String Winning record ID
channelId String Channel ID
sessionId String Live session ID at the time of the lottery
lotteryId String Lottery ID
viewerId String Winning user ID
viewerName String Winning user nickname
winnerCode String Winning code
prize String Prize name
name String Winner's name
telephone String Phone number
createdTime Long Winning time
lastModified Long Update time
address String Winner's address
param4 String Custom parameter
param5 String Custom parameter
userId String Account ID
thumbnail String Prize image
ext String JSON format string representing additional extension information for the winning record. Corresponding model class: WinnerRecordModelExt Field Description

WinnerRecordModelExt Field Description

Description: Extension information for winning records

Field Type and Range Description
receiveInfo Array Prize claim information to be filled in by the winner. Corresponding model class: ReceiveInfoFieldModel Field Description

ReceiveInfoFieldModel Field Description

Description: Prize claim information filled in for the winning record

Field Type Description
field String Field name filled in
value String Field value filled in

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 from the test cases are included in the downloaded 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 pooling.

private static final Logger log = LoggerFactory.getLogger(LiveInteractionTest.class);

/**
 * 依查询频道场次中奖记录
 * @throws IOException
 */
@Test
public void testGetWinnerDetail() throws IOException, NoSuchAlgorithmException {
    //公共参数,填写自己的实际参数
    String appId=super.appId;
    String appSecret=super.appSecret;
    String userId = super.userId;
    String timestamp=String.valueOf(System.currentTimeMillis());
    //业务参数
    String url = "http://api.polyv.net/live/v3/channel/lottery/get-winner-detail";
    String channelId = "1965681";
    String lotteryId = "fv3hogjmh3";

    //http 调用逻辑
    Map<String,String> requestMap = new HashMap<>();
    requestMap.put("appId", appId);
    requestMap.put("timestamp",timestamp);

    requestMap.put("channelId",channelId);
    requestMap.put("lotteryId",lotteryId);

    requestMap.put("sign",LiveSignUtil.getSign(requestMap, appSecret));
    String response = HttpUtil.get(url,requestMap);
    log.info("测试查询频道场次中奖记录接口返回值:{}",response);
    //do somethings

}

Response Example

For global system error descriptions, see Global Error Description

Success Example

{
    "code": 200,
    "status": "success",
    "message": "",
    "data": {
        "pageSize": 10,
        "pageNumber": 1,
        "totalItems": 1,
        "contents": [{
            "recordId": "b20c0e091d",
            "channelId": 1965681,
            "lotteryId": "fv3hogjmh3",
            "sessionId": "fv3hmq3qml",
            "viewerId": "ovtl9twa7JHyHBBA8QUNVjjM4WIs",
            "viewerName": "王勋",
            "winnerCode": "wMpUjVSi",
            "prize": "10元现金红包",
            "name": null,
            "telephone": null,
            "createdTime": 1611127338000,
            "lastModified": 1611127338000,
            "address": null,
            "param4": "oi_ubsz8bujEA8TXdMzPpAxbC0ZI",
            "param5": null,
            "userId": "1b448be323",
            "ext": null
        }],
        "startRow": 1,
        "firstPage": true,
        "lastPage": true,
        "prePageNumber": 1,
        "limit": 1,
        "totalPages": 1,
        "nextPageNumber": 1,
        "endRow": 1,
        "offset": 0
    }
}

Error Example

{
    "code": 400,
    "status": "error",
    "message": "invalid signature.",
    "data": ""
}
联系客服,在线咨询