Studio DRM API

The Studio DRM API, which is a versioned API, contains the following endpoints:

Category Description

Studio DRM Policy Configuration

Create / Update Studio DRM Policy Configuration

Create or update a Studio DRM policy configuration.

POST /drm/policies/create-or-update

Delete Studio DRM Policy Configuration

Delete a Studio DRM policy configuration.

DELETE /drm/policy/Policy ID

Get All Studio DRM Policy Configurations

Retrieve all Studio DRM policy configurations.

GET /drm/policies

Get Studio DRM Policy Configuration

Retrieve a specific Studio DRM policy configuration.

GET /drm/policy/Policy ID

VMP Rejection Status Configuration

Get VMP Rejection Status Configuration

Retrieve the set of Verified Media Path (VMP) status(es) that will result in a rejection.

GET /drm/vmp-reject-statuses

Update VMP Rejection Status Configuration

Update the set of Verified Media Path (VMP) status(es) that will result in a rejection.

POST /drm/vmp-reject-statuses/update

Static Encryption Key

Get Static Encryption Key Live Slicers

Find out the set of Live Slicers for which content will be encrypted using a static encryption key.

GET /drm/static-key-slicer-ids

Get Static Encryption Key Rotation Schedule

Retrieve your static encryption key rotation schedule.

GET /api/v3/drm/key-rotation-schedule

Get Static Encryption Key Status

Find out whether your content may be encrypted using a static encryption key.

GET /drm/use-static-encryption-key

Update Static Encryption Key Live Slicers

Update the set of Live Slicers for which content will be encrypted using a static encryption key.

POST /drm/static-key-slicer-ids/update

Update Static Encryption Key Rotation Schedule

Define your static encryption key rotation schedule.

POST /drm/key-rotation-schedule/create-or-update

Update Static Encryption Key Status

Determine whether your content will be encrypted using a static encryption key.

POST /drm/use-static-encryption-key/update

Base URL

Use the following base URL:

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

Create / Update Studio DRM Policy Configuration

This endpoint allows the following actions:

Request

Request syntax:

POST /drm/policies/create-or-update

Request body parameters:

Pass the following request body parameters:

Name

Data Type

Description

policy_name

Required

String

Assigns a name to the Studio DRM policy configuration.

If the specified value matches the name assigned to an existing Studio DRM policy configuration, then that configuration will be updated.

_id

String

Update Policy Only

Identify the Studio DRM policy configuration to be updated by its system-defined ID.

This parameter should only be included when updating an existing configuration.

fairplay

Dictionary

Contains Studio DRM policy settings for Apple FairPlay Streaming.

widevine

Dictionary

Contains Studio DRM policy settings for Google Widevine DRM.

playready

Dictionary

Contains Studio DRM policy settings for Microsoft PlayReady.

Policy settings that are not explicitly set are defined by the default Studio DRM policy. If you are updating an existing Studio DRM policy configuration, then those settings will be overwritten by the default Studio DRM policy.

Authentication

Pass a digital signature based off of msg.

Learn more.

Response

The response for a successful request contains the following parameters.

Name

Data Type

Description
configs

List of dictionaries

Contains all of the Studio DRM policy configurations associated with the current user.

error

Integer

Indicates whether an error occurred.

Learn more.

Sample Request/Response

Call the create_studio_drm_pc module (Python 3) to create a Studio DRM policy configuration. This module imports names from the api_auth module.

import requests
from api_auth import APICredentials, APIParams
 
class DRMPolicies:
    def __init__(self):
        self.host = "https://services.uplynk.com"
 
    def run(self):
        """
        Create a DRM policy.
        """
        self._create_or_update_drm_policy()
 
    def _create_or_update_drm_policy(self):
 
        policy_data = dict()
        url = "{}{}".format(self.host, "/api/v3/drm/policies/create-or-update")
 
        new_policy_data = {
            'policy_name': 'My First Policy',
            'widevine': {
                'content_key_specs': [
                    {
                        'track_type': 'ALL',
                        'security_level': 1,
                        'required_output_protection': {
                            'hdcp': 'HDCP_NONE'
                        }
                    }
                ],
                'policy_overrides': {
                    'can_persist': True,
                    'can_play': True,
                    'can_renew': True
                }
            },
            'fairplay': {
                "hd": {
                    'allow_airplay': False,
                    'allow_av_adapter': False
                }
            },
            'playready': {
                "hd": {
                    'require_hdcp_type_1': True,
                    'digital_video_protection_level': 250
                },
                "uhd1": {
                    'require_hdcp_type_1': True,
                    'digital_video_protection_level': 250
                },
                "uhd2": {
                    'require_hdcp_type_1': True,
                    'digital_video_protection_level': 250
                }
            }
        }
 
        policy_data['item'] = new_policy_data
 
        response = requests.post(
            url, data=APIParams(APICredentials()).get_params(policy_data)
        )
 
        print(response.json())
 
DRMPolicies().run()

Response:

{
	'configs': [{
			'_id': 'abcdef123456ghijkl7890123mno789',
			'created': 1558566151978,
			'policy_name': 'My First Policy',
			'fairplay': {
				'key_duration_seconds': 0,
				'hd': {
					'hdcp_enforcement': -1,
					'allow_airplay': False,
					'allow_av_adapter': False
				},
				'persistence_duration_seconds': 0,
				'rental_duration_seconds': 0,
				'lease_duration_seconds': 0,
				'uhd2': {
					'hdcp_enforcement': -1,
					'allow_airplay': True,
					'allow_av_adapter': True
				},
				'uhd1': {
					'hdcp_enforcement': -1,
					'allow_airplay': True,
					'allow_av_adapter': True
				},
				'playback_duration_seconds': 0,
				'sd': {
					'hdcp_enforcement': -1,
					'allow_airplay': True,
					'allow_av_adapter': True
				},
				'rental': False,
				'persistence': False,
				'lease': False
			},
			'lmsig': '1538693547862491_10735_4271',
			'widevine': {
				'content_key_specs': [{
						'track_type': 'ALL',
						'security_level': 1,
						'required_output_protection': {
							'hdcp_srm_rule': 'HDCP_SRM_RULE_NONE',
							'hdcp': 'HDCP_NONE',
							'cgms_flags': 'CGMS_NONE',
							'disable_analog_output': False
						}
					}
				],
				'policy_overrides': {
					'renewal_retry_interval_seconds': 0,
					'can_renew': True,
					'can_persist': True,
					'license_duration_seconds': 86400,
					'always_include_client_id': False,
					'can_play': True,
					'rental_duration_seconds': 0,
					'renewal_delay_seconds': 0,
					'renewal_recovery_duration_seconds': 0,
					'playback_duration_seconds': 0,
					'renew_with_usage': False
				}
			},
			'owner': 'abc33864a92c46a1a286cdd49b0a9123',
			'playready': {
				'license_duration_seconds': 86400,
				'can_persist': False,
				'can_play': True,
				'uhd2': {
					'digital_video_protection_level': 250,
					'security_level': 2000,
					'play_enabler': False,
					'require_hdcp_type_1': True
				},
				'uhd1': {
					'digital_video_protection_level': 250,
					'security_level': 2000,
					'play_enabler': False,
					'require_hdcp_type_1': True
				},
				'playback_duration_seconds': 0,
				'hd': {
					'digital_video_protection_level': 250,
					'security_level': 2000,
					'play_enabler': False,
					'require_hdcp_type_1': True
				},
				'sd': {
					'require_hdcp_type_1': False,
					'security_level': 2000,
					'play_enabler': False,
					'digital_video_protection_level': 100
				}
			},
			'lastmod': 1558566152020
		}
	],
	'error': 0
}

