1、通过指定时间范围查询签到发起记录
2、接口支持https协议
http://api.polyv.net/live/v3/channel/chat/get-checkin-list
http://api.polyv.net/live/v3/channel/chat/get-checkin-list?startDate=2024-07-04&endDate=2024-07-04&channelId=4872391×tamp=1720088526000&appId=fso8gzbxlr&sign=273F4471BF9FF34DB7AB92EC943AE94F
强烈建议您使用直播Java SDK完成API的功能对接,直播Java SDK 对API调用逻辑、异常处理、数据签名、HTTP请求线程池进行了统一封装和优化。
private static final Logger log = LoggerFactory.getLogger(InteractionCheckinTest.class);
/**
* 查询频道发起的签到记录
* @throws IOException
*/
@Test
public void testGetCheckinBySessionId() 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-checkin-list";
String channelId = "4872391";
String sessionId = "fso8gzbxlr";
//http 调用逻辑
Map<String,String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("timestamp",timestamp);
requestMap.put("channelId",channelId);
requestMap.put("startDate","2024-07-04");
requestMap.put("endDate","2024-07-04");
requestMap.put("sign",LiveSignUtil.getSign(requestMap, appSecret));
String response = HttpUtil.get(url, requestMap);
log.info("测试查询频道发起的签到记录接口返回值:{}",response);
}
{
"code": 200,
"status": "success",
"message": "",
"data": [
{
"limitTime": 30,
"number": 1,
"createtime": "2024-07-04 10:36:59",
"checkinid": "49d80000-39ae-11ef-9cfa-81a09e",
"indate": "2024-07-04",
"sessionId": null,
"mainCheckinId": null,
"roomid": "4872391",
"checknumber": 1
},
{
"limitTime": 30,
"number": 1,
"createtime": "2024-07-04 10:37:34",
"checkinid": "5e84d0f0-39ae-11ef-9cfa-81a09e",
"indate": "2024-07-04",
"sessionId": null,
"mainCheckinId": null,
"roomid": "4872391",
"checknumber": 0
}
]
}
{
"code": 400,
"status": "error",
"message": "invalid signature.",
"data": ""
}