Creates a live channel.
Request
Request syntax:
POST /channels
Request body parameters:
Pass the following request body parameters:
Name | Data Type | Description |
---|---|---|
desc Required | String | Defines the live channel's name. |
external_id | String | Sets the live channel's external ID. |
slicer_id | String | Identifies the live channel's Live Slicer by its case-sensitive ID. Default value: Omitting this property sets it to the live channel's system-defined ID. |
use_chsched | Integer | Determines whether the live channel supports schedule entries. Valid values are: 1: Disabled 2: Enabled A live channel's support for schedule entries is determined upon its creation. After which, you may not modify this property. Default value: 1 |
Response
The response for a successful request contains the following properties:
Name | Data Type | Description |
---|---|---|
@id | String | Indicates the relative path to an endpoint that returns this live channel. |
@type | String | Returns Channel. |
ad_slate | String | Indicates the asset that will be served for the live channel's ad slate by its system-defined ID (i.e., asset IDThis unique ID identifies an asset. View this ID by navigating to the Content tab, selecting the desired asset, and then viewing the GUID option from the Details tab.). |
blackout_slate | String | Indicates the asset that will be served for the live channel's blackout slate by its system-defined ID (i.e., asset IDThis unique ID identifies an asset. View this ID by navigating to the Content tab, selecting the desired asset, and then viewing the GUID option from the Details tab.). You may not use blackout with live channels that can leverage schedule entries. |
created | String | Indicates the timestamp (UTC) at which the live channel was created. Syntax (ISO 8601): YYYY-MM-DDThh:mm:ss.sssZ |
dash_url | String | Indicates the live channel's DASH playback URL. |
desc | String | Indicates the live channel's name. |
embed_domains | String | Indicates a comma-separated list of domains on which the live channel's embedded HTML5 player (embed_html5_player_url) may be hosted. Set this property to an empty value to authorize playback on any domain. Use an * as a wildcard character. Example: *.example.com,[www.example.org,www.example.\](http://www.example.org,www.example.\)\* |
embed_html5_player_url | String | Indicates the URL for the live channel's embedded HTML5 player. |
external_id | String | Indicates the live channel's external ID. |
hls_url | String | Indicates the live channel's HLS playback URL. |
id | String | Identifies this live channel by its system-defined ID. |
meta | Dictionary | Contains the live channel's metadata fields. Each field is a key-value pair with the following syntax: 'Field Name': 'Field Value' |
missing_content_slate | String | Indicates the asset that will be served for missing content slate by its system-defined ID (i.e., asset IDThis unique ID identifies an asset. View this ID by navigating to the Content tab, selecting the desired asset, and then viewing the GUID option from the Details tab.). |
override | Dictionary | use_chsched = 2 Only Indicates whether a live channel's source is being overridden. This property returns an empty dictionary when the live channel's source is not being overridden. |
override_slicer_id | String | The behavior of this property varies according to whether schedule entry support has been enabled on this live channel. Enabled (use_chsched = 2): This property has undergone end-of-life and therefore will not be included in the response. Disabled (use_chsched = 1): Indicates the ID of the Live Slicer that is currently overriding the live channel's source as a result of the /api2/channel/override endpoint. This property returns an empty string when the live channel's source is not being overridden by a different Live Slicer. |
require_drm | Integer | Indicates whether playback requires a digital signature. Valid values are: 0: Digital signatures are ignored. 1: Playback requests require a digital signature. |
require_studio_drm | Integer | Indicates whether Studio DRM will be enforced on this live channel. Valid values are: 0: Disabled. 1: Studio DRM is enforced on all playback requests for this live channel. |
slicer_id | String | Indicates the live channel's Live Slicer by its case-sensitive ID. This property returns no_slicer when a Live Slicer has not been assigned to the live channel. |
test_players | List of dictionaries | Contains a list of restriction-free players through which you may test your live channel's feed. |
thumb_url | String | Indicates the URL to a live channel's thumbnail preview image. |
use_chsched | Integer | Indicates whether the live channel supports schedule entries. Valid values are: 1: Disabled 2: Enabled A live channel's support for schedule entries is determined upon its creation. After which, you may not modify this property. |
override Dictionary
The override dictionary contains the following properties when you are overriding the live channel's source:
Name | Data Type | Description |
---|---|---|
id | String | Identifies a Live Slicer by its case-sensitive ID. |
start | String | Indicates the timestamp at which a live channel's source was overridden by the Live Slicer identified by the id property. Syntax: YYYY-MM-DDThh:mm:ss.ffffffZ Learn more. |
type | String | Returns slicer when a live channel's source is being manually overridden. |
test_players List
The test_players list describes each test player through the following properties:
Name | Data Type | Description |
---|---|---|
desc | String | Indicates the test player's name. |
id | String | Indicates the test player's system-defined ID. |
expire | String | Indicates the test player's expiration date in Unix time (milliseconds). |
params | String | Reserved for future use. |
whitelist | Boolean | Indicates whether the test player will be placed on an allowlist. |
url | String | Indicates the test player's URL. |
url_html5 | String | Indicates the test player's HTML5 URL. |
view | String | Reserved for internal use. |
Sample Request/Response
Call the add_live_channel module (Python 3) to create a live channel. This module imports names from the api_auth module.
import json, requests, datetime, time
from api_auth import APICredentials, APIParams
class LiveChannel:
def __init__(self):
self.host = "https://services.uplynk.com"
def run(self):
"""
Create a live channel.
"""
self._create_live_channel()
def _create_live_channel(self):
url = "{}{}".format(self.host, "/api/v4/channels")
payload = {
'desc': 'My New Live Channel', # Replace with the live channel's name.
'slicer_id': 'mySlicer1', # Replace with the desired Live Slicer ID.
'use_chsched': 2 # Enables scheduling.
}
headers = {'Content-Type': 'application/json'}
response = requests.post(
url, params=APIParams(APICredentials()).get_params({}), data=json.dumps(payload), headers=headers
)
print(response.json())
LiveChannel().run()
Response:
{
'@id': '/channels/a6aa35d4b523498aab7227ed9510c138',
'@type': 'Channel',
'id': 'a6aa35d4b523498aab7227ed9510c138',
'desc': 'My Live Channel',
'created': '2021-04-30T16:19:48.215Z',
'external_id': '',
'use_chsched': 2,
'ad_slate': '80292e78be6843fa8398827589748782',
'blackout_slate': '860cbd66462a43b799ce044e6045f63d',
'missing_content_slate': '48d8de0bdb0b4f2493310ad868525fb8',
'embed_domains': '',
'meta': {},
'thumb_url': '',
'slicer_id': 'MyLiveSlicer1',
'hls_url': 'https://content.uplynk.com/channel/a6aa35d4b523498aab7227ed9510c138.m3u8',
'dash_url': 'https://content.uplynk.com/channel/a6aa35d4b523498aab7227ed9510c138.mpd',
'test_players': [{
'desc': '5ExtMIB5AUzLtAAYvNF2NG',
'id': '5ExtMIB5AUzLtAAYvNF2NG',
'expire': None,
'params': '',
'whitelist': False,
'url': 'https://content.uplynk.com/player/5ExtMIB5AUzLtAAYvNF2NGsc.html',
'url_html5': 'https://content.uplynk.com/player5/5ExtMIB5AUzLtAAYvNF2NGsc.html'
}
],
'embed_html5_player_url': 'https://content.uplynk.com/player5/32jMLROxrcW8JNFJNglmIVec.html',
'require_drm': 1,
'require_studio_drm': 0
}