Adding videos from HTTP(s)/FTP urls
Send an HTTP PUT request to the API endpoint https://dev.vdocipher.com/api/videos/importUrl
to initiate video import from any HTTP/ FTP URL. A JSON Object containing the URL needs to be passed
url is the only required property in this input object. The other properties are optional.
{
"url": "{{URLString}}",
"folderId": "{{folderID}}",
"title": "{{videoTitle}}"
}
Folder id can be copied from dashboard as shown below. For saving to
top-level, use the folderId: root
Some video streaming service providers provide API through which you may access the original video file, to initiate video import.
Import Video URL Sample Codeβ
The URL of the video is presented as {{URLString}} in the sample code. Replace it with your desired URL String.
- CURL
- NODE
- PHP
- C#
- Python
- Ruby
curl -X PUT \
https://dev.vdocipher.com/api/videos/importUrl \
-H 'Accept: application/json' \
-H 'Authorization: Apisecret a1b2c3d4e5' \
-H 'Content-Type: application/json' \
-d '{
"url": "{{URLString}}",
"folderId": "{{folderID}}",
"title": "{{videoTitle}}"
}'
var request = require('request');
var options = {
method: 'PUT',
url: 'https://dev.vdocipher.com/api/videos/importUrl',
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Apisecret a1b2c3d4e5',
},
body: {
url: '{{URLString}}',
folderId: '{{folderID}}',
title: '{{videoTitle}}',
},
json: true,
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://dev.vdocipher.com/api/videos/importUrl",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
"url" => "{{URLString}}",
"folderId" => "{{folderID}}",
"title" => "{{videoTitle}}"
]),
CURLOPT_HTTPHEADER => array(
"Accept: application/json",
"Authorization: Apisecret a1b2c3d4e5",
"Content-Type: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
var client = new RestClient("https://dev.vdocipher.com/api/videos/importUrl");
var request = new RestRequest(Method.PUT);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Accept", "application/json");
request.AddHeader("Authorization", "Apisecret a1b2c3d4e5");
request.AddParameter("undefined", "{\"url\": \"{{URLString}}\", \"folderId\": \"{{folderID}}\", \"title\": \"{{videoTitle}}\"}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
import requests
import json
url = "https://dev.vdocipher.com/api/videos/importUrl"
payload = json.dumps({"url":"{{URLString}}", "folderId": "{{folderID}}","title": "{{videoTitle}}"})
headers = {
'Authorization': "Apisecret a1b2c3d4e5",
'Accept': "application/json",
'Content-Type': "application/json"
}
response = requests.request("PUT", url, data=payload, headers=headers)
print(response.text)
require 'uri'
require 'json'
require 'net/http'
url = URI("https://dev.vdocipher.com/api/videos/importUrl")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Apisecret a1b2c3d4e5'
request["Accept"] = 'application/json'
request["Content-Type"] = 'application/json'
request.body = ({
:url => "{{URLString}}",
:folderId => "{{folderID}}",
:title => "{{videoTitle}}"
}).to_json
response = http.request(request)
puts response.read_body