Export Video Sync Task
Updated: 2025-01-14 15:45:53
API Description
1、导出视频同步任务列表中的单个任务,文件格式为csv
2、接口URL中的{userid}为点播账号userid,具体参考菜单【使用须知】->【获取密钥】
3、接口支持https协议
API URL
http://api.polyv.net/v2/video/grab/{userid}/listVideos/export
Request Method
GET
API Constraints
- The API supports both HTTP and HTTPS. HTTPS is recommended for security. API calls have frequency limits. See details
Request Parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
| ptime | true | Long | Current time in milliseconds, valid within 3 minutes |
| sign | true | String | Signature, a 40-character uppercase SHA1 value. The secretkey used to generate the signature is critical for communication data security. It must not be stored or used directly on the client side. All API calls must be relayed through the customer's own server to the POLYV server for response data. See signature generation rules |
| taskId | true | String | Sync task ID. This value can be obtained from the Query Video Sync Task API |
Example
http://api.polyv.net/v2/video/grab/1b448be323/listVideos/export?sign=AA568246125A62B6CB277714DE7A63D0E430135B&ptime=1617160493739&taskId=0mKdBQDsbR
Response Parameters
On success, the API returns a file binary stream in CSV format, which can be saved as a file.
Java Request Example
For quick integration, download the relevant dependency source code. Click here to download the source code. After downloading, add it to your own project. The test cases include HttpUtil.java and VodSignUtil.java in the downloaded 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(VodVideoUploadTest.class);
/**
* 导出视频同步任务
*/
@Test
public void testExportVideoSyncTask() throws Exception, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String secretKey = super.secretKey;
String ptime = String.valueOf(System.currentTimeMillis());
//业务参数
String url = String.format("http://api.polyv.net/v2/video/grab/%s/listVideos/export",userid);
String taskId = "0mKdBQDsbR";
Map<String, String> requestMap = new HashMap<>();
requestMap.put("ptime", ptime);
requestMap.put("taskId", taskId);
requestMap.put("sign", VodSignUtil.getSign(requestMap, secretKey));
byte[] binary = HttpUtil.getBinary(url, requestMap, null);
String path = getClass().getResource("/file/").getPath() + "exportTask.csv";
HttpUtil.writeFile(binary, path);
log.debug("测试导出视频同步任务,{}", path);
//do somethings
}
Response Example
For global error descriptions, see Global Error Description
Success Example
D:/polyv-api-example/target/test-classes/file/exportTask.csv
Error Example
{
"code":400,
"status":"error",
"message":"TaskId is null!",
"data":""
}
