API Center

PullVideo

Update time: 2023-10-08 15:03:27

Applicable Products

Cloud VoD

API Description

Call pullVideo to set the url of the video to be pulled to the background. The background automatically pulls and saves url videos from third-party platforms. You can set pull tasks in batches.

Call frequency

Single user trigger frequency: 300/5min

We recommend you to use API Explorer

The API Explorer provides the ability of visual interface online call API, code examples generation, and API documents quickly search .Try it

Request parameter(s)

Body Params

NameDescription
transNoString
The service ID must be unique and controlled by users It is recommended that a 32-bit UUID be a string of up to 32 characters
cmdString
Command in the following format {tcTemplateName:xxxx,workflowCode:xxx}
*fileListString
The url and corresponding parameters of the video to be pulled are expressed in json strings and encoded in url_safe_base64. A maximum of 50 urls and parameters can be pulled at a time. The parameters are as follows: 1) filName: Specifies the name of the pulled file. It is recommended to include a format suffix. If no format suffix is included, the pulled video will not have a format suffix. If not, the file name is the URI at the end of the URL 2) fetchUrl: Required, url of the file to be pulled 3) md5: indicates the md5 value of the file to be pulled. Used to verify whether a file is damaged after being pulled. Do not fill, do not check Example: Use the following string for url_safe_base64 encoding [{"fileName":"fileName1","fetchUrl":"fetchUrl1","md5":"md51"},{"fileName":"fileName2","fetchUrl":"fetchUrl2","md5":"md52"}]
workflowIdString
Workflow ID
notifyUrlString
url to receive processing results. This url does not need to be encrypted. For details about the notification content, see the interface document. The notification content is encoded in url_safe_base64
separateInteger
Whether the processing instructions for pulling multiple videos are notified separately. Value range: 0(entire batch merge notification) 1(each video is notified independently) Default is 0

Response parameter(s)

Body Params

NameDescription
codeInteger
Result status code, 200 indicates success
messageString
message
dataObject
Return data
tranNoString
trans NO
taskIdString
Task ID

Example

JSON
JSON
Request example
Copy Copy success
#!/bin/bash
username='example_username'
apiKey='example_apiKey'
date=`env LANG="en_US.UTF-8" date -u "+%a, %d %b %Y %H:%M:%S GMT"`
password=`echo -en "$date" | openssl dgst -sha1 -hmac $apiKey -binary | openssl enc -base64`
curl -i --url "https://api.cdnetworks.com/vod/videoManage/pullVideo" \
-X "POST" \
-u "$username:$password" \
-H "Date: $date" \
-H "x-cnc-auth-method: BASIC" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
	"fileList":"W3tmaWxlbmFtZTo8ZmlsZU5hbWUxPixmZXRjaFVybDo8ZmV0Y2hVcmwxPixtZDU6PG1kNTE+fSx7ZmlsZW5hbWU6PGZpbGVOYW1lMj4sZmV0Y2hVcmw6PGZldGNoVXJsMj4sbWQ1OjxtZDUyPn1d",
	"workflowId":"workflowId_1",
	"notifyUrl":"http://xxxxxx/callback/",
	"cmd":"{tcTemplateName:xxxx,workflowCode:xxx}",
	"transNo":"XXXXXXXXXX",
	"separate":"1"
}'
Response example
Copy Copy success
{
    "code": 200,
	"message": "操作成功",
	"data":{
		"taskId":"0123456789012345678912",
		"transNo": "0123456789012345678912"
	}
}
Is the content of this document helpful to you?
Yes
I have suggestion
Submitted successfully! Thank you very much for your feedback, we will continue to strive to do better!