Last update:2022-01-07 14:31:35
The user specifies the video url to be uploaded through the interface, and the cloud vedio background system actively fetches and saves it in the user’s Cloud VOD storage space. This function supports batch fetch.
Request method | POST/GET |
---|---|
Interface Address | https://api.cloudv.haplat.net/vod/videoManage/pullVideo |
If token is needed | The verification token is needed |
Parameter | Type | Required | Remarks |
---|---|---|---|
transNo | string | no | Business ID, users need to control the uniqueness by themselves. It is recommended to use 32-bit UUID, and the longest 32-bit string. |
cmd | string | no | Command, the format is as follows: {tcTemplateName:xxxx,workflowCode:xxx} |
fileList | array | Yes | The url of the video to be fetched and the corresponding parameters (parameters include fileName, fileUrl, md5) are expressed as a json string and encoded with url_safe_base64, and at most 50 can be pulled at a time. Example: Use the following string to encode url_safe_base64 [{"fileName":"fileName1","fetchUrl":"fetchUrl1","md5":"md51"}, {"fileName":"fileName2","fetchUrl":" fetchUrl2","md5":"md52"}] |
workflowId | string | no | Workflow ID |
notifyUrl | string | no | The url that receives the processing result. The url does not need to be encrypted. For details of the notification content, please refer to "Notification Interface Return Content List", the content of the notification will be encoded with url_safe_base64. |
separate | int | no | Whether the processing instructions for fetching multiple videos are notified separately. Ranges:
|
The format of fileList before url_safe_base64 encoding is an array, and the data structure of the array elements:
Parameter | Type | Required | Remarks |
---|---|---|---|
fileName | string | No | Specify the file name of the fetched file. It is recommended to include the format suffix. If the format suffix is not included, the fetched video will also have no format suffix. If not send the parameter, will use the last URI of the URL as the file name. |
fetchUrl | String | Yes | The url of the file to be fetched. |
md5 | String | No | The md5 value of the file to be fetched; used to verify whether the file is damaged after the fetch. If not fill in, will not verify. |
For common return results, please refer to the Return Result.
Input example
curl -X POST http://api.cloudv.haplat.net/vod/videoManage/pullVideo
-H 'content-type: application/x-www-form-urlencoded; charset=utf-8'
-H "Host: api.cloudv.haplat.net"
<公共的头部参数>
<自定义的头部参数>
-d 'fileList=W3tmaWxlbmFtZTo8ZmlsZU5hbWUxPixmZXRjaFVybDo8ZmV0Y2hVcmwxPixtZDU6PG1kNTE+fSx7ZmlsZW5hbWU6PGZpbGVOYW1lMj4sZmV0Y2hVcmw6PGZldGNoVXJsMj4sbWQ1OjxtZDUyPn1d¬ifyUrl=aHR0cHM6Ly93d3cuYmFpZHUuY29t&separate=1'
Notes: For the “public parameter” in the example, please refer to Common Parameters.
Output example
{
"code": 200,
"message": "操作成功",
"data":{"taskId":"0123456789012345678912",
"transNo": "0123456789012345678912"}
}
The interface has no error codes that are related to interface service logic, the generic error code can be found at Return Result.
The upload result is fed back to the client through a callback method. The server sends an http
post request to the callback notification address specified in the video file URL fetch interface . The returned data will be encoded in json format using url_safe_base64 and then written into the body of the request.
Return success result
Parameter | Type | Remark |
---|---|---|
taskId | string | Task ID. |
transNo | string | Business ID |
timestamp | long | Millisecond timestamp |
status | int | Task status Value range of task status :
|
items | array | The status information of each video fetch result. If the processing request includes multiple videos, the items include multiple pieces of information. |
Items field data format
Parameter | Type | Remark |
---|---|---|
fileName | string | file name |
fetchUrl | string | Fetch URL |
md5 | string | Video md5 |
pullStatus | string | Fetch task execution status Value range of it:
|
cmdStatus | string | Integrated command execution status Value range of it:
|
videoInfo | obj | Contains video id, video file list. The file list includes bitrate, definition, resolution, terminal type, and video URL. |
videoInfo field data format
Parameter | Type | Remarks |
---|---|---|
videoId | string | Video ID |
duration | double | duration |
videoFileList | array | Video file list |
videoFileList field data format
Parameter name | Type | Remark |
---|---|---|
clarity | int | Definition. Ranges:
|
serverType | int | Terminal type. Ranges:
|
bitrate | int | Bitrate |
resolution | string | Resolution |
fileSize | long | File size |
fileUrl | string | Video url |
Client server response rules: