Retrieves a blackout configuration associated with a live channel.
Request
Request syntax:
GET /channels/Live Channel ID/blackouts/Blackout ID
Define the following variables when submitting the above request:
VariableA variable represents a value that must be replaced. A variable consists of either a URL segment (e.g., "0001" in /0001/) or a query string value (e.g., "3" in mediaTypes=3). | Description |
---|---|
Live Channel ID Required | Identifies a live channel by its system-defined ID. |
Blackout ID Required | Identifies a blackout configuration by its system-defined or external ID. Use the Get Multiple Blackouts endpoint to retrieve a list of blackout configurations and their IDs. |
Response
A successful request returns a 200 OK response that contains the following properties:
Name | Data Type | Description |
---|---|---|
@id | String | Indicates the relative path to an endpoint that returns this blackout configuration. |
@included | List of dictionaries | Contains the blackout rule associated with this blackout configuration. |
@type | String | Returns Blackout. |
blackout_id | String | Indicates the blackout ID that identifies programming that should be blacked out. Learn how to tag programming with a blackout ID. |
channel | String | Indicates the system-defined ID for the live channel associated with this blackout configuration. |
desc | String | Indicates the name of the blackout configuration. |
external_id | String | Indicates the external ID associated with this blackout configuration. |
id | String | Identifies this blackout configuration by its system-defined ID. |
owner | String | Indicates the system-defined ID for the user that owns this blackout configuration. |
rules | List of string values | Contains the set of blackout rules associated with this blackout configuration. These rules identify audience(s) and the alternate content that should be streamed when programming has been tagged with the blackout ID defined within the blackout_id parameter. Each value identifies a blackout rule by its system-defined ID. |
@included List
The @included list describes the blackout rule associated with this blackout configuration via the following properties:
Name | Data Type | Description | |||
---|---|---|---|---|---|
@id | String | Indicates the relative path to an endpoint that returns this rule. | |||
@type | String | Returns Rule. | |||
all_viewers | Boolean | Indicates whether this rule applies to all audiences. Default value: False | |||
alternate_content_id | String | Indicates the alternate content that will be streamed to blacked out viewers by its ID. The alternate_content_type parameter determines the type of ID defined within this parameter. alternate_content_type: asset Asset ID alternate_content_type: channel Live Channel ID alternate_content_type: slicer Live Slicer ID alternate_content_type: slate Conditional blackout slate will be streamed to blacked out viewers. This parameter should be an empty value. | |||
alternate_content_loop | Boolean | Indicates whether alternate content will be looped. Valid values are: True | False | ||
alternate_content_type | String | Indicates the type of alternate content that will be streamed to blacked out viewers. Valid case-sensitive values are: asset | channel | slate | slicer Identify alternate content through both the alternate_content_id and the alternate_content_type parameters. For example, specify a CMS asset by setting the alternate_content_type parameter to asset and the alternate_content_id parameter to the desired asset ID. |
audience | String | all_viewers: false Indicates an audience or superaudience by its system-defined ID. This rule will only be applied to the specified audience when the all_viewers parameter is set to False. | |||
created | String | Indicates the timestamp (UTC) at which the rule was created. Syntax (ISO 8601): YYYY-MM-DDThh:mm:ss.sssZ | |||
desc | String | Indicates the name of the rule. | |||
external_id | String | Indicates the external ID associated with this rule. | |||
id | String | Identifies this rule by its system-defined ID. | |||
owner | String | Indicates the system-defined ID for the user that owns this rule. |
Sample Request/Response
Call the get_blackout module (Python 3) to retrieve a blackout configuration. This module imports names from the api_auth module.
import json, requests
from api_auth import APICredentials, APIParams
channel_id = '02ed9f65570746528e7b3d0628960025' # Replace with the ID for the desired live channel.
blackout_id = 'f29106a8d8994dd7886c7f8aedab3b77' # Replace with the ID for the desired blackout configuration.
class Blackout:
def __init__(self):
self.host = "https://services.uplynk.com"
def run(self):
self._get_blackout()
def _get_blackout(self):
url = "{}{}{}{}{}".format(self.host, "/api/v4/channels/", channel_id, "/blackouts", blackout_id)
headers = {'Content-Type': 'application/json'}
response = requests.get(
url, params=APIParams(APICredentials()).get_params({}), headers=headers
)
print(response.json())
Blackout().run()
Response:
{
'@id': '/api/v4/channels/02ed9f65570746528e7b3d0628960025/blackouts/f29106a8d8994dd7886c7f8aedab3b77',
'@type': 'Blackout',
'@included': [{
'@id': '/api/v4/rules/c2eb5a555b9d45b7a43552f65a268075',
'@type': 'Rule',
'id': 'c2eb5a555b9d45b7a43552f65a268075',
'alternate_content_loop': True,
'owner': 'abc123def456ghi789jkl012mno345pq',
'alternate_content_type': 'asset',
'desc': 'My New Rule',
'all_viewers': True,
'created': '2019-07-30T17:54:56.290Z',
'alternate_content_id': '062048d702734ca6a38f3e7f8e4f4488',
'audience': '',
'external_id': ''
}
],
'id': 'f29106a8d8994dd7886c7f8aedab3b77',
'owner': 'abc123def456ghi789jkl012mno345pq',
'channel': '02ed9f65570746528e7b3d0628960025',
'blackout_id': 'BNA',
'desc': 'Blackout North America',
'external_id': '',
'rules': ['c2eb5a555b9d45b7a43552f65a268075']
}