Virtual Linear Playlist (Smartstart) API

The Virtual Linear Playlist API, which is a versioned API, administers virtual linear playlists that may consist of one or more assets.

It supports the following endpoints:

Endpoint Description

Bulk Smartstart

POST /smart-start

Enable Smartstart on one or more asset(s). Smartstart improves player startup times for assets that require server-side ad insertion.

Create Virtual Linear Playlist

POST /linear-playlist
Creates a virtual linear playlist that contains one or more asset(s).

Delete Virtual Linear Playlist

DELETE /linear-playlist/Playlist ID
Deletes a virtual linear playlist.

Get All Virtual Linear Playlists

GET /linear-playlist
Retrieves a list of your virtual linear playlists.

Get Virtual Linear Playlist

GET /linear-playlist/Playlist ID
Retrieves a specific virtual linear playlist.

Update Virtual Linear Playlist

PATCH /linear-playlist/Playlist ID

Updates a virtual linear playlist.

Base URL

Use the following base URL:

https://services.uplynk.com/api/v4

Bulk Smartstart

Enable Smartstart on one or more asset(s). Smartstart improves player startup times for assets that require server-side ad insertion.

Key information:

Request

Request syntax:

POST /smart-start

Request body parameters:

Pass the following request body parameters:

Name

Data Type

Description

active

Integer

Determines the status for each playlist. Valid values are:

  • 0: Inactive
  • 1: Active

Default value: 

1

ad_slate_fill

Integer

Determines whether ad breaks with insufficient ads will be filled with ad slate. Valid values are:

  • 0: Disables ad slate and returns back to content.
  • 1: Enables ad slate.

Default value: 

0

assets

Required

List

Contains a list of asset IDsThis 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.. The system creates a virtual linear playlist for each specified asset. Each virtual linear playlist's system-defined ID will match its asset's system-defined ID (i.e., asset ID).

beam_break_duration

Integer

Determines whether ad breaks defined within an asset are honored and their duration. Valid values are:

  • 0: Ad breaks are ignored.
  • #: Sets the duration, in seconds, for all ad breaks.

Default value: 

0

desc

String

Sets the virtual linear playlist's description.

repeat

Integer

Determines the number of times that the playlist will be repeated. Valid values are:

  • 0: The playlist will not repeat.
  • -1: The playlist will repeat indefinitely.
  • #: The playlist will repeat the specified number of times.

Default value: 

0

skip_drm

Integer

Determines whether playback of the virtual linear playlist requires a digital signature. Valid values are:

  • 0: Playback requires a digital signature.
  • 1: Playback is allowed without a digital signature.

This property takes precedence over an asset's Require a token for playback setting.

Default value: 

0

studio_drm_required

Integer

Determines whether playback of the virtual linear playlist will be secured via Studio DRM. Valid values are:

  • 0: Playback is not secured by Studio DRM.
  • 1: Playback is secured via DRM.

This property takes precedence over an asset's Require studio approved DRM for playback setting.

Default value: 

0

Response

The response for a successful request contains the following properties:

Name

Data Type

Description

@id

String

Indicates the relative path to this endpoint.

@type

String

Returns SmartStart.

ss_created

List

Contains a list of the virtual linear playlists that were created. Each virtual linear playlist is identified by its system-defined ID.

Each virtual linear playlist's system-defined ID will match its asset's system-defined ID (i.e., asset ID).

ss_not_created

List

Contains a list of virtual linear playlists that were not created because they are duplicates of an existing virtual linear playlist.

ss_errored

List

Contains a list of virtual linear playlists that were not created due to an error.

Sample Request/Response

Call the bulk_virtual_linear_playlists module (Python 3) to create virtual linear playlists in bulk. This module imports names from the api_auth module.

import json
import requests
from api_auth import APICredentials, APIParams
  
