Content Management
Get video data
Getting single video data
To get the data for a specific video, use the following API call:
GET https://api.target-video.com/apiv3/video/view/{VIDEO_ID}.json
Every request must send your API token in an Authorization: Bearer header — see API credentials.
Examples
PHP
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.target-video.com/apiv3/video/view/{{VIDEO_ID}}.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer YOUR_API_TOKEN"
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Java
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
Request request = new Request.Builder()
.url("https://api.target-video.com/apiv3/video/view/{{VIDEO_ID}}.json")
.method("GET", null)
.addHeader("Authorization", "Bearer YOUR_API_TOKEN")
.build();
Response response = client.newCall(request).execute();
JavaScript
var https = require('follow-redirects').https;
var fs = require('fs');
var options = {
'method': 'GET',
'hostname': 'api.target-video.com',
'path': '/apiv3/video/view/{{VIDEO_ID}}.json',
'headers': {
'Authorization': 'Bearer YOUR_API_TOKEN'
},
'maxRedirects': 20
};
var req = https.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function (chunk) {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
res.on("error", function (error) {
console.error(error);
});
});
req.end();
Ruby
require "uri"
require "net/http"
url = URI("https://api.target-video.com/apiv3/video/view/{{VIDEO_ID}}.json")
https = Net::HTTP.new(url.host, url.port);
https.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = "Bearer YOUR_API_TOKEN"
response = https.request(request)
puts response.read_body
On success the response contains the video’s details under Video, with related records such as Tag. An unknown video ID, or a video in a website you can’t access, fails with HTTP 400.