Replace and Delete Tags
This API enables you to replace existing tags from video(s), and to even delete existing tags. You need to send an HTTP PUT request to https://dev.vdocipher.com/api/videos/tags
. This replaces existing tags in a video with the specified tags.
PUT Request Body
{
"videos":["{{videoID1}}", "{{videoID2}}"],
"tags":["{{tag1}}", "{{tag2}}"]
}
To delete all tags associated with a video you can simply pass an empty array to tags
, as follows:
{
"videos":[ "{{videoID1}}", "{{videoID2}}"],
"tags":[]
}
Sample Code for Tag Replaceβ
The sample tag is written as {{tag}}. Replace this with the desired tag.
The sample API Secret Key is a1b2c3d4e5
.
- CURL
- NODE
- PHP
- C#
- Python
- Ruby
curl -X PUT \
https://dev.vdocipher.com/api/videos/tags \
-H 'Accept: application/json' \
-H 'Authorization: Apisecret a1b2c3d4e5' \
-H 'Content-Type: application/json' \
-d '{
"videos":[
"{{videoID1}}",
"{{videoID2}}"
],
"tags":[
"{{tag}}"
]
}'
var request = require('request');
var options = {
method: 'PUT',
url: 'https://dev.vdocipher.com/api/videos/tags',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': 'Apisecret a1b2c3d4e5',
},
body: {videos: ['{{videoID1}}', '{{videoID2}}'], tags: ['{{tag}}']},
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/tags",
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([
"videos" => ["{{videoID1}}","{{videoID2}}"],
"tags" => ["{{tag}}"]
]),
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/tags");
var request = new RestRequest(Method.PUT);
request.AddHeader("Accept", "application/json");
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Apisecret a1b2c3d4e5");
request.AddParameter("undefined", "{\n\t\"videos\":[\n\t\t\"videoID1\",\n\t\t\"{{videoID2}}\"\n\t\t],\n\t\"tags\":[\n\t\t\"{{tag}}\"\n\t\t]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
import requests
import json
url = "https://dev.vdocipher.com/api/videos/tags"
payload = json.dumps({
"videos": ["{{videoID1}}", "{{videoID2}}"],
"tags": [ "{{tag}}" ]
})
headers = {
'Authorization': "Apisecret a1b2c3d4e5",
'Content-Type': "application/json",
'Accept': "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/tags")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Apisecret a1b2c3d4e5'
request["Content-Type"] = 'application/json'
request["Accept"] = 'application/json'
request.body = ({
:videos => ["{{video1}}","{{video2}}"],
:tags => ["{{tag}}"]
}).to_json
response = http.request(request)
puts response.read_body