class Smartstart:
    def __init__(self):
        self.host = "https://services.uplynk.com"
  
    def run(self):
        self._bulk_virtual_linear_playlist()
 
    def _bulk_virtual_linear_playlist(self):
        url = "{}{}".format(self.host, "/api/v4/smart-start")
 
        description = 'Sample Playlist' # Brief description for the new playlists.
        repeat = -1 # Repeats playlists indefinitely.
        beam_break_duration = 30 # Sets 30 second ad breaks.
        assets = [
            'a404b63430a7437a99995d3285a48be1',
            '4a702cd463db4a94a90c1ea4bf9f3102',
            'da2861de60484b6eb01e8372f069ecc3'
        ] # Replace with the desired asset IDs.

        payload = {
            'desc': description,
            'repeat': repeat,
            'beam_break_duration': beam_break_duration,
            'assets': assets
        }
 
        headers = {'Content-Type': 'application/json'}
 
        response = requests.post(
            url, params=APIParams(APICredentials()).get_params({}), data=json.dumps(payload), headers=headers
        )
 
        print(response.json())
  
Smartstart().run()

Response:

{
	'@id': '/api/v4/smart-start',
	'@type': 'SmartStart',
	'ss_created': ['a404b63430a7437a99995d3285a48be1', '4a702cd463db4a94a90c1ea4bf9f3102', 'da2861de60484b6eb01e8372f069ecc3']
}

Create Virtual Linear Playlist

Creates a virtual linear playlist that contains one or more asset(s). Use a playlist to provide a virtual linear playback experience for assets.

Restrict a virtual linear playlist to assets that have been encoded with the same codec (i.e., AVC or HEVC).

Use the Bulk Smartstart endpoint to create a virtual linear experience for a single asset.

Request

Request syntax:

POST /linear-playlist

Request body parameters:

Pass the following request body parameters:

Name

Data Type

Description

active

Integer

Determines the playlist's status. Valid values are:

  • 0: Inactive
  • 1: Active

Default value: 

1

ad_slate_fill

Integer

Determines whether ad breaks with insufficient ads will be filled with ad slate. Valid values are:

  • 0: Disables ad slate and returns back to content.
  • 1: Enables ad slate.

Default value: 

0

beam_break_duration

Integer

Determines whether ad breaks defined within an asset are honored and their duration. Valid values are:

  • 0: Ad breaks are ignored.
  • #: Sets the duration, in seconds, for all ad breaks.

Default value: 

0

desc

String

Sets the virtual linear playlist's description.

playlist

Required

List

Contains an ordered list of assets and ad breaks.

A virtual linear playlist supports up to 100 assets.

repeat

Integer

Determines the number of times that the playlist will be repeated. Valid values are:

  • 0: The playlist will not repeat.
  • -1: The playlist will repeat indefinitely.
  • #: The playlist will repeat the specified number of times.

Default value: 

0

skip_drm

Integer

Determines whether playback of the virtual linear playlist requires a digital signature. Valid values are:

  • 0: Playback requires a digital signature.
  • 1: Playback is allowed without a digital signature.

This property takes precedence over an asset's Require a token for playback setting.

Default value: 

0

studio_drm_required

Integer

Determines whether playback of the virtual linear playlist will be secured via Studio DRM. Valid values are:

  • 0: Playback is not secured by Studio DRM.
  • 1: Playback is secured via DRM.

This property takes precedence over an asset's Require studio approved DRM for playback setting.

Default value: 

0

playlist List

The playlist list defines a virtual linear playlist via the following properties:

Name

Data Type

Description

beam

Required

Dictionary

Contains an id property.

id

Required

String

beam dictionary

Indicates the system-defined ID for the asset that will be added to the virtual linear playlist.

ad

Dictionary

Contains a dur property.

dur

Integer

ad dictionary

Indicates the duration, in seconds, for an ad break that occurs immediately after the asset defined within the beam dictionary.

Authentication

Pass a digital signature based off of msg.

Learn more.

Response

The response for a successful request contains the following properties:

Name

Data Type

Description

@id

String

Indicates the relative path to this endpoint.

@type

String

Returns LinearPlaylist.

active

Integer

Indicates the playlist's status. Valid values are:

  • 0: Inactive
  • 1: Active

ad_slate_fill

Integer

Indicates whether ad breaks with insufficient ads will be filled with ad slate. Valid values are:

  • 0: Disables ad slate and returns back to content.
  • 1: Enables ad slate.

beam_break_duration

Integer

