Query Video Source File Retrieval Task
Updated: 2023-09-14 17:29:57
Interface Description
- Query the status of submitted tasks
- The interface supports the HTTPS protocol
Interface URL
http://api.polyv.net/v3/video/source-file-task/get
Request Method
GET
Interface Constraints
- The interface supports both HTTP and HTTPS. HTTPS is recommended to ensure interface security. The interface has a call frequency limit. For details, please see
Request Parameter Description
| Parameter | Required | Type | Description |
|---|---|---|---|
| appId | true | String | Polyv VOD sub-account appId. Retrieval path: Polyv VOD backend -> Settings -> Account Management |
| timestamp | true | Long | Current time in milliseconds, valid within 3 minutes |
| sign | true | String | Signature, 32-character uppercase MD5 value [See MD5 Signature Generation Rules for details] |
| taskId | true | String | Task ID [See Create Task for details] |
Example
http://api.polyv.net/v3/video/source-file-task/get?taskId=16661c08b9564c1ea6f4544ccd568e58&expireDays=1&appId=a0Wmol5EwX&sign=197679CCF105DD80E0378BEF75993D31×tamp=1617950661602
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 information |
| requestId | String | Business request ID for this request, facilitating client/server troubleshooting |
| error | Object | Detailed error information returned on failure [See error field description for details], returns empty on success |
| data | Array | Returns a list of video information on success [See data field description for details], returns empty on failure |
error Field Description
| Field | Type | Description |
|---|---|---|
| code | Integer | Error code |
| desc | String | Error description [See Global Error Description for details] |
data Field Description
| Field | Type | Description |
|---|---|---|
| vid | String | Video ID |
| url | String | Video source file download link |
| status | Enum | Status (INIT-Initializing, PROCESS-Processing, SUCCESS-Success, FAIL-Failed) |
| createTime | long | Creation time, in milliseconds |
| successTime | long | Processing success time, in milliseconds |
Java Request Example
For quick integration of the base 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. HttpUtil.java and VodSignUtil.java in the test cases are included in the downloaded file.
private static final Logger log = LoggerFactory.getLogger(Test.class);
/**
* 查询视频源文件取回任务
* @throws Exception
* @throws NoSuchAlgorithmException
*/
@Test
public void tesGetVideoSourceFileTask() throws Exception, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String appId = super.appId;
String appSecret = super.appSecret;
String timestamp = String.valueOf(System.currentTimeMillis());
//业务参数
String url = "http://api.polyv.net/v3/video/source-file-task/get";
String taskId = "16661c08b9564c1ea6f4544ccd568e58";
Map<String, String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("timestamp", timestamp);
requestMap.put("taskId", taskId);
//用md5进行签名,使用子账号的secretKey签名
requestMap.put("sign", VodSignUtil.getSignMd5(requestMap, appSecret));
String response = HttpUtil.get(url, requestMap);
log.debug("测试查询视频源文件取回任务,{}", response);
//do somethings
}
Response Example
For system global error descriptions, see Global Error Description
Success Example
{
"requestId": "a7f2e4e3-5884-43b3-b3e7-705cdcbb66eb",
"code": 200,
"status": "success",
"error": null,
"data": [
{
"vid": "1b448be32370f4822ac40fd926112a66_1",
"url": "https://video-dl-2.videocc.net/1b448be323/6/1b448be32370f4822ac40fd926112a66.mp4?auth_key=1694663401-3iwFnV2uJx-ac59aff03d-c71c8c4e01284d892c2dc9ad1ee57272",
"status": "SUCCESS",
"createTime": 1694663401000,
"successTime": 1694663401000
},
{
"vid": "1b448be32305bb29879b1eb06abd9fa1_1",
"url": null,
"status": "PROCESS",
"createTime": 1694663401000,
"successTime": null
}
]
}
Error Example
{
"requestId": "e7544473-250a-40eb-b53b-8768195617e0",
"code": 403,
"status": "error",
"error": {
"code": 104,
"desc": "invalid signature"
},
"data": null
}