Delete Studio DRM Policy Configuration

Deletes a specific Studio DRM policy configuration.

Request

Request syntax:

DELETE /drm/policy/Policy 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

Policy ID

Required

Replace this variable with the system-defined ID assigned to the desired Studio DRM policy configuration.

Authentication

Pass a digital signature based off of msg.

Learn more.

Response

The response for a successful request contains the following parameters.

Name

Data Type

Description
configs

List of dictionaries

Contains all of the Studio DRM policy configurations associated with the current user.

error

Integer

Indicates whether an error occurred.

Learn more.

Sample Request/Response

Update the delete_studio_drm_pc module to identify the Studio DRM policy configuration that will be deleted by its system-defined ID.

        policy_id = 'abcdef123456ghijkl7890123mno456'

Call the delete_studio_drm_pc module (Python 3) to delete a specific Studio DRM policy configuration. This module imports names from the api_auth module.

import requests
from api_auth import APICredentials, APIParams
 
class DRMPolicies:
    def __init__(self):
        self.host = "https://services.uplynk.com"
 
    def run(self):
        """
        Delete a DRM policy.
        """
        self._delete_drm_policy()
 
    def _delete_drm_policy(self):
        policy_id = 'abcdef123456ghijkl7890123mno456'
        url = "{}{}{}".format(self.host, "/api/v3/drm/policy/", policy_id)
 
        response = requests.delete(
            url, params=APIParams(APICredentials()).get_params({})
        )
 
        print(response.json())
 
DRMPolicies().run()

Response:

{
	'configs': [{
			'_id': 'abcdef123456ghijkl7890123mno789',
			'created': 1558566151978,
			'policy_name': 'My First Policy',
			'fairplay': {
				'key_duration_seconds': 0,
				'hd': {
					'hdcp_enforcement': -1,
					'allow_airplay': False,
					'allow_av_adapter': False
				},
				'persistence_duration_seconds': 0,
				'rental_duration_seconds': 0,
				'lease_duration_seconds': 0,
				'uhd2': {
					'hdcp_enforcement': -1,
					'allow_airplay': True,
					'allow_av_adapter': True
				},
				'uhd1': {
					'hdcp_enforcement': -1,
					'allow_airplay': True,
					'allow_av_adapter': True
				},
				'playback_duration_seconds': 0,
				'sd': {
					'hdcp_enforcement': -1,
					'allow_airplay': True,
					'allow_av_adapter': True
				},
				'rental': False,
				'persistence': False,
				'lease': False
			},
			'lmsig': '1538693547862491_10735_4271',
			'widevine': {
				'content_key_specs': [{
						'track_type': 'ALL',
						'security_level': 1,
						'required_output_protection': {
							'hdcp_srm_rule': 'HDCP_SRM_RULE_NONE',
							'hdcp': 'HDCP_NONE',
							'cgms_flags': 'CGMS_NONE',
							'disable_analog_output': False
						}
					}
				],
				'policy_overrides': {
					'renewal_retry_interval_seconds': 0,
					'can_renew': True,
					'can_persist': True,
					'license_duration_seconds': 86400,
					'always_include_client_id': False,
					'can_play': True,
					'rental_duration_seconds': 0,
					'renewal_delay_seconds': 0,
					'renewal_recovery_duration_seconds': 0,
					'playback_duration_seconds': 0,
					'renew_with_usage': False
				}
			},
			'owner': 'abc33864a92c46a1a286cdd49b0a9123',
			'playready': {
				'license_duration_seconds': 86400,
				'can_persist': False,
				'can_play': True,
				'uhd2': {
					'digital_video_protection_level': 250,
					'security_level': 2000,
					'play_enabler': False,
					'require_hdcp_type_1': True
				},
				'uhd1': {
					'digital_video_protection_level': 250,
					'security_level': 2000,
					'play_enabler': False,
					'require_hdcp_type_1': True
				},
				'playback_duration_seconds': 0,
				'hd': {
					'digital_video_protection_level': 250,
					'security_level': 2000,
					'play_enabler': False,
					'require_hdcp_type_1': True
				},
				'sd': {
					'require_hdcp_type_1': False,
					'security_level': 2000,
					'play_enabler': False,
					'digital_video_protection_level': 100
				}
			},
			'lastmod': 1558566152020
		}
	],
	'error': 0
}

Get All Studio DRM Policy Configurations

Retrieves all Studio DRM policy configurations associated with your user account.

Request

Request syntax:

GET /drm/policies

Authentication

Pass a digital signature based off of msg.

Learn more.

Response

The response for a successful request contains the following parameters:

Name

Data Type

Description
configs

List of dictionaries

Contains all of the Studio DRM policy configurations associated with the current user.

error

Integer

Indicates whether an error occurred.

Learn more.

Sample Request/Response

Call the get_all_studio_drm_pc module (Python 3) to retrieve a list of Studio DRM policy configurations. This module imports names from the api_auth module.

import requests
from api_auth import APICredentials, APIParams
 
class DRMPolicies:
    def __init__(self):
        self.host = "https://services.uplynk.com"
 
    def run(self):
        """
        Retrieve all DRM policies.
        """
        self._get_drm_policies()
 
    def _get_drm_policies(self):
        url = "{}{}".format(self.host, "/api/v3/drm/policies")
 
        response = requests.get(
            url, params=APIParams(APICredentials()).get_params({})
        )
 
        print(response.json())
 
DRMPolicies().run()

Response:

{
	'configs': [{
			'_id': 'abcdef123456ghijkl7890123mno789',
			'created': 1558566151978,
			'policy_name': 'My First Policy',
			'fairplay': {
				'key_duration_seconds': 0,
				'hd': {
					'hdcp_enforcement': -1,
					'allow_airplay': False,
					'allow_av_adapter': False
				},
				'persistence_duration_seconds': 0,
				'rental_duration_seconds': 0,
				'lease_duration_seconds': 0,
				'uhd2': {
					'hdcp_enforcement': -1,
					'allow_airplay': True,
					'allow_av_adapter': True
				},
				'uhd1': {
					'hdcp_enforcement': -1,
					'allow_airplay': True,
					'allow_av_adapter': True
				},
				'playback_duration_seconds': 0,
				'sd': {
					'hdcp_enforcement': -1,
					'allow_airplay': True,
					'allow_av_adapter': True
				},
				'rental': False,
				'persistence': False,
				'lease': False
			},
			'lmsig': '1538693547862491_10735_4271',
			'widevine': {
				'content_key_specs': [{
						'track_type': 'ALL',
						'security_level': 1,
						'required_output_protection': {
							'hdcp_srm_rule': 'HDCP_SRM_RULE_NONE',
							'hdcp': 'HDCP_NONE',
							'cgms_flags': 'CGMS_NONE',
							'disable_analog_output': False
						}
					}
				],
				'policy_overrides': {
					'renewal_retry_interval_seconds': 0,
					'can_renew': True,
					'can_persist': True,
					'license_duration_seconds': 86400,
					'always_include_client_id': False,
					'can_play': True,
					'rental_duration_seconds': 0,
					'renewal_delay_seconds': 0,
					'renewal_recovery_duration_seconds': 0,
					'playback_duration_seconds': 0,
					'renew_with_usage': False
				}
			},
			'owner': 'abc33864a92c46a1a286cdd49b0a9123',
			'playready': {
				'license_duration_seconds': 86400,
				'can_persist': False,
				'can_play': True,
				'uhd2': {
					'digital_video_protection_level': 250,
					'security_level': 2000,
					'play_enabler': False,
					'require_hdcp_type_1': True
				},
				'uhd1': {
					'digital_video_protection_level': 250,
					'security_level': 2000,
					'play_enabler': False,
					'require_hdcp_type_1': True
				},
				'playback_duration_seconds': 0,
				'hd': {
					'digital_video_protection_level': 250,
					'security_level': 2000,
					'play_enabler': False,
					'require_hdcp_type_1': True
				},
				'sd': {
					'require_hdcp_type_1': False,
					'security_level': 2000,
					'play_enabler': False,
					'digital_video_protection_level': 100
				}
			},
			'lastmod': 1558566152020
		}
	],
	'error': 0
}  

