Get Quiz Records
Updated: 2026-01-20 18:13:40
API Description
1、通过视频id和时间区间查询该时间区间内对应视频下的答题记录,默认每页显示20条记录
2、接口URL中的{userid}为点播账号userid,具体参考菜单【使用须知】->【获取密钥】
3、接口支持https协议
API URL
http://api.polyv.net/v2/video/{userid}/video-exam-log
Request Method
GET
API Constraints
- The API supports both HTTP and HTTPS. HTTPS is recommended to ensure API security. API calls are subject to rate limits. See details
Request Parameter Description
| Parameter | Required | Type | Description |
|---|---|---|---|
| ptime | true | Long | Current time in milliseconds timestamp, valid for 3 minutes |
| sign | true | String | Signature, a 40-character uppercase SHA1 value. The secret key used to generate the signature is critical for communication data security. It must never be saved or used directly on the client side. All APIs must be called through the customer's own server to relay requests to the POLYV server and obtain response data. See signature generation rules |
| vids | false | String | Video IDs, multiple IDs separated by commas (if not passed, quiz records for the entire account will be queried) |
| pageNum | false | String | Current page number, defaults to 1 |
| start | false | String | Query start date, format yyyy-MM-dd, e.g., 2019-11-12 |
| end | false | String | Query end date, format yyyy-MM-dd, e.g., 2019-11-15 |
Example
http://api.polyv.net/v2/video/1b448be323/video-exam-log?vids=1b448be323ae991b1dfc5136597618d1_1,1b448be323fb327a42539cbb788913b4_1&sign=719F0A17584C25FC4629ACB19F33D3032C1F7043&ptime=1617179333490
Response Parameter Description
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Response status code, 200 for success, non-200 for failure See global error description |
| status | String | Response status text |
| message | String | Response description, provides error reason when code is 400 or 500 |
| data | Array | Returns an array of quiz records on success [See data field description](/vod/api/video_management/quiz/get_quiz_result.md?id=polyv1], returns empty on failure |
Data Parameter Description
| Field | Type | Description |
|---|---|---|
| logid | Long | Record ID |
| examId | String | Quiz question ID |
| userid | String | User ID |
| videoPoolId | String | Video ID |
| question | String | Question description |
| answer | String | Answer |
| isCorrect | Integer | Whether the answer is correct 1: Correct 0: Incorrect |
| playId | String | Player ID |
| ipAddress | String | IP address |
| province | String | Province |
| isp | String | ISP |
| operatingSystem | String | Operating system |
| browser | String | Browser |
| dateAdded | Long | Date the question was answered, 13-digit millisecond timestamp |
| viewerid | String | Custom user ID, null if not set |
| viewerInfo | String | Custom user information, null if not set |
Java Request Example
For quick integration, please download the relevant dependency source code. Click to download source code. After downloading, add it to your own project. The HttpUtil.java and VodSignUtil.java in the test cases are included in the download file.
It is strongly recommended to use the VOD Java SDK for API integration. The VOD Java SDK provides unified encapsulation and optimization for API call logic, exception handling, data signing, and HTTP request thread pooling.
private static final Logger log = LoggerFactory.getLogger(VodVideoManageManagementTest.class);
/**
* 获取答题记录
*/
@Test
public void testBatchAnswerLog() 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/"+userId+"/video-exam-log";
String vids="1b448be323ae991b1dfc5136597618d1_1,1b448be323fb327a42539cbb788913b4";
//调用参数
Map<String, String> requestMap = new HashMap<>();
requestMap.put("ptime", ptime);
requestMap.put("vids", vids);
requestMap.put("sign", VodSignUtil.getSign(requestMap, secretKey));
String response = HttpUtil.get(url, requestMap);
log.debug("测试获取答题记录,{}", response);
//do somethings
}
Response Example
See Global Error Description for system-wide error descriptions.
Success Example
{
"code":200,
"status":"success",
"message":"success",
"data":[
{
"logid":520590342,
"examId":"178874755b8",
"userid":"1b448be323",
"videoPoolId":"1b448be323ae991b1dfc5136597618d1_1",
"question":"鲁迅是?",
"answer":"[\"思想家\",\"作家\"]",
"isCorrect":1,
"playId":"1617179315708X1845263",
"ipAddress":"118.249.43.196",
"province":"湖南省",
"isp":"电信",
"operatingSystem":"Windows",
"browser":"Chrome 8",
"dateAdded":1617179322000,
"viewerid": "abc",
"viewerInfo": "{ \"name\": \"张三\", \"age\": 18 }"
},
{
"logid":520589938,
"examId":"178875c04b9",
"userid":"1b448be323",
"videoPoolId":"1b448be323fb327a42539cbb788913b4_1",
"question":"蝴蝶会飞吗?",
"answer":"[\"会\",\"不仅可以飞\"]",
"isCorrect":1,
"playId":"1617179264924X1521499",
"ipAddress":"118.249.43.196",
"province":"湖南省",
"isp":"电信",
"operatingSystem":"Windows",
"browser":"Chrome 8",
"dateAdded":1617179273000,
"viewerid": "abc",
"viewerInfo": "{ \"name\": \"张三\", \"age\": 18 }"
}
]
}
Error Example
{
"code": 400,
"status": "error",
"message": "ptime is too old.",
"data": ""
}
