Publishing Rules
Publishing rules specify when and where your content can be played. With publishing rules, you can restrict your content to specific geographic regions, ensure that it is only embedded on specific domains, and only allow it to be viewed at specific times.
When your asset is loaded, it checks its publishing rule before playing. Each rule that you create can contain any combination of these restrictions and can be assigned to multiple videos or channels.
Add New Publishing Rule
[POST] /v2/publishing_rules
{
properties
}
List Publishing Rules
[GET] /v2/publishing_rules
Get Publishing Rule
[GET] /v2/publishing_rules/publishing_rule_id
Modify Publishing Rule
[PATCH] /v2/publishing_rules/publishing_rule_id { properties }
Delete Publishing Rule
[DELETE] /v2/publishing_rules/publishing_rule_id
Route Attributes
The following table describes all attributes that can be expressed through the route.
| Route Attribute | Description |
|---|---|
| publishing_rule_id |
The ID of the publishing rule. To get a list of publishing rules, perform a get against the /publishing_rules route. Type: String Default: None Example: /publishing_rules/ru1ze4ea4e648fd07d4509123254 |
Properties
The following table describes all properties that can be associated with a label.
| Attribute | Description | Required? |
|---|---|---|
| all_day |
Specifies whether the content can be played all day. Type: Boolean Valid Values: true | false Conditions: Required if type is set to "recurring" and start_time and end_time are not specified. Example: true Parent: time_restrictions |
Conditional |
| allowed_devices |
Specifies allowed devices. Type: Array Valid Values: iphone | ipad | android | blackberry Default: All devices are allowed Example: ["iphone", "ipad" ] |
No |
| domain_restrictions |
Specifies domain restrictions. Type: Container |
|
| domains |
Specifies one or more domains to whitelist or blacklist. Type: Array of Strings Conditions: Required if domain_restrictions are specified. Example: ["mydomain.com", "myotherdomain.com"] Parent: domain_restrictions |
Conditional |
| enabled | Enables or disbles the requirement for the Ooyala Playback Token Type: String Valid Values true | false Example: "secure_playback_token": {
"enabled": "true"
}
Parent:
secure_playback_token |
No |
| end_date |
Specifies the end of the time restriction. Type: DateTime Valid Values: DateTime | null Conditions: Required if time_restrictions are specified. Example: "2010-01-01T00:00:00Z" Parent: time_restrictions |
Conditional |
| end_time |
Specifies the end time when the content can be played. Type: Time Conditions: Required if type is set to "recurring" and all_day is not specified or set to false. Example: "23:59:59" Parent: time_restrictions |
Conditional |
| expiration | Time in seconds before the Ooyala Playback Token expires Type: Integer Parent: secure_playback_token |
|
| geographic_restrictions |
Specifies geographic restrictions. Type: Container |
|
| locations |
Array that specifies one or more two-letter location codes to whitelist or blacklist. Type: String Valid Values: See Publishing Rule Location Codes. Conditions: Required if geographic_restrictions are specified. Example: ["US", "EU"] Parent: geographic_restrictions |
Conditional |
| name |
Specifies the name of the publishing rule. Type: String Example: "My Rule" |
Yes |
| recurring_days |
Specifies valid days. Type: Array of Strings Valid Values: "MON" | "TUE" | "WED" | "THU" | "FRI" | "SAT" | "SUN" Conditions: Required if type is set to "recurring". Example: ["MON", "WED", "FRI"] Parent: time_restrictions |
Conditional |
| require_user_entitlement | Require user to have been entitled to access assets, or not. Enables Rights
Locker. Type: String Valid Values: true | false Example: "secure_playback_token": {
"require_user_entitlement": "true"
}
Parent: secure_playback_token |
No |
| restrict_concurrent_streams | Enforce limit on number of concurrent streams, or not. Enables player
Authorization API. Type: String Valid Values: true | false Example: "secure_playback_token": {
"restrict_concurrent_streams": "true"
}
Parent: secure_playback_token |
No |
| secure_playback_token | Properties related to requiring or not requiring user authorization for
playback via the Ooyala Player Token Type: Container |
No |
| start_date |
Specifies the start of the time restriction. Type: DateTime Valid Values: DateTime | null Conditions: Required if time_restrictions are specified. Example: "2010-01-01T00:00:00Z" Parent: time_restrictions |
Conditional |
| start_time |
Specifies the start time when the content can be played. Type: Time Conditions: Required if type is set to "recurring" and all_day is not specified or set to false. Example: "20:00:00" Parent: time_restrictions |
Conditional |
| time_restrictions | Specifies time restrictions. Type: Container | |
| type |
Specifies whether the locations are whitelisted or blacklisted. Type: String Valid Values: whitelist | blacklist Conditions: Required if geographic_restrictions are specified. Example: "whitelist" Parent: geographic_restrictions |
Conditional |
| type |
Specifies whether the domains are whitelisted or blacklisted. Type: String Valid Values: whitelist | blacklist Conditions: Required if domain_restrictions are specified. Example: "whitelist" Parent: domain_restrictions |
Conditional |
| type |
Specifies whether the time restriction is a recurring or one-time restriction. Type: String Valid Values: range | recurring Conditions: Required if time_restrictions are specified. Example: "range" Parent: time_restrictions |
Conditional |
Examples
This example creates a basic publishing rule with no restrictions:
[POST] /v2/publishing_rules
{
"name": "My Basic Publishing Rule"
}
Backlot returns a response similar to the following:
{
"name": "My Basic Publishing Rule",
"allowed_devices": [
"iphone",
"ipad",
"android",
"blackberry"
],
"time_restrictions": {
"start_date": null,
"type": "range",
"end_date": null
},
"domain_restrictions": {
"domains": [
],
"type": "blacklist"
},
"geographic_restrictions": {
"type": "blacklist",
"locations": [
]
},
"id": "9b70a34a678346b185f9b81c7a291d8b"
}
This example modifies a publishing rule to only allow the content to be embedded on mywebsite.com and only be viewed in the US or EU:
[POST] /v2/publishing_rules/9b70a34a678346b185f9b81c7a291d8b
{
"domain_restrictions": {
"domains": [
"mywebsite.com"
],
"type": "whitelist"
},
"geographic_restrictions": {
"type": "whitelist",
"locations": [
"US",
"EU"
]
}
}
Backlot returns a response similar to the following:
{
"name": "My Publishing Rule",
"allowed_devices": [
],
"time_restrictions": {
"start_date": "2007-04-05T00:00:00+00:00",
"type": "range",
"end_date": null
},
"domain_restrictions": {
"domains": [
"mywebsite.com"
],
"type": "whitelist"
},
"geographic_restrictions": {
"type": "whitelist",
"locations": [
"US",
"EU"
]
},
"id": "79feefbe24d9424786d53b5edffb4b94"
}
This example lists all publishing rules:
[GET] /v2/publishing_rules
Backlot returns configuration settings for all publishing rules.
This example information about a specific publishing rule:
[GET] /v2/publishing_rules/79feefbe24d9424786d53b5edffb4b94
Backlot returns a response similar to the following:
{
"name": "My Publishing Rule",
"allowed_devices": [
],
"time_restrictions": {
"start_date": "2007-04-05T00:00:00+00:00",
"type": "range",
"end_date": null
},
"domain_restrictions": {
"domains": [
"mywebsite.com"
],
"type": "whitelist"
},
"geographic_restrictions": {
"type": "whitelist",
"locations": [
"US",
"EU"
]
},
"id": "79feefbe24d9424786d53b5edffb4b94"
}
This example deletes a label:
[DELETE] /v2/publishing_rules/79feefbe24d9424786d53b5edffb4b94
Backlot returns a 200 response.
Documentation
- Welcome
- Backlot Getting Started Guide
- Planning and Setup Guide
- Ooyala Ingestion Guide
- Player Developer Guide
- Core Platform Developer Guide
- Discovery Developer Guide
- Content Protection Developer Guide
- Backlot API Reference
- Player API Reference
- Rights Locker API Reference
- General Reference
- Glossary
- Archive
- Release Notes