Indicates whether ad breaks defined within an asset are honored and their duration. Valid values are:

  • 0: Ad breaks are ignored.
  • #: Sets the duration, in seconds, for all ad breaks.

desc

String

Indicates the virtual linear playlist's description.

id

String

Indicates the virtual linear playlist system-defined ID.

playlist

List

Contains an ordered list of assets and ad breaks.

A virtual linear playlist supports up to 100 assets.

profile

String

Reserved for future use.

repeat

Integer

Indicates the number of times that the playlist will be repeated. Valid values are:

  • 0: The playlist will not repeat.
  • -1: The playlist will repeat indefinitely.
  • #: The playlist will repeat the specified number of times.

skip_drm

Integer

Determines whether playback of the virtual linear playlist requires a digital signature. Valid values are:

  • 0: Playback requires a digital signature.
  • 1: Playback is allowed without a digital signature.

This property takes precedence over an asset's Require a token for playback setting.

studio_drm_required

Integer

Determines whether playback of the virtual linear playlist will be secured via Studio DRM. Valid values are:

  • 0: Playback is not secured by Studio DRM.
  • 1: Playback is secured via DRM.

This property takes precedence over an asset's Require studio approved DRM for playback setting.

playlist List

The playlist list defines a virtual linear playlist via the following properties:

Name

Data Type

Description

beam

Dictionary

Contains an id property.

id

String

beam dictionary

Indicates the system-defined ID for the asset that will be added to the virtual linear playlist.

ad

Dictionary

Contains a dur property.

dur

Integer

ad dictionary

Indicates the duration, in seconds, for an ad break that occurs immediately after the asset defined within the beam dictionary.

Sample Request/Response

Call the create_virtual_linear_playlist module (Python 3) to create a virtual linear playlist. This module imports names from the api_auth module.

import requests
from api_auth import APICredentials, APIParams
  
class Create_VLP:
    def __init__(self):
        self.host = "https://services.uplynk.com"
  
    def run(self):
        self._create_virtual_linear_playlist()
 
    def _create_virtual_linear_playlist(self):
        url = "{}{}".format(self.host, "/api/v4/linear-playlist")
 
        description = 'Sample Playlist' # Brief description of the playlist.
        repeat = -1 # Repeats the playlist indefinitely.
        beam_break_duration = 30 # Sets 30 second ad breaks.
        playlist = [{
                'beam':{
                    'id':'abc123456defghi789jklmno012345pq'  # Asset ID
                }
            }, {
                'ad':{
                    'dur': 20 # Sets 20 second ad breaks between assets.
                }
            }, {
                'beam':{
                    'id':'1df8d13992cd4222a7343b8fafd89cd7' # Asset ID
                }
            }
        ]

        payload = {
            'desc': description,
            'repeat': repeat,
            'beam_break_duration': beam_break_duration,
            'playlist': playlist
        }
 
        headers = {'Content-Type': 'application/json'}
 
        response = requests.post(
            url, params=APIParams(APICredentials()).get_params({}), data=json.dumps(payload), headers=headers
        )
 
        print(response.json())
  
Create_VLP().run()

Response:

{
	'@id': '/api/v4/linear-playlist/abce801613f94955b17db4f7c8e8137c',
	'@type': 'LinearPlaylist',
	'id': 'abce801613f94955b17db4f7c8e8137c',
	'desc': 'Sample Playlist',
	'repeat': -1,
	'profile': '',
	'beam_break_duration': 30,
	'ad_slate_fill': 0,
	'active': 1,
	'skip_drm': 0,
	'studio_drm_required': 0,
	'playlist': [{
			'beam': {
				'id': 'abc123456defghi789jklmno012345pq'
			}
		}, {
			'ad': {
				'dur': 20
			}
		}, {
			'beam': {
				'id': '1df8d13992cd4222a7343b8fafd89cd7'
			}
		}
	]
}

Delete Virtual Linear Playlist

Deletes a virtual linear playlist.

Request

Request syntax:

DELETE /linear-playlist/Playlist ID

Define the following variable 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

Playlist ID

Required

Replace this variable with the system-defined ID assigned to the desired virtual linear playlist.

Use the Get All Virtual Linear Playlists endpoint to retrieve a list of virtual linear playlists and their system-defined IDs.