Get Studio DRM Policy Configuration

Retrieves a specific Studio DRM policy configuration.

Request

Request syntax:

GET /drm/policy/Policy 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

Policy ID

Required

Replace this variable with the system-defined ID assigned to the desired Studio DRM policy configuration.

Authentication

Pass a digital signature based off of msg.

Learn more.

Response

The response for a successful request contains the following parameters:

Name

Data Type

Description
configs

List of dictionaries

Contains the requested Studio DRM policy configuration.

error

Integer

Indicates whether an error occurred.

Learn more.

Sample Request/Response

Update the get_studio_drm_pc module to identify the policy that will be retrieved by its system-defined ID.

        policy_id = 'abcdef123456ghijkl7890123mno789'

Call the get_studio_drm_pc module (Python 3) to retrieve a specific Studio DRM policy configuration. This module imports names from the api_auth module.

import requests
from api_auth import APICredentials, APIParams 
 
class DRMPolicy:
    def __init__(self):
        self.host = "https://services.uplynk.com"
 
    def run(self):
        """
        Retrieve a DRM policy.
        """
        self._get_drm_policy()
 
    def _get_drm_policy(self):
        policy_id = 'abcdef123456ghijkl7890123mno789'
        url = "{}{}{}".format(self.host, "/api/v3/drm/policy/", policy_id)
 
        response = requests.get(
            url, params=APIParams(APICredentials()).get_params({})
        )
 
        print(response.json())
 
DRMPolicy().run()

Response:

{
	'configs': [{
			'_id': 'abcdef123456ghijkl7890123mno789',
			'created': 1558566151978,
			'policy_name': 'My First Policy',
			'fairplay': {
				'key_duration_seconds': 0,
				'hd': {
					'hdcp_enforcement': -1,
					'allow_airplay': False,
					'allow_av_adapter': False
				},
				'persistence_duration_seconds': 0,
				'rental_duration_seconds': 0,
				'lease_duration_seconds': 0,
				'uhd2': {
					'hdcp_enforcement': -1,
					'allow_airplay': True,
					'allow_av_adapter': True
				},
				'uhd1': {
					'hdcp_enforcement': -1,
					'allow_airplay': True,
					'allow_av_adapter': True
				},
				'playback_duration_seconds': 0,
				'sd': {
					'hdcp_enforcement': -1,
					'allow_airplay': True,
					'allow_av_adapter': True
				},
				'rental': False,
				'persistence': False,
				'lease': False
			},
			'lmsig': '1538693547862491_10735_4271',
			'widevine': {
				'content_key_specs': [{
						'track_type': 'ALL',
						'security_level': 1,
						'required_output_protection': {
							'hdcp_srm_rule': 'HDCP_SRM_RULE_NONE',
							'hdcp': 'HDCP_NONE',
							'cgms_flags': 'CGMS_NONE',
							'disable_analog_output': False
						}
					}
				],
				'policy_overrides': {
					'renewal_retry_interval_seconds': 0,
					'can_renew': True,
					'can_persist': True,
					'license_duration_seconds': 86400,
					'always_include_client_id': False,
					'can_play': True,
					'rental_duration_seconds': 0,
					'renewal_delay_seconds': 0,
					'renewal_recovery_duration_seconds': 0,
					'playback_duration_seconds': 0,
					'renew_with_usage': False
				}
			},
			'owner': 'abc33864a92c46a1a286cdd49b0a9123',
			'playready': {
				'license_duration_seconds': 86400,
				'can_persist': False,
				'can_play': True,
				'uhd2': {
					'digital_video_protection_level': 250,
					'security_level': 2000,
					'play_enabler': False,
					'require_hdcp_type_1': True
				},
				'uhd1': {
					'digital_video_protection_level': 250,
					'security_level': 2000,
					'play_enabler': False,
					'require_hdcp_type_1': True
				},
				'playback_duration_seconds': 0,
				'hd': {
					'digital_video_protection_level': 250,
					'security_level': 2000,
					'play_enabler': False,
					'require_hdcp_type_1': True
				},
				'sd': {
					'require_hdcp_type_1': False,
					'security_level': 2000,
					'play_enabler': False,
					'digital_video_protection_level': 100
				}
			},
			'lastmod': 1558566152020
		}
	],
	'error': 0
}

configs List

The configs list describes one or more Studio DRM policy configurations using the following parameters:

Name

Data Type

Description

_id

String

Identifies a policy by its system-defined ID.

created

Integer

Indicates the policy's creation date in Unix time (milliseconds).

fairplay

Dictionary

Contains Studio DRM policy settings for Apple FairPlay Streaming.

lastmod

Integer

Indicates the policy's last modification date in Unix time (milliseconds).

lmsig

String

This parameter is reserved for future use.

owner

String

Identifies the CMS user associated with the policy by user IDA user ID uniquely identifies a user account via an alpanumeric system-defined ID..

playready

Dictionary

Contains Studio DRM policy settings for Microsoft PlayReady.

policy_name

String

Identifies a policy by its name.

widevine

Dictionary

Contains Studio DRM policy settings for Google Widevine DRM.

Apple FairPlay Streaming

The fairplay dictionary describes Apple FairPlay Streaming DRM policies.

Name

Data Type

Description

hd

Dictionary

Contains the DRM policy for high definition (720p and 1080p) tracks.

key_duration_seconds

Integer

Determines the length of time, in seconds, for which the Content Key will be valid.

Default value:

0

lease

Boolean

Determines whether a client may renew a lease. Playback is only allowed while the lease is valid.

Default value:

False

lease_duration_seconds

Integer

Determines the length of time, in seconds, during which playback will be allowed. Playback will stop upon the expiration of the lease.

Key information:

  • This countdown starts upon the acquisition of the Content Key.
  • This parameter requires offline playback. Set persistence to "True."

    "persistence" : True,
  • This parameter may be combined with rental_duration_seconds.

Default value:

0

persistence

Boolean

Determines whether offline playback is allowed.

Default value:

False

persistence_duration_seconds

Integer

Determines the length of time, in seconds, during which offline playback is allowed.

Default value:

0

playback_duration_seconds

Integer

Determines the length of time, in seconds, for which playback will be valid.

