1、通过频道号,查询答题卡答题结果列表
2、接口支持https协议
3、参数场次号、查询时间同时存在多个时,按参数优先级从小到大,选其中一个参数作为查询条件
http://api.polyv.net/live/v3/channel/question/answer-records
http://api.polyv.net/live/v3/channel/question/answer-records?endDate=&appId=frlr1zazn3&sign=D0163266BDD894AC11D310082B84F75C&channelId=2191569&startDate=×tamp=1621845243688
强烈建议您使用直播Java SDK完成API的功能对接,直播Java SDK 对API调用逻辑、异常处理、数据签名、HTTP请求线程池进行了统一封装和优化。
private static final Logger log = LoggerFactory.getLogger(InteractionQuestionTest.class);
/**
* 查询频道答题卡结果
* @throws IOException
*/
@Test
public void testGetAnswerList() throws IOException, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String appId = super.appId;
String appSecret = super.appSecret;
String timestamp = String.valueOf(System.currentTimeMillis());
//业务参数
String url = "https://api.polyv.net/live/v3/channel/question/answer-records";
String channelId = "2191569";
String startDate = "";
String endDate = "";
//http 调用逻辑
Map<String,String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("timestamp",timestamp);
requestMap.put("channelId",channelId);
requestMap.put("startDate",startDate);
requestMap.put("endDate",endDate);
requestMap.put("sign",LiveSignUtil.getSign(requestMap, appSecret));
String response = HttpUtil.get(url, requestMap);
log.info("测试查询频道答题卡结果接口返回值:{}",response);
}
{
"code": 200,
"status": "success",
"message": "",
"data": [
{
"questionId": "fwly4r487r",
"answer": "AB",
"questionTitle": "快速问答",
"times": 1,
"sendTime": 1637308945000,
"endTime": 1637308954000,
"total": 2,
"correctCount": 0,
"interactStatus": null,
"options": [
{
"title": "A",
"count": 1,
"percent": "50.00%"
},
{
"title": "B",
"count": 1,
"percent": "50.00%"
}
],
"records": [
{
"viewerId": "ovtl9t_RxnrTdqkXqkT5Q5lnxp2A",
"nickname": "卉",
"answer": "B",
"avatar": "https://thirdwx.qlogo.cn/mmopen/vi_32/3lMXVJoLMLJibnkFuA23lyqj5MOQufhW5ATvHuB8byssutficHKU0u7OMx5OQgg9WNVuHf44AXfbAMMAZejuYFTg/132",
"correct": false,
"submitTime": 1615394824000
},
{
"viewerId": "1615394262720",
"nickname": "周鑫",
"answer": "A",
"avatar": "https://liveimages.videocc.net/defaultImg/avatar/viewer.png",
"correct": false,
"submitTime": 1615394833000
}
],
"timestamp": null,
"rightUser": [ ],
"faultUser": [ ],
"type": "R",
"itemType": 1
},
{
"questionId": "fwlx0ahwe9",
"answer": "AB",
"questionTitle": "快速问答",
"times": 1,
"sendTime": 1637308945000,
"endTime": 1637308954000,
"total": 3,
"correctCount": 0,
"interactStatus": null,
"options": [
{
"title": "A",
"count": 1,
"percent": "33.00%"
},
{
"title": "B",
"count": 2,
"percent": "67.00%"
}
],
"records": [
{
"viewerId": "1615394262720",
"nickname": "上海观众/10812",
"answer": "A",
"avatar": "https://liveimages.videocc.net/defaultImg/avatar/viewer.png",
"correct": false,
"submitTime": 1615394304000
},
{
"viewerId": "ovtl9tyK6dqob_cgewjRnQ1tSB4U",
"nickname": "周鑫",
"answer": "B",
"avatar": "https://thirdwx.qlogo.cn/mmopen/vi_32/DYAIOgq83epTUL7QR3hCkMDQOrBk7vcxZibiahB9SnPk6oUiadmZyOCxIOQiciajE4U2Xf78kpLnicCbzAnr1aMUWotA/132",
"correct": false,
"submitTime": 1615392378000
},
{
"viewerId": "ovtl9t_RxnrTdqkXqkT5Q5lnxp2A",
"nickname": "卉",
"answer": "B",
"avatar": "https://thirdwx.qlogo.cn/mmopen/vi_32/3lMXVJoLMLJibnkFuA23lyqj5MOQufhW5ATvHuB8byssutficHKU0u7OMx5OQgg9WNVuHf44AXfbAMMAZejuYFTg/132",
"correct": false,
"submitTime": 1615392461000
}
],
"timestamp": null,
"rightUser": [ ],
"faultUser": [ ],
"type": "R",
"itemType": 1
}
]
}
{
"code": 400,
"status": "error",
"message": "invalid signature.",
"data": ""
}