cURL
curl --request POST \
--url https://api.mottostreaming.com/streaming/video_protection/v1/rulesets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"project_id": "<string>",
"name": "<string>",
"geo_restrictions_disallow": {
"country_codes": [
"<string>"
]
},
"geo_restrictions_allow": {
"country_codes": [
"<string>"
]
},
"disallow_vpn_usage": true,
"disallow_hotlinking": true,
"allowed_domains": [
"<string>"
],
"require_authentication": true,
"disabled": true,
"require_entitlement": true,
"geo_applicability_exempt": {
"country_codes": [
"<string>"
]
},
"geo_applicability_apply": {
"country_codes": [
"<string>"
]
},
"applies_to_all": true,
"target": {
"entity_ids": [
"<string>"
],
"event_ids": [
"<string>"
],
"creative_work_ids": [
"<string>"
],
"content_start_time": "2023-11-07T05:31:56Z",
"content_end_time": "2023-11-07T05:31:56Z"
},
"enforce_concurrency_limits": true,
"priority": "<string>"
}
'import requests
url = "https://api.mottostreaming.com/streaming/video_protection/v1/rulesets"
payload = {
"project_id": "<string>",
"name": "<string>",
"geo_restrictions_disallow": { "country_codes": ["<string>"] },
"geo_restrictions_allow": { "country_codes": ["<string>"] },
"disallow_vpn_usage": True,
"disallow_hotlinking": True,
"allowed_domains": ["<string>"],
"require_authentication": True,
"disabled": True,
"require_entitlement": True,
"geo_applicability_exempt": { "country_codes": ["<string>"] },
"geo_applicability_apply": { "country_codes": ["<string>"] },
"applies_to_all": True,
"target": {
"entity_ids": ["<string>"],
"event_ids": ["<string>"],
"creative_work_ids": ["<string>"],
"content_start_time": "2023-11-07T05:31:56Z",
"content_end_time": "2023-11-07T05:31:56Z"
},
"enforce_concurrency_limits": True,
"priority": "<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({
project_id: '<string>',
name: '<string>',
geo_restrictions_disallow: {country_codes: ['<string>']},
geo_restrictions_allow: {country_codes: ['<string>']},
disallow_vpn_usage: true,
disallow_hotlinking: true,
allowed_domains: ['<string>'],
require_authentication: true,
disabled: true,
require_entitlement: true,
geo_applicability_exempt: {country_codes: ['<string>']},
geo_applicability_apply: {country_codes: ['<string>']},
applies_to_all: true,
target: {
entity_ids: ['<string>'],
event_ids: ['<string>'],
creative_work_ids: ['<string>'],
content_start_time: '2023-11-07T05:31:56Z',
content_end_time: '2023-11-07T05:31:56Z'
},
enforce_concurrency_limits: true,
priority: '<string>'
})
};
fetch('https://api.mottostreaming.com/streaming/video_protection/v1/rulesets', 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/video_protection/v1/rulesets",
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([
'project_id' => '<string>',
'name' => '<string>',
'geo_restrictions_disallow' => [
'country_codes' => [
'<string>'
]
],
'geo_restrictions_allow' => [
'country_codes' => [
'<string>'
]
],
'disallow_vpn_usage' => true,
'disallow_hotlinking' => true,
'allowed_domains' => [
'<string>'
],
'require_authentication' => true,
'disabled' => true,
'require_entitlement' => true,
'geo_applicability_exempt' => [
'country_codes' => [
'<string>'
]
],
'geo_applicability_apply' => [
'country_codes' => [
'<string>'
]
],
'applies_to_all' => true,
'target' => [
'entity_ids' => [
'<string>'
],
'event_ids' => [
'<string>'
],
'creative_work_ids' => [
'<string>'
],
'content_start_time' => '2023-11-07T05:31:56Z',
'content_end_time' => '2023-11-07T05:31:56Z'
],
'enforce_concurrency_limits' => true,
'priority' => '<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/video_protection/v1/rulesets"
payload := strings.NewReader("{\n \"project_id\": \"<string>\",\n \"name\": \"<string>\",\n \"geo_restrictions_disallow\": {\n \"country_codes\": [\n \"<string>\"\n ]\n },\n \"geo_restrictions_allow\": {\n \"country_codes\": [\n \"<string>\"\n ]\n },\n \"disallow_vpn_usage\": true,\n \"disallow_hotlinking\": true,\n \"allowed_domains\": [\n \"<string>\"\n ],\n \"require_authentication\": true,\n \"disabled\": true,\n \"require_entitlement\": true,\n \"geo_applicability_exempt\": {\n \"country_codes\": [\n \"<string>\"\n ]\n },\n \"geo_applicability_apply\": {\n \"country_codes\": [\n \"<string>\"\n ]\n },\n \"applies_to_all\": true,\n \"target\": {\n \"entity_ids\": [\n \"<string>\"\n ],\n \"event_ids\": [\n \"<string>\"\n ],\n \"creative_work_ids\": [\n \"<string>\"\n ],\n \"content_start_time\": \"2023-11-07T05:31:56Z\",\n \"content_end_time\": \"2023-11-07T05:31:56Z\"\n },\n \"enforce_concurrency_limits\": true,\n \"priority\": \"<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/video_protection/v1/rulesets")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"project_id\": \"<string>\",\n \"name\": \"<string>\",\n \"geo_restrictions_disallow\": {\n \"country_codes\": [\n \"<string>\"\n ]\n },\n \"geo_restrictions_allow\": {\n \"country_codes\": [\n \"<string>\"\n ]\n },\n \"disallow_vpn_usage\": true,\n \"disallow_hotlinking\": true,\n \"allowed_domains\": [\n \"<string>\"\n ],\n \"require_authentication\": true,\n \"disabled\": true,\n \"require_entitlement\": true,\n \"geo_applicability_exempt\": {\n \"country_codes\": [\n \"<string>\"\n ]\n },\n \"geo_applicability_apply\": {\n \"country_codes\": [\n \"<string>\"\n ]\n },\n \"applies_to_all\": true,\n \"target\": {\n \"entity_ids\": [\n \"<string>\"\n ],\n \"event_ids\": [\n \"<string>\"\n ],\n \"creative_work_ids\": [\n \"<string>\"\n ],\n \"content_start_time\": \"2023-11-07T05:31:56Z\",\n \"content_end_time\": \"2023-11-07T05:31:56Z\"\n },\n \"enforce_concurrency_limits\": true,\n \"priority\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mottostreaming.com/streaming/video_protection/v1/rulesets")
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 \"project_id\": \"<string>\",\n \"name\": \"<string>\",\n \"geo_restrictions_disallow\": {\n \"country_codes\": [\n \"<string>\"\n ]\n },\n \"geo_restrictions_allow\": {\n \"country_codes\": [\n \"<string>\"\n ]\n },\n \"disallow_vpn_usage\": true,\n \"disallow_hotlinking\": true,\n \"allowed_domains\": [\n \"<string>\"\n ],\n \"require_authentication\": true,\n \"disabled\": true,\n \"require_entitlement\": true,\n \"geo_applicability_exempt\": {\n \"country_codes\": [\n \"<string>\"\n ]\n },\n \"geo_applicability_apply\": {\n \"country_codes\": [\n \"<string>\"\n ]\n },\n \"applies_to_all\": true,\n \"target\": {\n \"entity_ids\": [\n \"<string>\"\n ],\n \"event_ids\": [\n \"<string>\"\n ],\n \"creative_work_ids\": [\n \"<string>\"\n ],\n \"content_start_time\": \"2023-11-07T05:31:56Z\",\n \"content_end_time\": \"2023-11-07T05:31:56Z\"\n },\n \"enforce_concurrency_limits\": true,\n \"priority\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"video_protection_ruleset": {
"project_id": "<string>",
"name": "<string>",
"id": "<string>",
"geo_restrictions_disallow": {
"country_codes": [
"<string>"
]
},
"geo_restrictions_allow": {
"country_codes": [
"<string>"
]
},
"disallow_vpn_usage": true,
"disallow_hotlinking": true,
"allowed_domains": [
"<string>"
],
"require_authentication": true,
"disabled": true,
"require_entitlement": true,
"geo_applicability_exempt": {
"country_codes": [
"<string>"
]
},
"geo_applicability_apply": {
"country_codes": [
"<string>"
]
},
"applies_to_all": true,
"target": {
"entity_ids": [
"<string>"
],
"event_ids": [
"<string>"
],
"creative_work_ids": [
"<string>"
],
"content_start_time": "2023-11-07T05:31:56Z",
"content_end_time": "2023-11-07T05:31:56Z"
},
"drm": {
"enabled": true,
"hws_minimum_quality": 123,
"split_keys": true
},
"enforce_concurrency_limits": true,
"priority": "<string>"
}
}{
"code": 123,
"message": "<string>",
"details": [
{
"@type": "<string>"
}
]
}Create ruleset
CreateVideoProtectionRuleset
Creates new ruleset.
POST
/
streaming
/
video_protection
/
v1
/
rulesets
cURL
curl --request POST \
--url https://api.mottostreaming.com/streaming/video_protection/v1/rulesets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"project_id": "<string>",
"name": "<string>",
"geo_restrictions_disallow": {
"country_codes": [
"<string>"
]
},
"geo_restrictions_allow": {
"country_codes": [
"<string>"
]
},
"disallow_vpn_usage": true,
"disallow_hotlinking": true,
"allowed_domains": [
"<string>"
],
"require_authentication": true,
"disabled": true,
"require_entitlement": true,
"geo_applicability_exempt": {
"country_codes": [
"<string>"
]
},
"geo_applicability_apply": {
"country_codes": [
"<string>"
]
},
"applies_to_all": true,
"target": {
"entity_ids": [
"<string>"
],
"event_ids": [
"<string>"
],
"creative_work_ids": [
"<string>"
],
"content_start_time": "2023-11-07T05:31:56Z",
"content_end_time": "2023-11-07T05:31:56Z"
},
"enforce_concurrency_limits": true,
"priority": "<string>"
}
'import requests
url = "https://api.mottostreaming.com/streaming/video_protection/v1/rulesets"
payload = {
"project_id": "<string>",
"name": "<string>",
"geo_restrictions_disallow": { "country_codes": ["<string>"] },
"geo_restrictions_allow": { "country_codes": ["<string>"] },
"disallow_vpn_usage": True,
"disallow_hotlinking": True,
"allowed_domains": ["<string>"],
"require_authentication": True,
"disabled": True,
"require_entitlement": True,
"geo_applicability_exempt": { "country_codes": ["<string>"] },
"geo_applicability_apply": { "country_codes": ["<string>"] },
"applies_to_all": True,
"target": {
"entity_ids": ["<string>"],
"event_ids": ["<string>"],
"creative_work_ids": ["<string>"],
"content_start_time": "2023-11-07T05:31:56Z",
"content_end_time": "2023-11-07T05:31:56Z"
},
"enforce_concurrency_limits": True,
"priority": "<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({
project_id: '<string>',
name: '<string>',
geo_restrictions_disallow: {country_codes: ['<string>']},
geo_restrictions_allow: {country_codes: ['<string>']},
disallow_vpn_usage: true,
disallow_hotlinking: true,
allowed_domains: ['<string>'],
require_authentication: true,
disabled: true,
require_entitlement: true,
geo_applicability_exempt: {country_codes: ['<string>']},
geo_applicability_apply: {country_codes: ['<string>']},
applies_to_all: true,
target: {
entity_ids: ['<string>'],
event_ids: ['<string>'],
creative_work_ids: ['<string>'],
content_start_time: '2023-11-07T05:31:56Z',
content_end_time: '2023-11-07T05:31:56Z'
},
enforce_concurrency_limits: true,
priority: '<string>'
})
};
fetch('https://api.mottostreaming.com/streaming/video_protection/v1/rulesets', 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/video_protection/v1/rulesets",
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([
'project_id' => '<string>',
'name' => '<string>',
'geo_restrictions_disallow' => [
'country_codes' => [
'<string>'
]
],
'geo_restrictions_allow' => [
'country_codes' => [
'<string>'
]
],
'disallow_vpn_usage' => true,
'disallow_hotlinking' => true,
'allowed_domains' => [
'<string>'
],
'require_authentication' => true,
'disabled' => true,
'require_entitlement' => true,
'geo_applicability_exempt' => [
'country_codes' => [
'<string>'
]
],
'geo_applicability_apply' => [
'country_codes' => [
'<string>'
]
],
'applies_to_all' => true,
'target' => [
'entity_ids' => [
'<string>'
],
'event_ids' => [
'<string>'
],
'creative_work_ids' => [
'<string>'
],
'content_start_time' => '2023-11-07T05:31:56Z',
'content_end_time' => '2023-11-07T05:31:56Z'
],
'enforce_concurrency_limits' => true,
'priority' => '<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/video_protection/v1/rulesets"
payload := strings.NewReader("{\n \"project_id\": \"<string>\",\n \"name\": \"<string>\",\n \"geo_restrictions_disallow\": {\n \"country_codes\": [\n \"<string>\"\n ]\n },\n \"geo_restrictions_allow\": {\n \"country_codes\": [\n \"<string>\"\n ]\n },\n \"disallow_vpn_usage\": true,\n \"disallow_hotlinking\": true,\n \"allowed_domains\": [\n \"<string>\"\n ],\n \"require_authentication\": true,\n \"disabled\": true,\n \"require_entitlement\": true,\n \"geo_applicability_exempt\": {\n \"country_codes\": [\n \"<string>\"\n ]\n },\n \"geo_applicability_apply\": {\n \"country_codes\": [\n \"<string>\"\n ]\n },\n \"applies_to_all\": true,\n \"target\": {\n \"entity_ids\": [\n \"<string>\"\n ],\n \"event_ids\": [\n \"<string>\"\n ],\n \"creative_work_ids\": [\n \"<string>\"\n ],\n \"content_start_time\": \"2023-11-07T05:31:56Z\",\n \"content_end_time\": \"2023-11-07T05:31:56Z\"\n },\n \"enforce_concurrency_limits\": true,\n \"priority\": \"<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/video_protection/v1/rulesets")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"project_id\": \"<string>\",\n \"name\": \"<string>\",\n \"geo_restrictions_disallow\": {\n \"country_codes\": [\n \"<string>\"\n ]\n },\n \"geo_restrictions_allow\": {\n \"country_codes\": [\n \"<string>\"\n ]\n },\n \"disallow_vpn_usage\": true,\n \"disallow_hotlinking\": true,\n \"allowed_domains\": [\n \"<string>\"\n ],\n \"require_authentication\": true,\n \"disabled\": true,\n \"require_entitlement\": true,\n \"geo_applicability_exempt\": {\n \"country_codes\": [\n \"<string>\"\n ]\n },\n \"geo_applicability_apply\": {\n \"country_codes\": [\n \"<string>\"\n ]\n },\n \"applies_to_all\": true,\n \"target\": {\n \"entity_ids\": [\n \"<string>\"\n ],\n \"event_ids\": [\n \"<string>\"\n ],\n \"creative_work_ids\": [\n \"<string>\"\n ],\n \"content_start_time\": \"2023-11-07T05:31:56Z\",\n \"content_end_time\": \"2023-11-07T05:31:56Z\"\n },\n \"enforce_concurrency_limits\": true,\n \"priority\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mottostreaming.com/streaming/video_protection/v1/rulesets")
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 \"project_id\": \"<string>\",\n \"name\": \"<string>\",\n \"geo_restrictions_disallow\": {\n \"country_codes\": [\n \"<string>\"\n ]\n },\n \"geo_restrictions_allow\": {\n \"country_codes\": [\n \"<string>\"\n ]\n },\n \"disallow_vpn_usage\": true,\n \"disallow_hotlinking\": true,\n \"allowed_domains\": [\n \"<string>\"\n ],\n \"require_authentication\": true,\n \"disabled\": true,\n \"require_entitlement\": true,\n \"geo_applicability_exempt\": {\n \"country_codes\": [\n \"<string>\"\n ]\n },\n \"geo_applicability_apply\": {\n \"country_codes\": [\n \"<string>\"\n ]\n },\n \"applies_to_all\": true,\n \"target\": {\n \"entity_ids\": [\n \"<string>\"\n ],\n \"event_ids\": [\n \"<string>\"\n ],\n \"creative_work_ids\": [\n \"<string>\"\n ],\n \"content_start_time\": \"2023-11-07T05:31:56Z\",\n \"content_end_time\": \"2023-11-07T05:31:56Z\"\n },\n \"enforce_concurrency_limits\": true,\n \"priority\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"video_protection_ruleset": {
"project_id": "<string>",
"name": "<string>",
"id": "<string>",
"geo_restrictions_disallow": {
"country_codes": [
"<string>"
]
},
"geo_restrictions_allow": {
"country_codes": [
"<string>"
]
},
"disallow_vpn_usage": true,
"disallow_hotlinking": true,
"allowed_domains": [
"<string>"
],
"require_authentication": true,
"disabled": true,
"require_entitlement": true,
"geo_applicability_exempt": {
"country_codes": [
"<string>"
]
},
"geo_applicability_apply": {
"country_codes": [
"<string>"
]
},
"applies_to_all": true,
"target": {
"entity_ids": [
"<string>"
],
"event_ids": [
"<string>"
],
"creative_work_ids": [
"<string>"
],
"content_start_time": "2023-11-07T05:31:56Z",
"content_end_time": "2023-11-07T05:31:56Z"
},
"drm": {
"enabled": true,
"hws_minimum_quality": 123,
"split_keys": true
},
"enforce_concurrency_limits": true,
"priority": "<string>"
}
}{
"code": 123,
"message": "<string>",
"details": [
{
"@type": "<string>"
}
]
}Authorizations
Body
application/json
A list of domains that are allowed to playback the video. An empty list implies all domains are valid. This uses the HTTP referrer, which can be spoofed and as such is not a strong protection mechanism.
Note: this uses the HTTP referrer. As native apps do not send any HTTP referrer, any client that does not send a referrer will be allowed.
Instruct the Motto content-delivery API to do an entitlement lookup for the user ID that the viewer is providing in
a JWT when trying to access the content.
This works in tandem with the Entitlement and Offer types in Motto's monetization section.
Note: This requires require_authentication to be set to true.

