取得單一影片的問答題目
更新時間:2022-05-23 19:02:59
介面URL
https://api.polyv.net/v2/video/get-video-exam
介面說明
取得單一影片的問答題目
支援格式
JSON
請求方式
POST
請求參數
回傳正確結果JSON範例
{
"code": 200,
"status": "success",
"message": "success",
"data": {
"exams": [
{
"examId": "17922407aac",
"vid": "a2dc4f25172872650e7d5c1b8026b13c_a",
"showTime": 12,
"question": "测试问题",
"choices": "[{\"index\":0,\"content\":\"a\",\"right\":true},{\"index\":1,\"content\":\"b\",\"right\":false},{\"index\":2,\"content\":\"c\",\"right\":false},{\"index\":3,\"content\":\"d\",\"right\":true}]",
"explanationIfRight": "回答正确后的解答详情",
"explanationIfWrong": "回答错误后的解答详情",
"showExplanationIfWrong": false,
"backTime": -1,
"canSkip": false,
"illustration": "",
"type": 0,
"mp3Url": "",
"status": 1,
"createdTime": 1619777319000
}
]
}
}
回傳錯誤結果JSON範例
签名不正确
{
"code":400,
"status":"error",
"message":"the sign is not right",
"data":""
}
时间戳过期
{
"code":400,
"status":"error",
"message":"ptime is too old.",
"data":""
}
欄位說明
choices參數說明
示例
[
{
"index": 0,
"content": "a",
"isRight": true
},
{
"index": 1,
"content": "b",
"isRight": false
},
{
"index": 2,
"content": "c",
"isRight": false
},
{
"index": 3,
"content": "d",
"isRight": true
}
]
java請求範例:
public void testGetVideoExam() throws Exception {
String url = "https://api.polyv.net/v2/video/get-video-exam";
Map<String, String> params = new HashMap<>();
params.put("userid", userid);
params.put("vid", "a2dc4f25172872650e7d5c1b8026b13c_a");
params.put("ptime", String.valueOf(System.currentTimeMillis()));
params.put("sign", getSign(params, secretkey));
String response = HttpClientUtil.getInstance().sendHttpGet(url + "?" + PolyvTool.mapJoinNotEncode(params));
System.out.println(response);
}