Deleting Videos Using VdoCipher API
Videos can be deleted using the delete API, by sending an HTTP DELETE request to https://dev.vdocipher.com/api/videos
with the videoID as query. You can delete multiple videos by separating the videoIDs by comma in the HTTP query, as follows:
'https://dev.vdocipher.com/api/videos?videos={{videoID1}},{{videoID2}}
The playback of videos is often cached by multiple cache servers and it is possible for a video to keep playing for a short while even after it is deleted from account.
Deleting a video will stop a video from counting towards the storage accounting.
Sample Code for Video Deletionβ
The sample API Secret Key is a1b2c3d4e5
. videoIDs are written as {{videoID1}} and {{videoID2}}. Replace these with the actual videoIDs.
- CURL
- NODE
- PHP
- C#
- Python
- Ruby
curl -X DELETE \
'https://dev.vdocipher.com/api/videos?videos={{videoID1}},{{videoID2}}' \
-H 'Accept: application/json' \
-H 'Authorization: Apisecret a1b2c3d4e5' \
-H 'Content-Type: application/json'
var request = require('request');
var options = {
method: 'DELETE',
url: 'https://dev.vdocipher.com/api/videos',
qs: {videos: '{{videoID1}},{{videoID2}}'},
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'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?videos={{videoID1}},{{videoID2}}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
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?videos={{videoID1}},{{videoID2}}");
var request = new RestRequest(Method.DELETE);
request.AddHeader("Accept", "application/json");
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Apisecret a1b2c3d4e5");
IRestResponse response = client.Execute(request);
import requests
url = "https://dev.vdocipher.com/api/videos"
querystring = {"videos":"{{videoID1}},{{videoID2}}"}
headers = {
'Authorization': "Apisecret a1b2c3d4e5",
'Content-Type': "application/json",
'Accept': "application/json"
}
response = requests.request("DELETE", url, headers=headers, params=querystring)
print(response.text)
require 'uri'
require 'net/http'
url = URI("https://dev.vdocipher.com/api/videos?videos={{videoID1}},{{videoID2}}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Apisecret a1b2c3d4e5'
request["Content-Type"] = 'application/json'
request["Accept"] = 'application/json'
response = http.request(request)
puts response.read_body