SDK
import { createVoyantCloudClient } from "@voyant-travel/cloud-sdk";
const cloud = createVoyantCloudClient({ apiKey: process.env.VOYANT_API_KEY });
const token = await cloud.video.videos.mintToken("<videoId>", {
"expiresInSeconds": 123,
"downloadable": true
});curl --request POST \
--url https://api.voyant.travel/video/v1/videos/<videoId>/token \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"expiresInSeconds": 123,
"downloadable": true
}'const response = await fetch("https://api.voyant.travel/video/v1/videos/<videoId>/token", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer <token>"
},
body: JSON.stringify({
"expiresInSeconds": 123,
"downloadable": true
}),
});
const data = await response.json();import requests
response = requests.post(
"https://api.voyant.travel/video/v1/videos/<videoId>/token",
headers={
"Authorization": "Bearer <token>"
},
json={
"expiresInSeconds": 123,
"downloadable": True
}
)
data = response.json()<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.voyant.travel/video/v1/videos/{videoId}/token",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'expiresInSeconds' => 43230,
'downloadable' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.voyant.travel/video/v1/videos/{videoId}/token"
payload := strings.NewReader("{\n \"expiresInSeconds\": 43230,\n \"downloadable\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.voyant.travel/video/v1/videos/{videoId}/token")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"expiresInSeconds\": 43230,\n \"downloadable\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.voyant.travel/video/v1/videos/{videoId}/token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"expiresInSeconds\": 43230,\n \"downloadable\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"videoId": "<string>",
"token": "<string>",
"expiresAt": 123,
"playbackHlsUrl": "<string>",
"playbackDashUrl": "<string>"
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>",
"retryAfterMs": 123
}{
"error": "<string>"
}{
"error": "<string>"
}Video
Mint a signed playback token
Mints a short-lived signed token for playing back a video that requires signed URLs. A JSON body is optional. Requires scope: video:read
POST
/
video
/
v1
/
videos
/
{videoId}
/
token
SDK
import { createVoyantCloudClient } from "@voyant-travel/cloud-sdk";
const cloud = createVoyantCloudClient({ apiKey: process.env.VOYANT_API_KEY });
const token = await cloud.video.videos.mintToken("<videoId>", {
"expiresInSeconds": 123,
"downloadable": true
});curl --request POST \
--url https://api.voyant.travel/video/v1/videos/<videoId>/token \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"expiresInSeconds": 123,
"downloadable": true
}'const response = await fetch("https://api.voyant.travel/video/v1/videos/<videoId>/token", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer <token>"
},
body: JSON.stringify({
"expiresInSeconds": 123,
"downloadable": true
}),
});
const data = await response.json();import requests
response = requests.post(
"https://api.voyant.travel/video/v1/videos/<videoId>/token",
headers={
"Authorization": "Bearer <token>"
},
json={
"expiresInSeconds": 123,
"downloadable": True
}
)
data = response.json()<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.voyant.travel/video/v1/videos/{videoId}/token",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'expiresInSeconds' => 43230,
'downloadable' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.voyant.travel/video/v1/videos/{videoId}/token"
payload := strings.NewReader("{\n \"expiresInSeconds\": 43230,\n \"downloadable\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.voyant.travel/video/v1/videos/{videoId}/token")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"expiresInSeconds\": 43230,\n \"downloadable\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.voyant.travel/video/v1/videos/{videoId}/token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"expiresInSeconds\": 43230,\n \"downloadable\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"videoId": "<string>",
"token": "<string>",
"expiresAt": 123,
"playbackHlsUrl": "<string>",
"playbackDashUrl": "<string>"
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>",
"retryAfterMs": 123
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
Voyant Cloud API token, passed as Authorization: Bearer <token>. Each token carries a fixed set of scopes; an operation rejects tokens missing its required scope.
Path Parameters
Body
application/json
Response
Signed token
Show child attributes
Show child attributes
⌘I