Key information:

  • This parameter requires:

    1. Offline playback. Set persistence to "True."

      "persistence" : True,
    2. iOS 11 or later

      Your application's user agent should identify the OS as iOS 11 or later.

  • This countdown starts upon initial playback.
  • Use this parameter for offline playback or lease renewals only.
  • A license will not expire when this parameter is not specified or if it is set to "0."
  • Once playback is successfully initiated, it will be allowed even if playback extends beyond the rental duration.

Default value:

0

rental

Boolean

Determines whether offline rental is allowed.

Default value:

False

rental_duration_seconds

Integer

Determines the length of time, in seconds, during which the Content Key is valid prior to initial playback. Playback may only be initiated with a valid Content Key.

Key information:

  • This countdown starts upon the acquisition of the Content Key.
  • This parameter may be combined with lease_duration_seconds and persistence.
  • A Content Key will not expire if this parameter is not specified.
  • Once playback is successfully initiated, it will be allowed even if playback extends beyond the rental duration. However, the client will not be allowed to restart playback with an expired Content Key.

Default value:

0

sd

Dictionary

Contains the DRM policy for standard definition (576p or less) tracks.

uhd1

Dictionary

Contains the DRM policy for 4K ultra-high-definition video tracks.

uhd2

Dictionary

Contains the DRM policy for 8K ultra-high-definition video tracks.

Resolution Dictionary

Each of the above dictionaries contains the following parameters that describe the Apple FairPlay Streaming DRM policy for that resolution:

Name

Data Type

Description

allow_airplay

Boolean

Determines whether playback will be allowed over AirPlay.

Default value:

True

allow_av_adapter

Boolean

Determines whether playback may be mirrored via an Apple Lightning AV Adapter.

Default value:

True

hdcp_enforcement

Integer

Determines whether High-bandwidth Digital Content Protection (HDCP) enforcement is required.

Valid values are:

  • -1: HDCP is not enforced.
  • 0: HDCP type 0 content streams is enforced. This allows the stream to be transmitted by the HDCP repeater to all HDCP devices.
  • 1: HDCP content type 1 (HDCP version 2.2 or later) is enforced. Streams may not be transmitted by the HDCP repeater to HDCP 1.x-compliant devices or HDCP2.0-compliant repeaters.

Default value:

-1

Google Widevine DRM

The widevine dictionary contains the following parameters that describe a Google Widevine DRM policy:

Name

Data Type

Description

content_key_specs

List of dictionaries

Determines which content keys should be returned.

Key information:

  • This parameter must be specified for all tracks.
  • This parameter should be used to define a policy when a pre-existing one has not been associated with the content.
  • Default content key policy:

    [{
    		'track_type': 'ALL',
    		'required_output_protection': {
    			'hdcp_srm_rule': 'HDCP_SRM_RULE_NONE',
    			'hdcp': 'HDCP_NONE',
    			'cgms_flags': 'CGMS_NONE',
    			'disable_analog_output': False
    		},
    		'security_level': 1
    	}
    ]

policy_overrides

Dictionary

Determines the policy for the current license. The specified policy will override one assigned directly to an asset.

Default policy overrides:

{
	'can_renew': False,
	'renewal_retry_interval_seconds': 0,
	'always_include_client_id': False,
	'license_duration_seconds': 86400,
	'can_persist': False,
	'can_play': True,
	'rental_duration_seconds': 0,
	'renewal_delay_seconds': 0,
	'renewal_recovery_duration_seconds': 0,
	'playback_duration_seconds': 0,
	'renew_with_usage': False
}

The above default policy overrides are enforced without track-specific playback restrictions.

policy_overrides Dictionary

The policy_overrides dictionary defines the Studio DRM policy that will be used instead of policies assigned directly to an asset.

Name

Data Type

Description

always_include_client_id

Boolean

This parameter is reserved for future use.

can_persist

Boolean

Determines whether offline playback is allowed.

Valid values are:

  • True: Offline playback is allowed.
  • False: Offline playback is disallowed.

Default value:

False

can_play

Required

Boolean

Determine whether playback is allowed.

This parameter is required when defining policy overrides.

Default value:

True

can_renew

Boolean

This parameter is reserved for future use.

license_duration_seconds

Integer

Determines the length of time, in seconds, during which content playback is allowed.

Key information:

  • This window starts from the time at which the license was issued.
  • This parameter must be specified in order to limit playback by license.
  • No further decryption is allowed upon license expiration.

Default value:

86400

playback_duration_seconds

Integer

Determines the length of time, in seconds, for which a license will be valid after its initial use.

This parameter should only be specified for offline or license renewal scenarios.

Default value:

0

renew_with_usage

Boolean

This parameter is reserved for future use.

renewal_delay_seconds

Integer

This parameter is reserved for future use.

renewal_recovery_duration_seconds

Integer

This parameter is reserved for future use.

renewal_retry_interval_seconds

Integer

This parameter is reserved for future use.

renewal_server_url

String

This parameter is reserved for future use.

rental_duration_seconds

Integer

Determines the length of the window, in seconds, during which a license will be valid prior to its initial use.

Key information:

  • This window starts from the time at which the license was issued.
  • Once a license is used, rental duration is not used or enforced.

    Please use either playback or license duration to further limit playback.

  • This parameter should only be specified for offline scenarios.

Default value:

0

content_key_specs List

The content_key_specs list defines Studio DRM policy on a per track basis.

Name

Data Type

Description

required_output_protection

Dictionary

Contains key-value pairs that determine the protection requirements for the output.

The values associated with each key-value pair are case-sensitive.

hdcp

String

Determines whether HDCP is required.

Valid values for hdcp are:

  • HDCP_NONE: HDCP is not enforced.

  • HDCP_V1: Playback requires a client that supports HDCP 1.x or higher.

  • HDCP_V2: Playback requires a client that supports HDCP 2.0 or higher.
  • HDCP_V2_1: Playback requires a client that supports HDCP 2.1 or higher.
  • HDCP_V2_2: Playback requires a client that supports HDCP 2.2 or higher.
  • HDCP_NO_DIGITAL_OUTPUT: Playback is only allowed on an internal display. Playback over HDCP is disallowed.

Default value:

"hdcp": "HDCP_NONE"

disable_analog_output

Boolean

Determines whether analog output is allowed.

Valid values are:

  • True: Disallows analog output.
  • False: Allows analog output.

Default value:

"disable_analog_output": False

cgms_flags

String

Determines whether Copy Generation Management System (CGMS) is required.

Do not specify this parameter for desktop browser platforms.

Valid values for cgms_flags are:

  • CGMS_NONE: A single generation of copies has been made, but no additional copying is allowed.
  • COPY_FREE: Allows unlimited copies.
  • COPY_ONCE: Allows a single generation of copies.
  • COPY_NEVER: Disallows copying.

Default value:

"cgms_flags": "CGMS_NONE"

hdcp_srm_rule

String

Determines whether the device will be required to support a specific version of a System Renewability Message (SRM).

Valid values are:

  • HDCP_SRM_RULE_NONE: The device is not required to have a specific version of the SRM.
  • CURRENT_SRM: Disallow the Content Key if the device has an older SRM and cannot support SRM updates.

Default value:

"hdcp_srm_rule": "HDCP_SRM_RULE_NONE"

security_level

Integer

Determines the minimum security requirements for performing cryptography, content decoding, and media operations.

