Obtain credentials before upload
API endpoint to send HTTP PUT request to receive upload credentials is https://dev.vdocipher.com/api/videos
. To initiate video upload you would need to pass the title of video as a query string: https://dev.vdocipher.com/api/videos?title=videotitle
where videotitle
is the title of the video.
This returns a JSON object, which authorizes you to initiate upload. You may upload the file yourself, or can pass the upload credentials to your content providers who can then upload videos to your account. The JSON object looks like this:
The values received in upload policy are presented in the following format - {{policy}}
{ "clientPayload": { "policy": "{{format}}", "key": "{{key}}", "x-amz-signature": "{{x-amz-signature}}", "x-amz-algorithm": "{{x-amz-algorithm}}", "x-amz-date": "{{x-amz-date}}", "x-amz-credential": "{{x-amz-credential}}", "uploadLink": "https://{s3-bucket-url}}.amazonaws.com" }, "videoId": "1234567890"}
#
Obtain Credentials Sample CodeUse the language tab on top-right to choose your server language.
The sample videoID is 1234567890
and the API Secret Key is a1b2c3d4e5
.
- CURL
- NODE
- PHP
- C#
- Python
- Ruby
curl -X PUT \ 'https://dev.vdocipher.com/api/videos?title=title' \ -H 'Authorization: Apisecret a1b2c3d4e5'
var request = require("request");
var options = { method: "PUT", url: "https://dev.vdocipher.com/api/videos", qs: { title: "title" }, headers: { Authorization: "Apisecret a1b2c3d4e5" },};
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?title=title", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "PUT", CURLOPT_HTTPHEADER => array( "Authorization: Apisecret a1b2c3d4e5" ),));
$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?title=title");var request = new RestRequest(Method.PUT);request.AddHeader("Authorization", "Apisecret a1b2c3d4e5");IRestResponse response = client.Execute(request);
import requests
url = "https://dev.vdocipher.com/api/videos"
querystring = {"title":"title"}
headers = { 'Authorization': "Apisecret a1b2c3d4e5" }
response = requests.request("PUT", url, headers=headers, params=querystring)
print(response.text)
require 'uri'require 'net/http'
url = URI("https://dev.vdocipher.com/api/videos?title=title")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Put.new(url)request["Authorization"] = 'Apisecret a1b2c3d4e5'
response = http.request(request)puts response.read_body