1、通过签到id查询签到记录(包括已签到与未签到记录)
2、接口支持https协议
http://api.polyv.net/live/v3/channel/chat/get-checkins
http://api.polyv.net/live/v3/channel/chat/get-checkins?checkinId=db14ef80-81b8-11eb-b114-e7477b&appId=frlr1zazn3&sign=F0163ADFB54D9BB31BC8DD411252B1FD&channelId=2191569×tamp=1621845214778
强烈建议您使用直播Java SDK完成API的功能对接,直播Java SDK 对API调用逻辑、异常处理、数据签名、HTTP请求线程池进行了统一封装和优化。
private static final Logger log = LoggerFactory.getLogger(InteractionCheckinTest.class);
/**
* 根据发起签到记录查询签到结果
* @throws IOException
*/
@Test
public void testGetCheckinByCheckinId() 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/chat/get-checkins";
String channelId = "2191569";
String checkinId = "db14ef80-81b8-11eb-b114-e7477b";
//http 调用逻辑
Map<String,String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("timestamp",timestamp);
requestMap.put("channelId",channelId);
requestMap.put("checkinId",checkinId);
requestMap.put("sign",LiveSignUtil.getSign(requestMap, appSecret));
String response = HttpUtil.get(url, requestMap);
log.info("测试根据发起签到记录查询签到结果接口返回值:{}",response);
}
{
"code": 200,
"status": "success",
"message": "",
"data": [
{
"accountId": "1b448be323",
"param5": "",
"checkinid": "db14ef80-81b8-11eb-b114-e7477b",
"nickname": "卉",
"checked": "Y",
"indate": "2021-03-10",
"id": 48010860,
"sessionId": "",
"time": 1615391652916,
"param4": "oi_ubswUnFt8QQFAAEJbKmd8W9BE",
"userid": "ovtl9t_RxnrTdqkXqkT5Q5lnxp2A",
"roomid": "2191569"
}
]
}
{
"code": 400,
"status": "error",
"message": "invalid signature.",
"data": ""
}