https://api.polyv.net/live/v3/channel/consultation/detail-list
1、分页获取问答的详细列表
2、支持分页
3、接口支持https
{
"code":200,
"status":"success",
"message":"",
"data":{
"pageSize":5,
"pageNumber":1,
"totalItems":23,
"contents":[
{
"askTime":"2021-03-15 14:36",
"nick":"啊啊啊啊",
"viewerId":"1615773668801",
"sessionId":"fwqzqpj6sf",
"content":"开导开导看",
"status":"未处理",
"reply":null
},
{
"askTime":"2021-03-15 14:36",
"nick":"啊啊啊啊",
"viewerId":"1615773668801",
"sessionId":"fwqzqpj6sf",
"content":"大大方方",
"status":"未处理",
"reply":null
},
{
"askTime":"2021-03-15 14:36",
"nick":"啊啊啊啊",
"viewerId":"1615773668801",
"sessionId":"fwqzqpj6sf",
"content":"少时诵诗书",
"status":"未处理",
"reply":null
},
{
"askTime":"2021-03-15 14:36",
"nick":"啊啊啊啊",
"viewerId":"1615773668801",
"sessionId":"fwqzqpj6sf",
"content":"1111111",
"status":"未处理",
"reply":null
},
{
"askTime":"2021-03-15 14:36",
"nick":"啊啊啊啊",
"viewerId":"1615773668801",
"sessionId":"fwqzqpj6sf",
"content":"2222222",
"status":"未处理",
"reply":null
}
],
"startRow":1,
"firstPage":true,
"lastPage":false,
"prePageNumber":1,
"limit":5,
"totalPages":5,
"nextPageNumber":2,
"endRow":5,
"offset":0
}
}
{
"code": 400,
"status": "error",
"message": "appId is required.",
"data": ""
}
{
"code": 400,
"status": "error",
"message": "application not found.",
"data": ""
}
{
"code": 400,
"status": "error",
"message": "invalid timestamp.",
"data": ""
}
{
"code": 403,
"status": "error",
"message": "invalid signature.",
"data": ""
}
{
"code": 403,
"status": "error",
"message": "illegal channel id: 1779742",
"data": ""
}
{
"code": 400,
"status": "error",
"message": "param is not digit: size",
"data": ""
}
public static void main(String[] args) {
String url = "https://api.polyv.net/live/v3/channel/consultation/detail-list";
// 用户对应的appId和加密串
String appId = "xxxxxxxxx";
String appSecret = "xxxxxxxxxxxxxxxxxxxxxxxxxx";
Map<String, String> params = new HashMap<>();
params.put("channelId", "0000000");
params.put("page", "1");
params.put("size", "10");
PolyvTool.setLiveSign(params, appId, appSecret);
// 调用Polyv的httpClient工具类发送请求
String content = HttpClientUtil.getInstance()
.sendHttpGet(url + "?" + PolyvTool.mapJoinNotEncode(params));
System.out.println(content);
}