Authentication

Pass a digital signature based off of msg.

Learn more.

Response

The response for a successful request is a 204 No Content.

Sample Request/Response

Call the delete_virtual_linear_playlist module (Python 3) to delete a virtual linear playlist. This module imports names from the api_auth module.

import requests
from api_auth import APICredentials, APIParams
  
class VirtualLinearPlaylist:
    def __init__(self):
        self.host = "https://services.uplynk.com"
  
    def run(self):
        self._delete_virtual_linear_playlist()
  
    def _delete_virtual_linear_playlist(self):
        playlist_id = 'abce801613f94955b17db4f7c8e8137c' # Replace with the desired playlist ID.
        url = "{}{}{}".format(self.host, "/api/v4/linear-playlist/", playlist_id)
 
        headers = {'Content-Type': 'application/json'}
  
        response = requests.delete(
            url, params=APIParams(APICredentials()).get_params({}), headers=headers
        )
  
VirtualLinearPlaylist().run()

Get All Virtual Linear Playlists

Retrieves a list of your virtual linear playlists.

Request

Request syntax:

GET /linear-playlist

Request syntax (filtered):

GET /linear-playlist?desc=Description&active=Status

Query string parameters:

Filter the response by passing the following query string parameters:

Parameter

Description

desc

Replace Description with the desired playlist description. The response will only include playlists whose description is an exact match to the specified value.

active

Replace Status with either of the following values:

  • 0: Filter by disabled playlists.
  • 1: Filter by enabled playlists.

Authentication

Pass a digital signature based off of msg.

Learn more.

Response

The response for a successful request contains the following properties:

Name

Data Type

Description

@id

String

Indicates the relative path to this endpoint.

@type

String

Returns Collection.

items

List of dictionaries

Contains a list of virtual linear playlists.

total_items

Integer

Indicates the total number of virtual linear playlists.

items List

The items list describes each virtual linear playlist via the following properties:

Name

Data Type

Description

@id

String

Indicates the relative path to this endpoint.

@type

String

Returns LinearPlaylist.

active

Integer

Determines the playlist's status. Valid values are:

  • 0: Inactive
  • 1: Active

ad_slate_fill

Integer

Determines whether ad breaks with insufficient ads will be filled with ad slate. Valid values are:

  • 0: Disables ad slate and returns back to content.
  • 1: Enables ad slate.

beam_break_duration

Integer

Determines whether ad breaks defined within an asset are honored and their duration. Valid values are:

  • 0: Ad breaks are ignored.
  • #: Sets the duration, in seconds, for all ad breaks.

desc

String

Sets the virtual linear playlist's description.

id

String

Indicates the virtual linear playlist system-defined ID.

playlist

List

Contains an ordered list of assets and ad breaks.

A virtual linear playlist supports up to 100 assets.

profile

String

Reserved for future use.

repeat

Integer

Determines the number of times that the playlist will be repeated. Valid values are:

  • 0: The playlist will not repeat.
  • -1: The playlist will repeat indefinitely.
  • #: The playlist will repeat the specified number of times.

skip_drm

Integer

Determines whether playback of the virtual linear playlist requires a digital signature. Valid values are:

  • 0: Playback requires a digital signature.
  • 1: Playback is allowed without a digital signature.

This property takes precedence over an asset's Require a token for playback setting.

studio_drm_required

Integer

Determines whether playback of the virtual linear playlist will be secured via Studio DRM. Valid values are:

  • 0: Playback is not secured by Studio DRM.
  • 1: Playback is secured via DRM.

This property takes precedence over an asset's Require studio approved DRM for playback setting.

playlist List

The playlist list defines a virtual linear playlist via the following properties:

Name

Data Type

Description

beam

Dictionary

Contains an id property.

id

String

beam dictionary

Indicates the system-defined ID for the asset that will be added to the virtual linear playlist.

ad

Dictionary

Contains a dur property.

dur

Integer

ad dictionary

Indicates the duration, in seconds, for an ad break that occurs immediately after the asset defined within the beam dictionary.

Sample Request/Response

Call the get_all_virtual_linear_playlists module (Python 3) to retrieve REPLACEME. This module imports names from the api_auth module.