Valid values are:

  • 1: Requires software-based white-box cryptography.
  • 2: Requires software-based white-box cryptography and an obfuscated decoder.
  • 3: Requires a hardware-backed Trusted Execution Environment (TEE) for key material and cryptography.
  • 4: Requires a hardware-backed TEE for cryptography and content decoding.
  • 5: Requires a hardware-backed TEE for cryptography, content decoding, and all compressed and uncompressed media operations.

Security levels 3, 4, and 5 require HDCP to be set via required_output_protection's hdcp key-value pair.

Default value:

1

track_type

String

Determines the scope of the policy by track type.

Valid values are:

  • SD: Applies the policy to standard definition (576p or less) tracks.
  • HD: Applies the policy to high-definition (720p and 1080p) tracks.
  • AUDIO: Applies the policy to audio tracks.
  • UHD1: Applies the policy to 4K ultra-high-definition video tracks.
  • UHD2: Applies the policy to 8K ultra-high-definition video tracks.
  • ALL_VIDEO: Applies the policy to all tracks with the exception of the audio track.
  • ALL: Applies the policy to all tracks.

Default value:

ALL

Microsoft PlayReady

The playready dictionary describes resolution-specific Microsoft PlayReady DRM policies.

Name

Data Type

Description

can_persist

Boolean

Determines whether offline playback is allowed.

Default value:

False

can_play

Boolean

Determines whether playback is allowed.

Default value:

True

hd

Dictionary

Contains the DRM policy for high definition (720p and 1080p) tracks.

license_duration_seconds

Integer

Determines the length of time, in seconds, during which content playback is allowed.

This countdown starts upon license creation.

No further decryption is allowed upon license expiration.

Default value:

86400

playback_duration_seconds

Integer

Determines the length of time, in seconds, for which playback will be valid. This countdown starts after initial playback.

Use this parameter when setting up a policy for offline playback or license renewal.

Playback is unlimited when playback duration has not been specified.

Default value:

0

realtime_expiration

Boolean

Determines whether the current playback session will be stopped upon license expiration.

Valid values are:

  • True: Upon license expiration, the current playback session will be stopped.
  • False: The current playback session will continue if it was started prior to license expiration.

Default value:

True

sd

Dictionary

Contains the DRM policy for standard definition (576p or less) tracks.

uhd1

Dictionary

Contains the DRM policy for 4K ultra-high-definition video tracks.

uhd2

Dictionary

Contains the DRM policy for 8K ultra-high-definition video tracks.

Resolution Dictionary

Each of the above dictionaries contains the following parameters that describe the Microsoft PlayReady DRM policy for that resolution:

Name

Data Type

Description

analog_video_protection_level

Integer

Determines the minimum security requirements for the client's analog video outputs.

Valid values are:

  • 100: No security. This level allows the client to pass content to analog video outputs without restrictions.

    This security level is solely provided for testing purposes.

  • 150: A client must attempt to engage Copy Generation Management System - Analog (CGMS-A) CopyNever for analog video outputs. Regardless of CGMS-A, the client may pass content to analog video outputs.
  • 200: CGMS-A is required when a client passes content to analog video outputs.
  • 201: Prevents a client from passing content to analog video outputs.

Default value:

100

compressed_digital_audio_protection_level

Integer

Determines the minimum security requirements for passing compressed digital audio to the client's digital audio outputs.

Valid values are:

  • 100: No security. This level allows the client to pass compressed digital audio to digital audio outputs without restrictions.

    This security level is solely provided for testing purposes.

  • 301: Prevents a client from passing compressed digital audio to digital audio outputs.

Default value:

100

digital_video_protection_level

Integer

Determines the level of digital video protection that will be required.

Valid values are:

  • 100: Allows the client to pass content to digital video outputs.
  • 250: A client must attempt to engage HDCP for digital video outputs. Regardless of HDCP, the client may pass content to digital video outputs.
  • 270: A client must attempt to engage HDCP for digital video outputs. If HDCP cannot be engaged, the client may pass content to digital video outputs when the effective resolution is less than or equal to 520,000 pixels per frame.
  • 300: HDCP is required when a client passes content to digital video outputs.
  • 301: Prevents a client from passing content to digital video outputs.

The require_hdcp_type_1 parameter determines which version of HDCP will be enforced.

Default value:

100

play_enabler

Boolean

Determines whether playback will be allowed on a VM.

Use this parameter for testing purposes only. This setting determines whether a play enabler GUID will be passed to the PlayReady license server.

Default value:

false

require_hdcp_type_1

Boolean

Determines the version of HDCP that will be enforced on digital video outputs when digital_video_protection_level is set to "250" or higher.

Valid values are:

  • True: HDCP content type 1 (HDCP version 2.2 or later) is enforced. Streams may not be transmitted by the HDCP repeater to HDCP 1.x-compliant devices or HDCP2.0-compliant repeaters.
  • False: Allows any version of HDCP.

Default value:

False

security_level

Integer

Determines the minimum security requirements for the client device.

Valid values are:

  • 150: No security.

    This security level is solely provided for testing purposes.

  • 2000: Use this security level for hardened devices and applications consuming commercial content. Requires the protection of Assets, Client Secrets, or Content Secrets via software or hardware.
  • 3000: Use this security level for hardened devices with the highest security consuming the highest quality of commercial content.

    Devices Only: 

    Requires the protection of Assets, Client Secrets, and Content Secrets via hardware using a Trusted Execution Environment (TEE) for the processor.

Default value:

2000

uncompressed_digital_audio_protection_level

Integer

Determines the minimum security requirements for passing uncompressed digital audio to the client's digital audio outputs.

Valid values are:

  • 100: No security. This level allows the client to pass uncompressed digital audio to digital audio outputs without restrictions.

    This security level is solely provided for testing purposes.

  • 250: A client may pass uncompressed digital audio to digital audio outputs when either of the following conditions are true:

    • HDCP is engaged on HDMI, DisplayPort, or MHL.
    • SCMS is engaged and set to CopyNever.
  • 300: A client may only pass uncompressed digital audio to digital audio outputs when HDCP is engaged on HDMI, DisplayPort, or MHL.
  • 301: Prevents a client from passing uncompressed digital audio to digital audio outputs.

Default value:

100

Default Policy

Policy settings that are not explicitly set are defined according to the following default Studio DRM policy:

