Get Started
Studio API
- Introduction
- Streaming
- Live Streams
- Simulcasts
- Clips
- Videos
- Video Protection
- Configurations
- Assets
- CMS
- OTT
- Monetization
- IAM
- Integration
- Analytics
Content Delivery API
Deep dive
Update ruleset
UpdateVideoProtectionRuleset
Updates a video_protection_ruleset. When updating a ruleset that is already attached to one or more videos, this change will apply to all of those videos (including past ones).
These changes apply asynchronously and may take a bit of time to propagate.
curl --request PATCH \
--url https://api.mottostreaming.com/streaming/video_protection/v1/rulesets/{video_protection_ruleset_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"video_protection_ruleset_id": "<string>",
"video_protection_ruleset": {
"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"
},
"priority": "<string>"
},
"update_mask": "<string>"
}'
{
"video_protection_ruleset": {
"id": "<string>",
"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"
},
"priority": "<string>"
}
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Path Parameters
Body
The ID of the project that the VideoProtectionRuleset belongs to.
Name of the Ruleset
Viewers are disallowed to consume the video from these countries (and allowed from all others)
A country code (ISO 3316-1 alpha-2: https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes)
Viewers are allowed to consume the video from these countries (and disallowed from all others)
A country code (ISO 3316-1 alpha-2: https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes)
Disallow viewers from using a VPN to consume the video
Disallow viewers from sharing a playlist URL with others (i.e. hotlink protection). This is done by binding the viewer's IP address to the playlist URL.
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.
Require viewers to be signed in. This requires the viewer to have a valid JWT, signed by the Motto identity service. The JWT should be passed either via the Authorization header or as a Cookie.
Disables the ruleset. This is useful for ensuring the ruleset no longer shows up as an option in the UI. It will continue to apply to any videos that already have this ruleseet applied (unlike a deleted ruleset).
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
.
Viewers from these countries will not have this ruleset applied.
A country code (ISO 3316-1 alpha-2: https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes)
Viewers from these countries will have this ruleset applied.
A country code (ISO 3316-1 alpha-2: https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes)
This ruleset applies to all videos in the project.
This ruleset applies to a specific set of videos, as defined by the target.
The entities with which this ruleset is associated. If provided, all videos that are associated with these entities will be included in the ruleset.
The events with which this ruleset is associated. If provided, all videos that are associated with these events will be included in the ruleset.
The creative works with which this ruleset is associated. If provided, all videos that are associated with these creative works will be included in the ruleset.
Any content defined by entity_ids
, event_ids
and creative_work_ids
after content_start_time
will be considered as part of the ruleset (as long as it is before content_end_time
).
If not provided, there is no lower time bound on the content.
Any content defined by entity_ids
, event_ids
and creative_work_ids
before content_end_time
will be considered as part of the ruleset (as long as it is after content_start_time
).
If not provided, there is no upper time bound on the content.
The priority of the ruleset. If multiple rulesets apply to a video, the ruleset with the highest priority will be used.
Response
The ID of the project that the VideoProtectionRuleset belongs to.
Name of the Ruleset
Viewers are disallowed to consume the video from these countries (and allowed from all others)
A country code (ISO 3316-1 alpha-2: https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes)
Viewers are allowed to consume the video from these countries (and disallowed from all others)
A country code (ISO 3316-1 alpha-2: https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes)
Disallow viewers from using a VPN to consume the video
Disallow viewers from sharing a playlist URL with others (i.e. hotlink protection). This is done by binding the viewer's IP address to the playlist URL.
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.
Require viewers to be signed in. This requires the viewer to have a valid JWT, signed by the Motto identity service. The JWT should be passed either via the Authorization header or as a Cookie.
Disables the ruleset. This is useful for ensuring the ruleset no longer shows up as an option in the UI. It will continue to apply to any videos that already have this ruleseet applied (unlike a deleted ruleset).
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
.
Viewers from these countries will not have this ruleset applied.
A country code (ISO 3316-1 alpha-2: https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes)
Viewers from these countries will have this ruleset applied.
A country code (ISO 3316-1 alpha-2: https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes)
This ruleset applies to all videos in the project.
This ruleset applies to a specific set of videos, as defined by the target.
The entities with which this ruleset is associated. If provided, all videos that are associated with these entities will be included in the ruleset.
The events with which this ruleset is associated. If provided, all videos that are associated with these events will be included in the ruleset.
The creative works with which this ruleset is associated. If provided, all videos that are associated with these creative works will be included in the ruleset.
Any content defined by entity_ids
, event_ids
and creative_work_ids
after content_start_time
will be considered as part of the ruleset (as long as it is before content_end_time
).
If not provided, there is no lower time bound on the content.
Any content defined by entity_ids
, event_ids
and creative_work_ids
before content_end_time
will be considered as part of the ruleset (as long as it is after content_start_time
).
If not provided, there is no upper time bound on the content.
The priority of the ruleset. If multiple rulesets apply to a video, the ruleset with the highest priority will be used.
curl --request PATCH \
--url https://api.mottostreaming.com/streaming/video_protection/v1/rulesets/{video_protection_ruleset_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"video_protection_ruleset_id": "<string>",
"video_protection_ruleset": {
"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"
},
"priority": "<string>"
},
"update_mask": "<string>"
}'
{
"video_protection_ruleset": {
"id": "<string>",
"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"
},
"priority": "<string>"
}
}