import requests
from api_auth import APICredentials, APIParams
  
class VirtualLinearPlaylists:
    def __init__(self):
        self.host = "https://services.uplynk.com"

    def run(self):
        self._get_all_virtual_linear_playlists()
  
    def _get_all_virtual_linear_playlists(self):
        url = "{}{}".format(self.host, "/api/v4/linear-playlist")
 
        headers = {'Content-Type': 'application/json'}
  
        response = requests.get(
            url, params=APIParams(APICredentials()).get_params({}), headers=headers
        )
  
        print(response.json())
  
VirtualLinearPlaylists().run()

Response:

{
	'@id': '/api/v4/linear-playlist/?desc=Sample+Playlist',
	'@type': 'Collection',
	'items': [{
			'@id': '/api/v4/linear-playlist/abce801613f94955b17db4f7c8e8137c',
			'@type': 'LinearPlaylist',
			'id': 'abce801613f94955b17db4f7c8e8137c',
			'desc': 'Sample Playlist',
			'repeat': -1,
			'profile': '',
			'beam_break_duration': 30,
			'ad_slate_fill': 0,
			'active': 1,
			'skip_drm': 0,
			'studio_drm_required': 0,
			'playlist': [{
            	    'beam':{
                	    'id':'abc123456defghi789jklmno012345pq'
                	}
            	}, {
                	'ad':{
                    	'dur': 20
                	}
            	}, {
                	'beam':{
                    	'id':'1df8d13992cd4222a7343b8fafd89cd7'
                	}
            	}
        	]
		}
	],
	'total_items': 1
}

Get Virtual Linear Playlist

Retrieves a specific virtual linear playlist. Identify a virtual linear playlist by its system-defined ID.

Request

Request syntax:

GET /linear-playlist/Playlist ID

Define the following variable 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

Playlist ID

Required

Replace this variable with the system-defined ID assigned to the desired virtual linear playlist.

Use the Get All Virtual Linear Playlists endpoint to retrieve a list of virtual linear playlists and their system-defined IDs.

Authentication

Pass a digital signature based off of msg.

Learn more.

Response

The response for a successful request contains the following properties:

Name

Data Type

Description

@id

String

Indicates the relative path to this endpoint.

@type

String

Returns LinearPlaylist.

active

Integer

Determines the playlist's status. Valid values are:

  • 0: Inactive
  • 1: Active

ad_slate_fill

Integer

Determines whether ad breaks with insufficient ads will be filled with ad slate. Valid values are:

  • 0: Disables ad slate and returns back to content.
  • 1: Enables ad slate.

beam_break_duration

Integer

Determines whether ad breaks defined within an asset are honored and their duration. Valid values are:

  • 0: Ad breaks are ignored.
  • #: Sets the duration, in seconds, for all ad breaks.

desc

String

Sets the virtual linear playlist's description.

id

String

Indicates the virtual linear playlist system-defined ID.

playlist

List

Contains an ordered list of assets and ad breaks.

A virtual linear playlist supports up to 100 assets.

profile

String

Reserved for future use.

repeat

Integer

Determines the number of times that the playlist will be repeated. Valid values are:

  • 0: The playlist will not repeat.
  • -1: The playlist will repeat indefinitely.
  • #: The playlist will repeat the specified number of times.

skip_drm

Integer

Determines whether playback of the virtual linear playlist requires a digital signature. Valid values are:

  • 0: Playback requires a digital signature.
  • 1: Playback is allowed without a digital signature.

This property takes precedence over an asset's Require a token for playback setting.

studio_drm_required

Integer

Determines whether playback of the virtual linear playlist will be secured via Studio DRM. Valid values are:

  • 0: Playback is not secured by Studio DRM.
  • 1: Playback is secured via DRM.

This property takes precedence over an asset's Require studio approved DRM for playback setting.

playlist List

The playlist list defines a virtual linear playlist via the following properties:

Name

Data Type

Description

beam

Dictionary

Contains an id property.

id

String

beam dictionary

Indicates the system-defined ID for the asset that will be added to the virtual linear playlist.

ad

Dictionary

Contains a dur property.

dur

Integer

ad dictionary

