1、根据自定义场次ID查询频道暂存文件ID
2、接口支持https协议
http://api.polyv.net/live/v3/channel/session/list-file-id-by-external
http://api.polyv.net/live/v3/channel/session/list-file-id-by-external?appId=frlr1zazn3&sign=9847BBA541A0BF0CBF5380208CE259AD&externalSessionId=test&channelId=2272655×tamp=1655780318088
private static final Logger log = LoggerFactory.getLogger(ChannelOperateTest.class);
/**
* 根据自定义场次ID查询频道暂存文件ID
* @throws IOException
* @throws NoSuchAlgorithmException
*/
@Test
public void getFileIdByExternalTest() throws IOException, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String appId = super.appId;
String appSecret = super.appSecret;
String timestamp = String.valueOf(System.currentTimeMillis());
//业务参数
String url = "http://api.polyv.net/live/v3/channel/session/list-file-id-by-external";
String channelId = "2272655";
String externalSessionId = "test";
//http 调用逻辑
Map<String, String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("timestamp", timestamp);
requestMap.put("channelId", channelId);
requestMap.put("externalSessionId", externalSessionId);
requestMap.put("sign", LiveSignUtil.getSign(requestMap, appSecret));
String response = HttpUtil.get(url, requestMap);
log.info("测试根据自定义场次ID查询频道暂存文件ID成功:{}", response);
//do somethings
}
{
"code": 200,
"status": "success",
"message": "",
"data": [
{
"originSessionId": "g9uya0mbrq",
"fileIds": [
"7c3ad56bb6d4e8e6058d7754e10ee4e8",
"abfb68494b9dd9b58c5e2b7d0a3ee8ce",
"1fd2500682429db92c1c67dc99af2ef4"
],
"createdTime": 1652775098000
},
{
"originSessionId": "g9uy303rsu",
"fileIds": [
"0f5ccaa11c6edd7fcc1f145a6e21ec82"
],
"createdTime": 1652774575000
},
{
"originSessionId": "g9uy0i6b0y",
"fileIds": [
"30dc5aa5e7f9e87fc03d0614cb308c34"
],
"createdTime": 1652774321000
}
]
}
{
"code": 400,
"status": "error",
"message": "invalid signature.",
"data": ""
}