Start a VOD scan
curl --request POST \
--url https://console.interactivelayers.com/v1/vod/scans \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"campaign_ids": [
"acme-hydration"
],
"cue_points": [
600,
1200
],
"hls_url": "https://cdn.example.com/vod/episode-12/index.m3u8",
"mode": "signal"
}
'import requests
url = "https://console.interactivelayers.com/v1/vod/scans"
payload = {
"campaign_ids": ["acme-hydration"],
"cue_points": [600, 1200],
"hls_url": "https://cdn.example.com/vod/episode-12/index.m3u8",
"mode": "signal"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
campaign_ids: ['acme-hydration'],
cue_points: [600, 1200],
hls_url: 'https://cdn.example.com/vod/episode-12/index.m3u8',
mode: 'signal'
})
};
fetch('https://console.interactivelayers.com/v1/vod/scans', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://console.interactivelayers.com/v1/vod/scans",
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([
'campaign_ids' => [
'acme-hydration'
],
'cue_points' => [
600,
1200
],
'hls_url' => 'https://cdn.example.com/vod/episode-12/index.m3u8',
'mode' => 'signal'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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://console.interactivelayers.com/v1/vod/scans"
payload := strings.NewReader("{\n \"campaign_ids\": [\n \"acme-hydration\"\n ],\n \"cue_points\": [\n 600,\n 1200\n ],\n \"hls_url\": \"https://cdn.example.com/vod/episode-12/index.m3u8\",\n \"mode\": \"signal\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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://console.interactivelayers.com/v1/vod/scans")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"campaign_ids\": [\n \"acme-hydration\"\n ],\n \"cue_points\": [\n 600,\n 1200\n ],\n \"hls_url\": \"https://cdn.example.com/vod/episode-12/index.m3u8\",\n \"mode\": \"signal\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://console.interactivelayers.com/v1/vod/scans")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"campaign_ids\": [\n \"acme-hydration\"\n ],\n \"cue_points\": [\n 600,\n 1200\n ],\n \"hls_url\": \"https://cdn.example.com/vod/episode-12/index.m3u8\",\n \"mode\": \"signal\"\n}"
response = http.request(request)
puts response.read_body{
"scan_id": "<string>",
"status": "queued",
"progress": {
"percent": 0,
"stage": "<string>",
"detail": "<string>"
},
"source": {},
"mode": "<string>",
"result_url": "<string>",
"created_at": "<string>",
"links": {},
"error": "<string>",
"duration_seconds": 123,
"output_hls_url": "<string>",
"started_at": "<string>",
"finished_at": "<string>"
}Iniciar uma análise VOD
Coloca uma análise prévia na fila. Uma análise é executada por vez. Consulte GET /v1/vod/scans/{scan_id} ou acompanhe os eventos vod.scan.*. Com asset_id, leia a análise em result_url quando ela terminar. Nesse caso não há manifesto de saída. As análises de URL do fluxo anterior também podem retornar output_hls_url.
POST
/
v1
/
vod
/
scans
Start a VOD scan
curl --request POST \
--url https://console.interactivelayers.com/v1/vod/scans \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"campaign_ids": [
"acme-hydration"
],
"cue_points": [
600,
1200
],
"hls_url": "https://cdn.example.com/vod/episode-12/index.m3u8",
"mode": "signal"
}
'import requests
url = "https://console.interactivelayers.com/v1/vod/scans"
payload = {
"campaign_ids": ["acme-hydration"],
"cue_points": [600, 1200],
"hls_url": "https://cdn.example.com/vod/episode-12/index.m3u8",
"mode": "signal"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
campaign_ids: ['acme-hydration'],
cue_points: [600, 1200],
hls_url: 'https://cdn.example.com/vod/episode-12/index.m3u8',
mode: 'signal'
})
};
fetch('https://console.interactivelayers.com/v1/vod/scans', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://console.interactivelayers.com/v1/vod/scans",
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([
'campaign_ids' => [
'acme-hydration'
],
'cue_points' => [
600,
1200
],
'hls_url' => 'https://cdn.example.com/vod/episode-12/index.m3u8',
'mode' => 'signal'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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://console.interactivelayers.com/v1/vod/scans"
payload := strings.NewReader("{\n \"campaign_ids\": [\n \"acme-hydration\"\n ],\n \"cue_points\": [\n 600,\n 1200\n ],\n \"hls_url\": \"https://cdn.example.com/vod/episode-12/index.m3u8\",\n \"mode\": \"signal\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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://console.interactivelayers.com/v1/vod/scans")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"campaign_ids\": [\n \"acme-hydration\"\n ],\n \"cue_points\": [\n 600,\n 1200\n ],\n \"hls_url\": \"https://cdn.example.com/vod/episode-12/index.m3u8\",\n \"mode\": \"signal\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://console.interactivelayers.com/v1/vod/scans")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"campaign_ids\": [\n \"acme-hydration\"\n ],\n \"cue_points\": [\n 600,\n 1200\n ],\n \"hls_url\": \"https://cdn.example.com/vod/episode-12/index.m3u8\",\n \"mode\": \"signal\"\n}"
response = http.request(request)
puts response.read_body{
"scan_id": "<string>",
"status": "queued",
"progress": {
"percent": 0,
"stage": "<string>",
"detail": "<string>"
},
"source": {},
"mode": "<string>",
"result_url": "<string>",
"created_at": "<string>",
"links": {},
"error": "<string>",
"duration_seconds": 123,
"output_hls_url": "<string>",
"started_at": "<string>",
"finished_at": "<string>"
}Autorizações
Corpo
application/json
Resposta
Successful Response