Indicates the duration, in seconds, for an ad break that occurs immediately after the asset defined within the beam dictionary.

Sample Request/Response

Call the get_virtual_linear_playlist module (Python 3) to retrieve REPLACEME. This module imports names from the api_auth module.

import requests
from api_auth import APICredentials, APIParams
  
class VirtualLinearPlaylist:
    def __init__(self):
        self.host = "https://services.uplynk.com"

    def run(self):
        self._get_virtual_linear_playlist()
  
    def _get_virtual_linear_playlist(self):
        playlist_id = 'abce801613f94955b17db4f7c8e8137c' # Replace with the desired playlist ID.
        url = "{}{}{}".format(self.host, "/api/v4/linear-playlist/", playlist_id)
 
        headers = {'Content-Type': 'application/json'}
  
        response = requests.get(
            url, params=APIParams(APICredentials()).get_params({}), headers=headers
        )
  
        print(response.json())
  
VirtualLinearPlaylist().run()

Response:

{
	'@id': '/api/v4/linear-playlist/abce801613f94955b17db4f7c8e8137c',
	'@type': 'LinearPlaylist',
	'id': 'abce801613f94955b17db4f7c8e8137c',
	'desc': 'Sample Playlist',
	'repeat': -1,
	'profile': '',
	'beam_break_duration': 30,
	'ad_slate_fill': 0,
	'active': 1,
	'skip_drm': 0,
	'studio_drm_required': 0,
	'playlist': [{
			'beam': {
				'id': 'abc123456defghi789jklmno012345pq'
			}
		}, {
			'ad': {
				'dur': 20
			}
		}, {
			'beam': {
				'id': '1df8d13992cd4222a7343b8fafd89cd7'
			}
		}
	]
}

Update Virtual Linear Playlist

Updates a virtual linear playlist.

Restrict a virtual linear playlist to assets that have been encoded with the same codec (i.e., AVC or HEVC).

Modifications to a virtual linear playlist are only applicable for new playback sessions. Existing playback sessions will be unaffected by your changes.

Request

Request syntax:

PATCH /linear-playlist/Playlist ID

Define the following variable 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

Playlist ID

Required

Replace this variable with the system-defined ID assigned to the desired virtual linear playlist.

Use the Get All Virtual Linear Playlists endpoint to retrieve a list of virtual linear playlists and their system-defined IDs.

Request body parameters:

Pass the following request body parameters:

Name

Data Type

Description

active

Integer

Determines the playlist's status. Valid values are:

  • 0: Inactive
  • 1: Active

ad_slate_fill

Integer

Determines whether ad breaks with insufficient ads will be filled with ad slate. Valid values are:

  • 0: Disables ad slate and returns back to content.
  • 1: Enables ad slate.

beam_break_duration

Integer

Determines whether ad breaks defined within an asset are honored and their duration. Valid values are:

  • 0: Ad breaks are ignored.
  • #: Sets the duration, in seconds, for all ad breaks.

desc

String

Sets the virtual linear playlist's description.

playlist

List

Contains an ordered list of assets and ad breaks.

A virtual linear playlist supports up to 100 assets.

repeat

Integer

Determines the number of times that the playlist will be repeated. Valid values are:

  • 0: The playlist will not repeat.
  • -1: The playlist will repeat indefinitely.
  • #: The playlist will repeat the specified number of times.

skip_drm

Integer

Determines whether playback of the virtual linear playlist requires a digital signature. Valid values are:

  • 0: Playback requires a digital signature.
  • 1: Playback is allowed without a digital signature.

This property takes precedence over an asset's Require a token for playback setting.

studio_drm_required

Integer

Determines whether playback of the virtual linear playlist will be secured via Studio DRM. Valid values are:

  • 0: Playback is not secured by Studio DRM.
  • 1: Playback is secured via DRM.

This property takes precedence over an asset's Require studio approved DRM for playback setting.

playlist List

The playlist list defines a virtual linear playlist via the following properties:

Name

Data Type

Description

beam

Dictionary

Contains an id property.

id

String

beam dictionary

Indicates the system-defined ID for the asset that will be added to the virtual linear playlist.

ad

Dictionary

