Paginated Query of Account Quiz Questions
Updated: 2026-01-20 14:07:15
API Description
1、分页查询账号的问答题目,支持按视频筛选
2、接口支持https协议
API URL
http://api.polyv.net/v2/video/list-video-exam
Request Method
GET
API Constraints
- The API supports both HTTP and HTTPS. HTTPS is recommended to ensure API security. API calls have a frequency limit. See details
Request Parameter Description
| Parameter | Required | Type | Description |
|---|---|---|---|
| userid | true | String | POLYV VOD account ID. Refer to Get Secret Key for acquisition. Path: Official Website -> Login -> VOD (API Interface) |
| ptime | true | Long | Current time in milliseconds timestamp, valid for 3 minutes |
| sign | true | String | Signature, a 40-character uppercase SHA1 value. The secretkey used to generate the signature is critical information for communication data security. It must never be saved and 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 for details |
| vid | false | String | Video ID. If this parameter is empty, query all quiz questions under the account |
| page | false | Integer | Page number, starting from 1, default is 1 |
| pageSize | false | Integer | Number of items per page, default is 10, maximum is 1000 |
Example
http://api.polyv.net/v2/video/list-video-exam
Form Parameters:
userid=1b448be323&ptime=1620287966337&sign=738445A034D8F70D3625E0C761EE26A4E9F3446B&vid=1b448be3231ebf0005ec631a7e4247ee_1&page=1&pageSize=10
Response Parameter Description
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Response status code, 200 for success, non-200 for failure. See Global Error Description for details |
| status | String | Response status text |
| message | String | Response description message, assists in describing the error reason when code is 400 or 500 |
| data | Object | Returns paginated data on success, returns empty on failure. See data field description for details |
data Field Description
| Field | Type | Description |
|---|---|---|
| pageNumber | Integer | Current page number |
| pageSize | Integer | Number of items per page |
| totalItems | Long | Total number of records |
| totalPages | Integer | Total number of pages |
| contents | Array | List of quiz questions. See contents field description |
contents Field Description
| Field | Type | Description |
|---|---|---|
| vid | String | Video ID |
| examId | String | Quiz question ID |
| showTime | Integer | Time when the quiz question appears, in seconds |
| qustion | String | Quiz question description |
| choices | String | Quiz question options content, formatted as a JSON array, maximum 5 options per question |
| canSkip | Boolean | Whether it can be skipped, default value: false |
| explanationIfRight | String | Explanation details displayed after answering correctly |
| showExplanationIfWrong | String | Whether to display explanation details after answering incorrectly |
| explanationIfWrong | Boolean | Explanation details displayed after answering incorrectly |
| backTime | Integer | Number of seconds to go back after answering incorrectly, -1 means no rewind, default is -1 |
| status | Integer | Whether it is valid, 1: valid, 0: invalid, default is 1 |
| type | Integer | Question type, 0: multiple choice, 1: listening question (Listening questions will be deprecated soon) |
| mp3url | String | MP3 audio file URL for listening questions (Listening questions will be deprecated soon) |
| illustration | String | Quiz question image URL |
| createdTime | Long | Quiz question creation time, formatted as a 13-digit timestamp, e.g., 1767003468000 |
Java Request Example
For quick integration of basic code, please download the relevant dependency source code. Click here to download the source code. After downloading, add it to your own source code project. The HttpUtil.java and VodSignUtil.java in the test cases are included in the downloaded file.
It is strongly recommended to use the VOD Java SDK for API functionality integration. The VOD Java SDK provides unified encapsulation and optimization for API call logic, exception handling, data signing, and HTTP request thread pools.
private static final Logger log = LoggerFactory.getLogger(VodVideoManageManagementTest.class);
/**
* 分页查询问答题目
*/
@Test
public void testListQuiz() 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/list-video-exam";
//调用参数
Map<String, String> requestMap = new HashMap<>();
requestMap.put("userid", userId);
requestMap.put("ptime", ptime);
requestMap.put("page", "1");
requestMap.put("pageSize", "10");
requestMap.put("sign", VodSignUtil.getSign(requestMap, secretKey));
String response = HttpUtil.get(url, requestMap);
log.debug("测试分页查询问答题目,{}", response);
//do something
}
Response Example
For global system error descriptions, see Global Error Description
Success Example
{
"code": 200,
"status": "success",
"message": "success",
"data": {
"pageNumber": 1,
"pageSize": 10,
"totalItems": 2,
"totalPages": 1,
"contents": [
{
"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
}
]
}
}
Error Example
Incorrect Signature
{
"code": 400,
"status": "error",
"message": "the sign is not right",
"data": ""
}
Timestamp Expired
{
"code": 400,
"status": "error",
"message": "ptime is too old.",
"data": ""
}
