1、通过视频id查询单个视频的问答题目
2、接口支持https协议
http://api.polyv.net/v2/video/get-video-exam
http://api.polyv.net/v2/video/get-video-exam
vid=1b448be3231ebf0005ec631a7e4247ee_1&sign=738445A034D8F70D3625E0C761EE26A4E9F3446B&userid=1b448be323&ptime=1620287966337
强烈建议您使用点播Java SDK完成API的功能对接,点播Java SDK 对API调用逻辑、异常处理、数据签名、HTTP请求线程池进行了统一封装和优化。
private static final Logger log = LoggerFactory.getLogger(VodVideoManageManagementTest.class);
/**
* 查询问答题目
*/
@Test
public void testGetQuizResult() throws Exception, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String secretKey = super.secretKey;
String userId = super.userId;
String ptime = String.valueOf(System.currentTimeMillis());
//业务参数
String url = "http://api.polyv.net/v2/video/get-video-exam";
String vid = "1b448be3231ebf0005ec631a7e4247ee_1";
//调用参数
Map<String, String> requestMap = new HashMap<>();
requestMap.put("userid", userId);
requestMap.put("ptime", ptime);
requestMap.put("vid", vid);
requestMap.put("sign", VodSignUtil.getSign(requestMap, secretKey));
String response = HttpUtil.postFormBody(url, requestMap);
log.debug("测试查询问答题目,{}", response);
//do somethings
}
{
"code":200,
"status":"success",
"message":"success",
"data":{
"exams":[
{
"examId":"179407cbb9b",
"vid":"1b448be3231ebf0005ec631a7e4247ee_1",
"showTime":3,
"question":"测试删除问答",
"choices":"[{"index":0,"content":"1","right":false},{"index":1,"content":"2","right":true}]",
"explanationIfRight":"123",
"explanationIfWrong":"321",
"showExplanationIfWrong":true,
"backTime":1,
"canSkip":true,
"illustration":null,
"type":0,
"mp3Url":"",
"status":1,
"createdTime":1620284587000
},
{
"examId":"1794097a449",
"vid":"1b448be3231ebf0005ec631a7e4247ee_1",
"showTime":2,
"question":"测试创建问答题目?",
"choices":"[{"index":0,"content":"a","right":true},{"index":1,"content":"b","right":false},{"index":2,"content":"c","right":false}]",
"explanationIfRight":"答对啦",
"explanationIfWrong":"答错了",
"showExplanationIfWrong":true,
"backTime":1,
"canSkip":false,
"illustration":null,
"type":0,
"mp3Url":"",
"status":1,
"createdTime":1620286350000
}
]
}
}
{
"code": 400,
"status": "error",
"message": "the sign is not right",
"data": ""
}
{
"code": 400,
"status": "error",
"message": "ptime is too old.",
"data": ""
}