Skip to main content
POST
/
streaming
/
vods
/
v2
cURL
curl --request POST \
  --url https://api.mottostreaming.com/streaming/vods/v2 \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "project_id": "<string>",
  "localized_title": {},
  "asset_id": "<string>",
  "external_asset_url": "<string>"
}
'
import requests

url = "https://api.mottostreaming.com/streaming/vods/v2"

payload = {
"name": "<string>",
"project_id": "<string>",
"localized_title": {},
"asset_id": "<string>",
"external_asset_url": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
project_id: '<string>',
localized_title: {},
asset_id: '<string>',
external_asset_url: '<string>'
})
};

fetch('https://api.mottostreaming.com/streaming/vods/v2', 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://api.mottostreaming.com/streaming/vods/v2",
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([
'name' => '<string>',
'project_id' => '<string>',
'localized_title' => [

],
'asset_id' => '<string>',
'external_asset_url' => '<string>'
]),
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.mottostreaming.com/streaming/vods/v2"

payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"project_id\": \"<string>\",\n \"localized_title\": {},\n \"asset_id\": \"<string>\",\n \"external_asset_url\": \"<string>\"\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.mottostreaming.com/streaming/vods/v2")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"project_id\": \"<string>\",\n \"localized_title\": {},\n \"asset_id\": \"<string>\",\n \"external_asset_url\": \"<string>\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.mottostreaming.com/streaming/vods/v2")

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 \"name\": \"<string>\",\n \"project_id\": \"<string>\",\n \"localized_title\": {},\n \"asset_id\": \"<string>\",\n \"external_asset_url\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "vod": {
    "name": "<string>",
    "id": "<string>",
    "project_id": "<string>",
    "localized_title": {},
    "video_id": "<string>",
    "asset_id": "<string>",
    "external_asset_url": "<string>"
  }
}
{
"code": 123,
"message": "<string>",
"details": [
{
"@type": "<string>"
}
]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
name
string
required

The name of the video. This is a canonical name that is independent of locales, and is primarily meant for internal purposes (e.g. a name for tracking in analytics). For end-user facing purposes, use localized_title.

project_id
string

Required if providing external_asset_url as input

localized_title
object

A map of localized titles for this stream, for end users to see. The key is the language code (ISO 639 - set 1), e.g. "en", "de", "fr", etc. If you want to localize the text for different regions of the same language, you can add the country code (ISO 3166-1 alpha-2), e.g. "en-US", "en-GB", etc.

If this is not provided, fallback to name.

region
enum<string>

Required if providing external_asset_url as input

Available options:
REGION_UNSPECIFIED,
REGION_AF,
REGION_AS,
REGION_EU,
REGION_NA,
REGION_OC,
REGION_SA
asset_id
string

Recommended. A Motto asset ID of an uploaded file (e.g. mp4).

Important: at most one of asset_id, external_asset_url may be set per request.

external_asset_url
string

BETA FEATURE, NOT GENERALLY AVAILABLE YET.

If you are not able to upload a static asset to Motto, you can provide a URL to an external video resource (e.g. HLS or DASH). Motto will then attempt to retrieve this resource directly from the public internet.

Important: at most one of asset_id, external_asset_url may be set per request.

Response

OK

CreateVideoResponse is the response message for CreateVideo.

vod
object

The created video.