...
	'fairplay': {
		'key_duration_seconds': 0,
		'hd': {
			'hdcp_enforcement': -1,
			'allow_airplay': True,
			'allow_av_adapter': True
		},
		'persistence_duration_seconds': 0,
		'rental_duration_seconds': 0,
		'lease_duration_seconds': 0,
		'uhd2': {
			'hdcp_enforcement': -1,
			'allow_airplay': True,
			'allow_av_adapter': True
		},
		'uhd1': {
			'hdcp_enforcement': -1,
			'allow_airplay': True,
			'allow_av_adapter': True
		},
		'playback_duration_seconds': 0,
		'sd': {
			'hdcp_enforcement': -1,
			'allow_airplay': True,
			'allow_av_adapter': True
		},
		'rental': False,
		'persistence': False,
		'lease': False
	},
	'widevine': {
		'content_key_specs': [{
				'track_type': 'ALL',
				'required_output_protection': {
					'hdcp_srm_rule': 'HDCP_SRM_RULE_NONE',
					'hdcp': 'HDCP_NONE',
					'cgms_flags': 'CGMS_NONE',
					'disable_analog_output': False
				},
				'security_level': 1
			}
		],
		'policy_overrides': {
			'can_renew': False,
			'renewal_retry_interval_seconds': 0,
			'always_include_client_id': False,
			'license_duration_seconds': 86400,
			'can_persist': False,
			'can_play': True,
			'rental_duration_seconds': 0,
			'renewal_delay_seconds': 0,
			'renewal_recovery_duration_seconds': 0,
			'playback_duration_seconds': 0,
			'renew_with_usage': False
		}
	},
	'playready': {
		'license_duration_seconds': 86400,
		'can_persist': False,
		'realtime_expiration': True,
		'can_play': True,
		'uhd2': {
			'require_hdcp_type_1': False,
			'security_level': 2000,
			'play_enabler': False,
			'analog_video_protection_level': 100,
			'compressed_digital_audio_protection_level': 100,
			'uncompressed_digital_audio_protection_level': 100,
			'digital_video_protection_level': 100
		},
		'uhd1': {
			'require_hdcp_type_1': False,
			'security_level': 2000,
			'play_enabler': False,
			'analog_video_protection_level': 100,
			'compressed_digital_audio_protection_level': 100,
			'uncompressed_digital_audio_protection_level': 100,
			'digital_video_protection_level': 100
		},
		'playback_duration_seconds': 0,
		'hd': {
			'require_hdcp_type_1': False,
			'security_level': 2000,
			'play_enabler': False,
			'analog_video_protection_level': 100,
			'compressed_digital_audio_protection_level': 100,
			'uncompressed_digital_audio_protection_level': 100,
			'digital_video_protection_level': 100
		},
		'sd': {
			'require_hdcp_type_1': False,
			'security_level': 2000,
			'play_enabler': False,
			'analog_video_protection_level': 100,
			'compressed_digital_audio_protection_level': 100,
			'uncompressed_digital_audio_protection_level': 100,
			'digital_video_protection_level': 100
		}
	}
...

Update Policy Sample Scenario

In this scenario, a Studio DRM policy starts off with the following Microsoft PlayReady settings:

...
	"playready": {
		"license_duration_seconds": 43200,
		"can_persist": true,
		"can_play": true,
		"playback_duration_seconds": 50,
		"sd": {			
			"require_hdcp_type_1": false,
			"security_level": 2000,
			"play_enabler": false,
			"digital_video_protection_level": 100
	},
...	

The policy is then updated as indicated below.

...
	"playready": {
		"license_duration_seconds": 50000
...	

The above playready dictionary is missing various settings. Although those settings have been previously defined, they will now be overwritten by the corresponding default settings. As a result, the Microsoft PlayReady configuration will be defined as indicated below.

...
	'playready': {
		'license_duration_seconds': 50000,
		'can_persist': False,
		'realtime_expiration': True,
		'can_play': True,
		'uhd2': {
			'digital_video_protection_level': 100,
			'analog_video_protection_level': 100,
			'compressed_digital_audio_protection_level': 100,
			'security_level': 2000,
			'uncompressed_digital_audio_protection_level': 100,
			'require_hdcp_type_1': False,
			'play_enabler': False
		},
		'uhd1': {
			'digital_video_protection_level': 100,
			'analog_video_protection_level': 100,
			'compressed_digital_audio_protection_level': 100,
			'security_level': 2000,
			'uncompressed_digital_audio_protection_level': 100,
			'require_hdcp_type_1': False,
			'play_enabler': False
		},
		'license_begin_seconds': 3600,
		'playback_duration_seconds': 0,
		'hd': {
			'digital_video_protection_level': 100,
			'analog_video_protection_level': 100,
			'compressed_digital_audio_protection_level': 100,
			'security_level': 2000,
			'uncompressed_digital_audio_protection_level': 100,
			'require_hdcp_type_1': False,
			'play_enabler': False
		},
		'sd': {
			'digital_video_protection_level': 100,
			'analog_video_protection_level': 100,
			'compressed_digital_audio_protection_level': 100,
			'security_level': 2000,
			'uncompressed_digital_audio_protection_level': 100,
			'require_hdcp_type_1': False,
			'play_enabler': False
		}
	},
...

Get VMP Rejection Status Configuration

Retrieves the set of Verified Media Path (VMP) status(es) that will cause the rejection of a license request.

Please refer to Widevine License SDK documentation for more information on VMP status.

Request

Request syntax:

GET /drm/vmp-reject-statuses

Authentication

Pass a digital signature based off of msg.

Learn more.

Response

The response for a successful request contains the following parameters:

Name

Data Type

Description

vmp_reject_statuses

List of string values

Contains all of the VMP statuses that will cause the rejection of a license request.

error

Integer

Indicates whether an error occurred.

Learn more.

Sample Request/Response

Call the get_vmp_rejection_status_configuration module (Python 3) to retrieve your VMP status configuration. This module imports names from the api_auth module.

import requests
from api_auth import APICredentials, APIParams
 
class VMPStatus:
    def __init__(self):
        self.host = "https://services.uplynk.com"
 
    def run(self):
        """
        Retrieve VMP status configuration.
        """
        self._get_vmp_status_configuration()
 
    def _get_vmp_status_configuration(self):
        url = "{}{}".format(self.host, "/api/v3/drm/vmp-reject-statuses")
 
        response = requests.get(
            url, params=APIParams(APICredentials()).get_params({})
        )
 
        print(response.json())
 
VMPStatus().run()

Response:

{
	'vmp_reject_statuses': [],
	'error': 0
}

Update VMP Rejection Status Configuration

Defines the set of Verified Media Path (VMP) status(es) that will cause the rejection of a license request.

Please refer to Widevine License SDK documentation for more information on VMP status.

Request

Request syntax:

POST /drm/vmp-reject-statuses/update

Request body parameters:

Pass the following request body parameters:

Name

Data Type

Description

vmp_reject_statuses

List of string values

Contains all of the VMP statuses that will cause the rejection of a license request.

Authentication

Pass a digital signature based off of msg.

Learn more.

Response

The response for a successful request contains the following parameters:

Name

Data Type

Description

vmp_reject_statuses

List of string values

Contains all of the VMP statuses that will cause the rejection of a license request.

error

Integer

Indicates whether an error occurred.

Learn more.

Sample Request/Response

Call the update_vmp_rejection_status_configuration module (Python 3) to update your VMP status configuration. This module imports names from the api_auth module.

import requests
from api_auth import APICredentials, APIParams
 
class VMPStatusUpdate:
    def __init__(self):
        self.host = "https://services.uplynk.com"
 
    def run(self):
        """
        Updates the set of VMP rejection statuses.
        """
        self._update_vmp_status_configuration()
 
    def _update_vmp_status_configuration(self):

        vmp_data = dict()
        url = "{}{}".format(self.host, "/api/v3/drm/vmp-reject-statuses/update")
 
        new_vmp_data = {
            'vmp_reject_statuses': ['PLATFORM_UNVERIFIED']
        }
 
        vmp_data['item'] = new_vmp_data
 
        response = requests.post(
            url, data=APIParams(APICredentials()).get_params(vmp_data)
            )
 
        print(response.json())

VMPStatusUpdate().run()

Response:

{
	"vmp_reject_statuses": [
		"PLATFORM_UNVERIFIED"
	],
	"error": 0
}

Get Static Encryption Key Status

Indicates whether the content generated by all Live Slicers will be encrypted using a static encryption key.

Request

Request syntax:

GET /drm/use-static-encryption-key

Authentication

Pass a digital signature based off of msg.

Learn more.

Response

The response for a successful request contains the following parameters:

Name

Data Type

Description

use_static_encryption_key

Boolean

Returns True if your content may be encrypted using a static encryption key.

owner

String

Indicates your user IDA user ID uniquely identifies a user account via an alpanumeric system-defined ID..

error

Integer

Indicates whether an error occurred.

Learn more.

Sample Request/Response

Call the get_static_encryption_key_status module (Python 3) to find out whether you may encrypt your content using a static encryption key. This module imports names from the api_auth module.

import requests
from api_auth import APICredentials, APIParams
 
class StaticEncryptionKeyStatus:
    def __init__(self):
        self.host = "https://services.uplynk.com"
 
    def run(self):
        """
        Returns whether content may be encrypted using a static encryption key.
        """
        self._get_status_encryption_key_status()
 
    def _get_status_encryption_key_status(self):
        url = "{}{}".format(self.host, "/api/v3/drm/use-static-encryption-key")
 
        response = requests.get(
            url, params=APIParams(APICredentials()).get_params({})
        )
 
        print(response.json())
 
StaticEncryptionKeyStatus().run()

Response:

{
	"use_static_encryption_key": true,
	"owner": "111222333444555666",
	"error": 0
}

Update Static Encryption Key Status

Determines whether the content generated by all Live Slicers will be encrypted using a static encryption key.

The use of a static encryption key does not affect your license acquisition workflow. However, it does mean that the same encryption key will be used until it is rotated. Use the Create / Update Static Encryption Key Rotation Schedule endpoint to define a schedule for key rotation.

Use a static encryption key when your playback platform does not support the use of multiple dynamic encryption keys.

Which endpoint should I use to configure static encryption key usage?

Set up your static encryption key configuration according to the scope to which it will be applied.

Scope Procedure

All Live Slicers

Call the Update Static Encryption Key Status endpoint to set use_static_encryption_key to true.

Specific Live Slicers

  1. Call the Update Static Encryption Key Live Slicers endpoint to identify the desired Live Slicers.
  2. Call the Update Static Encryption Key Status endpoint to set use_static_encryption_key to false.

No Live Slicers

  1. Call the Update Static Encryption Key Status endpoint to set use_static_encryption_key to false.
  2. Call the Update Static Encryption Key Live Slicers endpoint to set static_key_slicer_ids to an empty list.

Request

Request syntax:

POST /drm/use-static-encryption-key/update

Request body parameters:

Pass the following request body parameters:

Name

Data Type

Description

use_static_encryption_key

Boolean

Determines whether your content may be encrypted using a static encryption key.

Authentication

Pass a digital signature based off of msg.

Learn more.

Response

The response for a successful request contains the following parameters:

Name

Data Type

Description

use_static_encryption_key

Boolean

Returns True if your content may be encrypted using a static encryption key.

owner

String

Indicates your user IDA user ID uniquely identifies a user account via an alpanumeric system-defined ID..

error

Integer

Indicates whether an error occurred.

Learn more.

Sample Request/Response

Call the update_static_encryption_key_status module (Python 3) to configure whether you may encrypt your content using a static encryption key. This module imports names from the api_auth module.

import requests
from api_auth import APICredentials, APIParams
 
class StaticEncryptionKeyStatusUpdate:
    def __init__(self):
        self.host = "https://services.uplynk.com"
 
    def run(self):
        """
        Updates whether content may be encrypted using a static encryption key.
        """
        self._update_status_encryption_key_status()
 
    def _update_status_encryption_key_status(self):

        static_encryption_key_status = dict()
        url = "{}{}".format(self.host, "/api/v3/drm/use-static-encryption-key/update")
 
        new_static_encryption_key_status = {
            'use_static_encryption_key': True
        }
 
        static_encryption_key_status['item'] = new_static_encryption_key_status
 
        response = requests.post(
            url, data=APIParams(APICredentials()).get_params(static_encryption_key_status) 
            )
 
        print(response.json())

StaticEncryptionKeyStatusUpdate().run()

Response:

{
	"use_static_encryption_key": true,
	"owner": "111222333444555666",
	"error": 0
}

Get Static Encryption Key Live Slicers

Retrieve the set of Live Slicers for which content will be encrypted using a static encryption key.

A static encryption key should only be used when your playback platform does not support the use of multiple dynamic encryption keys.

Request

Request syntax:

GET /drm/static-key-slicer-ids

Authentication

Pass a digital signature based off of msg.

Learn more.

Response

The response for a successful request contains the following parameters:

Name

Data Type

Description

static_key_slicer_ids

List of string values

Returns each Live Slicer whose content will be encrypted using a static encryption key. Each Live Slicer is identified by its ID as defined by the slicerID setting in the Live Slicer's configuration file.

owner

String

Indicates your user IDA user ID uniquely identifies a user account via an alpanumeric system-defined ID..

error

Integer

Indicates whether an error occurred.

Learn more.

Sample Request/Response

Call the get_static_encryption_key_live_slicers module (Python 3) to find out the set of Live Slicers whose content will be encrypted using a static encryption key. This module imports names from the api_auth module.

import requests
from api_auth import APICredentials, APIParams
 
class LiveSlicersStaticEncryptionKey:
    def __init__(self):
        self.host = "https://services.uplynk.com"
 
    def run(self):
        """
        Retrieves the set of Live Slicers whose content will be encrypted using a static encryption key.
        """
        self._get_live_slicers_by_status_encryption_key_status()
 
    def _get_live_slicers_by_status_encryption_key_status(self):
        url = "{}{}".format(self.host, "/api/v3/drm/static-key-slicer-ids")
 
        response = requests.get(
            url, params=APIParams(APICredentials()).get_params({})
        )
 
        print(response.json())
 
LiveSlicersStaticEncryptionKey().run()

Response:

{
	"static_key_slicer_ids": None,
	"owner": "111222333444555666",
	"error": 0
}

Update Static Encryption Key Live Slicers

Determines the set of Live Slicers whose content will be encrypted using a static encryption key.

The use of a static encryption key does not affect your license acquisition workflow. However, it does mean that the same encryption key will be used until it is rotated. Use the Create / Update Static Encryption Key Rotation Schedule endpoint to define a schedule for key rotation.

Use a static encryption key when your playback platform does not support the use of multiple dynamic encryption keys.

Which endpoint should I use to configure static encryption key usage?

Set up your static encryption key configuration according to the scope to which it will be applied.

Scope Procedure

All Live Slicers

Call the Update Static Encryption Key Status endpoint to set use_static_encryption_key to true.

Specific Live Slicers

  1. Call the Update Static Encryption Key Live Slicers endpoint to identify the desired Live Slicers.
  2. Call the Update Static Encryption Key Status endpoint to set use_static_encryption_key to false.

No Live Slicers

  1. Call the Update Static Encryption Key Status endpoint to set use_static_encryption_key to false.
  2. Call the Update Static Encryption Key Live Slicers endpoint to set static_key_slicer_ids to an empty list.

Request

Request syntax:

POST /drm/static-key-slicer-ids/update

Request body parameters:

Pass the following request body parameters:

Name

Data Type

Description

static_key_slicer_ids

List of string values

Determines the set of Live Slicers whose content will be encrypted using a static encryption key. Identify each desired Live Slicer by passing its ID as a string value.

Authentication

Pass a digital signature based off of msg.

Learn more.

Response

The response for a successful request contains the following parameters:

Name

Data Type

Description

static_key_slicer_ids

List of string values

Returns each Live Slicer whose content will be encrypted using a static encryption key. Each Live Slicer is identified by its ID as defined by the slicerID setting in the Live Slicer's configuration file.

owner

String

Indicates your user IDA user ID uniquely identifies a user account via an alpanumeric system-defined ID..

error

Integer

Indicates whether an error occurred.

Learn more.

Sample Request/Response

Call the update_static_encryption_key_live_slicers module (Python 3) to define the set of Live Slicers whose content will be encrypted using a static encryption key. This module imports names from the api_auth module.

import requests
from api_auth import APICredentials, APIParams
 
class StaticEncryptionKeyLiveSlicersUpdate:
    def __init__(self):
        self.host = "https://services.uplynk.com"
 
    def run(self):
        """
        Defines the set of Live Slicers whose content will be encrypted using a static encryption key.
        """
        self._update_live_slicers()
 
    def _update_live_slicers(self):

        live_slicers = dict()
        url = "{}{}".format(self.host, "/api/v3/drm/static-key-slicer-ids/update")
 
        new_live_slicers = {
            'static_key_slicer_ids': ['liveslicer1', 'liveslicer2']
        }
 
        live_slicers['item'] = new_live_slicers
 
        response = requests.post(
            url, data=APIParams(APICredentials()).get_params(live_slicers) 
            )
 
        print(response.json())

StaticEncryptionKeyLiveSlicersUpdate().run()

Response:

{
	"static_key_slicer_ids": [
		"liveslicer1",
		"liveslicer2"
	],
	"owner": "111222333444555666",
	"error": 0
}

Get Static Encryption Key Rotation Schedule

Retrieve your key rotation schedule.

Request

Request syntax:

GET /api/v3/drm/key-rotation-schedule

Authentication

Pass a digital signature based off of msg.

Learn more.

Response

The response for a successful request contains the following parameters:

Name

Data Type

Description

key_rotation_schedule

Dictionary

Indicates the rotation schedule for your static encryption key.

owner

String

Identifies the CMS user associated with the policy by user IDA user ID uniquely identifies a user account via an alpanumeric system-defined ID..

error

Integer

Indicates whether an error occurred.

Learn more.

Sample Request/Response

Call the get_static_encryption_key_rotation_schedule module (Python 3) to retrieve a specific Studio DRM policy configuration. This module imports names from the api_auth module.

import requests
from api_auth import APICredentials, APIParams 
 
class KeyRotationSchedule:
    def __init__(self):
        self.host = "https://services.uplynk.com"
 
    def run(self):
        """
        Retrieve your key rotation schedule.
        """
        self._get_key_rotation_schedule()
 
    def _get_key_rotation_schedule(self):
        url = "{}{}".format(self.host, "/api/v3/drm/key-rotation-schedule")
 
        response = requests.get(
            url, params=APIParams(APICredentials()).get_params({})
        )
 
        print(response.json())
 
KeyRotationSchedule().run()

Response:

{
    'owner': 'abc33864a92b12a1a2a6cdg49b0a9534',
    'key_rotation_schedule': {
        '_id': '12770715bc29840c6h2fcc45b4c6463fc',
        'next_rotation': 1576470581706,
        'hour': 20,
        'created': 1571867701666,
        'enabled': True,
        'lmsig': '1571867701666284_11829_895',
        'frequency': 1,
        'lastmod': 1571867701666,
        'unit': 'd'
    },
    'error': 0
}

Update Static Encryption Key Rotation Schedule

Define the rotation schedule for your static encryption key.

Request

Request syntax:

POST /drm/key-rotation-schedule/create-or-update

Request body parameters:

Pass the following request body parameters:

Name

Data Type

Description
next_rotation

Integer

Determines the timestamp, in Unix time (milliseconds), for the first scheduled static encryption key rotation.

enabled

Boolean

Determines whether your static encryption key will be rotated. Valid values are:

true | false

frequency

Integer

Determines how often your static encryption key will be rotated.

unit

String

Indicates the units for the frequency property. Valid values are:

  • d: Days
  • m: Months

hour

Integer

Indicates the time (UTC) at which your static encryption key will be rotated. Specify a value between 0 and 23.

Authentication

Pass a digital signature based off of msg.

Learn more.

Response

The response for a successful request contains the following parameters:

Name

Data Type

Description

key_rotation_schedule

Dictionary

Indicates the rotation schedule for your static encryption key.

owner

String

Identifies the CMS user associated with the policy by user IDA user ID uniquely identifies a user account via an alpanumeric system-defined ID..

error

Integer

Indicates whether an error occurred.

Learn more.

Sample Request/Response

Call the update_static_encryption_key_rotation_schedule module (Python 3) to define the set of Live Slicers whose content will be encrypted using a static encryption key. This module imports names from the api_auth module.

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

    def run(self):
        """
        Define a rotation schedule for your static encryption key.
        """
        self._update_krs()

    def _update_krs(self):
 
        krs_data = dict()
        url = "{}{}".format(self.host, "/api/v3/drm/key-rotation-schedule/create-or-update")

        new_krs_data = {
            'next_rotation': 1576470581706,
            'enabled': True,
            'frequency': 1,
            'unit': 'd',
            'hour': 20
        }

        krs_data['item'] = new_krs_data

        response = requests.post(
            url, data=APIParams(APICredentials()).get_params(krs_data)
        )

        print(response.json())

UseStaticEncryptionKeyUpdate().run()

Response:

{
    'owner': 'abc33864a92b12a1a2a6cdg49b0a9534',
    'key_rotation_schedule': {
        '_id': '12770715bc29840c6h2fcc45b4c6463fc',
        'next_rotation': 1576470581706,
        'hour': 20,
        'created': 1571867701666,
        'enabled': True,
        'lmsig': '1571940150453652_6503_3566',
        'frequency': 1,
        'lastmod': 1571940150453,
        'unit': 'd'
    },
    'error': 0
}

key_rotation_schedule Dictionary

The key_rotation_schedule dictionary describes the rotation schedule for your static key encryption.

Name

Data Type

Description
_id String Identifies this static encryption key schedule via a system-defined ID.
created Integer Indicates the timestamp, in Unix time (milliseconds), for the creation of this static encryption key rotation schedule.

enabled

Boolean

Indicates whether your static encryption key will be rotated. Valid values are:

true | false

err_count

Integer

Indicates the number of consecutive static encryption key failures. This property returns 0 if the last attempt to rotate your static encryption key was successful.

err_msg

String

Indicates the error message for the last time that the static encryption key rotation failed.

frequency

Integer

Indicates how often your static encryption key will be rotated.

hour

Integer

Indicates the time (UTC) at which your static encryption key will be rotated. Specify a value between 0 and 23.

last_err

Integer

Indicates the timestamp, in Unix time (milliseconds), for the last time that the static encryption key rotation failed.

last_rotation

Integer

Indicates the timestamp, in Unix time (milliseconds), for the last time that the static encryption key rotation succeeded.

lastmod Integer Indicates the timestamp, in Unix time (milliseconds), for the last update to this static encryption key rotation schedule.

lmsig

String

This parameter is reserved for future use.

next_rotation

Integer

Indicates the timestamp, in Unix time (milliseconds), for the next scheduled static encryption key rotation.

unit

String

Indicates the units for the frequency property. Valid values are:

  • d: Days
  • m: Months
More Information