Contains a dur property.

dur

Integer

ad dictionary

Indicates the duration, in seconds, for an ad break that occurs immediately after the asset defined within the beam dictionary.

Authentication

Pass a digital signature based off of msg.

Learn more.

Response

The response for a successful request contains the following properties:

Name

Data Type

Description

@id

String

Indicates the relative path to this endpoint.

@type

String

Returns LinearPlaylist.

active

Integer

Indicates the playlist's status. Valid values are:

  • 0: Inactive
  • 1: Active

ad_slate_fill

Integer

Indicates whether ad breaks with insufficient ads will be filled with ad slate. Valid values are:

  • 0: Disables ad slate and returns back to content.
  • 1: Enables ad slate.

beam_break_duration

Integer

Indicates whether ad breaks defined within an asset are honored and their duration. Valid values are:

  • 0: Ad breaks are ignored.
  • #: Sets the duration, in seconds, for all ad breaks.

desc

String

Indicates the virtual linear playlist's description.

id

String

Indicates the virtual linear playlist system-defined ID.

playlist

List

Contains an ordered list of assets and ad breaks.

A virtual linear playlist supports up to 100 assets.

profile

String

Reserved for future use.

repeat

Integer

Indicates the number of times that the playlist will be repeated. Valid values are:

  • 0: The playlist will not repeat.
  • -1: The playlist will repeat indefinitely.
  • #: The playlist will repeat the specified number of times.

skip_drm

Integer

Determines whether playback of the virtual linear playlist requires a digital signature. Valid values are:

  • 0: Playback requires a digital signature.
  • 1: Playback is allowed without a digital signature.

This property takes precedence over an asset's Require a token for playback setting.

studio_drm_required

Integer

Determines whether playback of the virtual linear playlist will be secured via Studio DRM. Valid values are:

  • 0: Playback is not secured by Studio DRM.
  • 1: Playback is secured via DRM.

This property takes precedence over an asset's Require studio approved DRM for playback setting.

playlist List

The playlist list defines a virtual linear playlist via the following properties:

Name

Data Type

Description

beam

Dictionary

Contains an id property.

id

String

beam dictionary

Indicates the system-defined ID for the asset that will be added to the virtual linear playlist.

ad

Dictionary

Contains a dur property.

dur

Integer

ad dictionary

Indicates the duration, in seconds, for an ad break that occurs immediately after the asset defined within the beam dictionary.

Sample Request/Response

Call the update_virtual_linear_playlist module (Python 3) to create a virtual linear playlist. This module imports names from the api_auth module.

import json
import requests
from api_auth import APICredentials, APIParams
  
class Update_VLP:
    def __init__(self):
        self.host = "https://services.uplynk.com"
  
    def run(self):
        self._update_virtual_linear_playlist()
 
    def _update_virtual_linear_playlist(self):
        playlist_id = 'abce801613f94955b17db4f7c8e8137c' # Replace with the desired playlist ID.
        url = "{}{}{}".format(self.host, "/api/v4/linear-playlist/", playlist_id)
 
        beam_break_duration = 45 # Sets 45 second ad breaks.

        payload = {
            'beam_break_duration': beam_break_duration
        }
 
        headers = {'Content-Type': 'application/json'}
 
        response = requests.patch(
            url, params=APIParams(APICredentials()).get_params({}), data=json.dumps(payload), headers=headers
        )
 
        print(response.json())
  
Update_VLP().run()

Response:

{
	'@id': '/api/v4/linear-playlist/abce801613f94955b17db4f7c8e8137c',
	'@type': 'LinearPlaylist',
	'id': 'abce801613f94955b17db4f7c8e8137c',
	'desc': 'Sample Playlist',
	'repeat': -1,
	'profile': '',
	'beam_break_duration': 45,
	'ad_slate_fill': 0,
	'active': 1,
	'skip_drm': 0,
	'studio_drm_required': 0,
	'playlist': [{
			'beam': {
				'id': 'abc123456defghi789jklmno012345pq'
			}
		}, {
			'ad': {
				'dur': 20
			}
		}, {
			'beam': {
				'id': '1df8d13992cd4222a7343b8fafd89cd7'
			}
		}
	]
}