1、导出频道的单抽奖的中奖用户列表的中奖文件
2、导出表格格式可具体参考直播后台的导出中奖记录功能
3、接口支持https协议
http://api.polyv.net/live/v3/channel/lottery/download-winner-detail
http://api.polyv.net/live/v3/channel/lottery/download-winner-detail?appId=frlr1zazn3&sign=2C9656549D3579CE1F06EF722BD390D1&channelId=1965681×tamp=1621844995312&lotteryId=fv3hogjmh3
强烈建议您使用直播Java SDK完成API的功能对接,直播Java SDK 对API调用逻辑、异常处理、数据签名、HTTP请求线程池进行了统一封装和优化。
private static final Logger log = LoggerFactory.getLogger(LiveInteractionTest.class);
/**
* 下载频道场次中奖记录
* @throws IOException
*/
@Test
public void testDownloadWinnerDetail() 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/download-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));
byte[] binary = HttpUtil.getBinary(url, requestMap, null);
String path = getClass().getResource("/file/").getPath() + "DownloadWinnerDetail.xls";
HttpUtil.writeFile(binary, path);
log.info("测试下载频道场次中奖记录接口返回值:{}",path);
//do somethings
}
/C:/IDEA/project/polyv-api-example/target/test-classes/file/DownloadWinnerDetail.xls
{
"code": 400,
"status": "error",
"message": "invalid signature.",
"data": ""
}