Create – Media API – MediaKind
Create
put https://app.mk.io/api/v1/projects/:project_name/media/contentKeyPolicies/:policy_name
Create a Content Key Policy
RBAC Capability Required: ams.contentkeypolicy.create
Authentication
Authorization Bearer
Bearer authentication of the form Bearer <token>, where token is your auth token.
Path parameters
project_namestringRequired
policy_namestringRequired
Request
This endpoint expects an object.
propertiesobject ContentKeyPolicyPutProperties Required
The key policy
Show 3 propertiesHide 3 properties
descriptionstringOptional0-1024 characters
A description for the Policy.
fairPlayAmsCompatibilitybooleanOptional
FairPlay AMS compatibility enabled.
optionslist of objects ContentKeyPolicyOption Required
The Key Policy options.
Show 4 propertiesHide 4 properties
configurationobjectRequired
The key delivery configuration.
Show 5 variantsHide 5 variants
Discriminated by @odata.type. Select one variant:
#Microsoft.Media.ContentKeyPolicyClearKeyConfigurationobject ContentKeyPolicyClearKeyConfiguration
Represents a configuration for non-DRM keys.
@odata.typestringRequired
The discriminator for derived types.
#Microsoft.Media.ContentKeyPolicyFairPlayConfigurationobject ContentKeyPolicyFairPlayConfiguration
Specifies a configuration for FairPlay licenses.
@odata.typestringRequired
The discriminator for derived types.
askstring or nullRequiredformat: byte
The key that must be used as FairPlay Application Secret key. This needs to be base64 encoded.
fairPlayPfxstring or nullRequired
The Base64 representation of FairPlay certificate in PKCS 12 (pfx) format (including private key).
fairPlayPfxPasswordstring or nullRequired
The password encrypting FairPlay certificate in PKCS 12 (pfx) format.
offlineRentalConfigurationobject ContentKeyPolicyFairPlayOfflineRentalConfiguration Optional
Offline rental policy
Show 2 propertiesHide 2 properties
playbackDurationSecondsintegerRequired
Playback duration
storageDurationSecondsintegerRequired
Storage duration
rentalAndLeaseKeyTypeenumRequired
The rental and lease key type.
Allowed values:UnknownUndefinedDualExpiryPersistentUnlimitedPersistentLimited
rentalDurationintegerRequired
The rental duration. Must be greater than or equal to 0.
#Microsoft.Media.ContentKeyPolicyPlayReadyConfigurationobject ContentKeyPolicyPlayReadyConfiguration
Specifies a configuration for PlayReady licenses.
@odata.typestringRequired
The discriminator for derived types.
licenseslist of objects ContentKeyPolicyPlayReadyLicense Required
The PlayReady licenses.
Show 11 propertiesHide 11 properties
allowTestDevicesbooleanRequired
A flag indicating whether test devices can use the license.
beginDatestringOptionalformat: date-time
The begin date of license
contentKeyLocationobjectRequired
The content key location.
Show 2 variantsHide 2 variants
Discriminated by @odata.type. Select one variant:
#Microsoft.Media.ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeaderobject ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader
Specifies that the content key ID is in the PlayReady header.
@odata.typestringRequired
The discriminator for derived types.
#Microsoft.Media.ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifierobject ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier
Specifies that the content key ID is specified in the PlayReady configuration.
@odata.typestringRequired
The discriminator for derived types.
keyIdstring or nullRequiredformat: uuid
The content key ID.
contentTypeenumRequired
The PlayReady content type.
Allowed values:UnknownUnspecifiedUltraVioletDownloadUltraVioletStreaming
expirationDatestringOptionalformat: date-time
The expiration date of license.
gracePeriodstringOptionalformat: duration
The grace period of license.
licenseTypeenumRequired
The license type.
Allowed values:UnknownNonPersistentPersistent
playRightobject ContentKeyPolicyPlayReadyPlayRight Optional
The license PlayRight
Show 13 propertiesHide 13 properties
agcAndColorStripeRestrictionintegerOptional0 to 3
Configures Automatic Gain Control (AGC) and Color Stripe in the license. Must be between 0 and 3 inclusive.
allowPassingVideoContentToUnknownOutputenumRequired
Configures Unknown output handling settings of the license.
Allowed values:UnknownNotAllowedAllowedAllowedWithVideoConstriction
digitalVideoOnlyContentRestrictionbooleanRequired
Enables the Image Constraint For Analog Component Video Restriction in the license.
explicitAnalogTelevisionOutputRestrictionobject ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction Optional
Configures the Explicit Analog Television Output Restriction in the license. Configuration data must be between 0 and 3 inclusive.
Show 2 propertiesHide 2 properties
bestEffortbooleanRequired
Indicates whether this restriction is enforced on a Best Effort basis.
configurationDataintegerRequired0 to 3
Configures the restriction control bits. Must be between 0 and 3 inclusive.
firstPlayExpirationstringOptionalformat: duration
The amount of time that the license is valid after the license is first used to play content.
imageConstraintForAnalogComponentVideoRestrictionbooleanRequired
Enables the Image Constraint For Analog Component Video Restriction in the license.
imageConstraintForAnalogComputerMonitorRestrictionbooleanRequired
Enables the Image Constraint For Analog Component Video Restriction in the license.
uncompressedDigitalAudioOplintegerOptional
Specifies the output protection level for uncompressed digital audio.
securityLevelenumOptional
The security level.
Allowed values:UnknownSL150SL2000SL3000
Response
201Create a Content Key Policy
idstringOptional
Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
namestringOptional1-260 characterspattern: ^[^\^\'<>%&:\?/*+]+$
The name of the resource
propertiesobject ContentKeyPolicyProperties Required
The key policy
Show 6 propertiesHide 6 properties
createdstringOptionalformat: date-time
The creation date of the Policy
descriptionstringOptional0-1024 characters
A description for the Policy.
fairPlayAmsCompatibilitybooleanOptional
FairPlay AMS compatibility enabled.
lastModifiedstringOptionalformat: date-time
The last modified date of the Policy
optionslist of objects ContentKeyPolicyOption Required
The Key Policy options.
Show 4 propertiesHide 4 properties
configurationobjectRequired
The key delivery configuration.
Show 5 variantsHide 5 variants
Discriminated by @odata.type. Select one variant:
Represents a configuration for non-DRM keys.
@odata.typestringRequired
The discriminator for derived types.
Specifies a configuration for FairPlay licenses.
@odata.typestringRequired
The discriminator for derived types.
askstring or nullRequiredformat: byte
The key that must be used as FairPlay Application Secret key. This needs to be base64 encoded.
fairPlayPfxstring or nullRequired
The Base64 representation of FairPlay certificate in PKCS 12 (pfx) format (including private key).
fairPlayPfxPasswordstring or nullRequired
The password encrypting FairPlay certificate in PKCS 12 (pfx) format.
Specifies a configuration for PlayReady licenses.
@odata.typestringRequired
The discriminator for derived types.
The PlayReady licenses.
Show 11 propertiesHide 11 properties
allowTestDevicesbooleanRequired
A flag indicating whether test devices can use the license.
keyIdstring or nullRequiredformat: uuid
The content key ID.
contentTypeenumRequired
The PlayReady content type.
Allowed values:UnknownUnspecifiedUltraVioletDownloadUltraVioletStreaming
expirationDatestringOptionalformat: date-time
The expiration date of license.
#Microsoft.Media.ContentKeyPolicyWidevineConfigurationobject ContentKeyPolicyWidevineConfiguration
Specifies a configuration for Widevine licenses.
@odata.typestringRequired
The discriminator for derived types.
widevineTemplatestringRequired
The Widevine template.
restrictionobjectRequired
The requirements that must be met to deliver keys with this configuration
Show 3 variantsHide 3 variants
Discriminated by @odata.type. Select one variant:
#Microsoft.Media.ContentKeyPolicyOpenRestrictionobject ContentKeyPolicyOpenRestriction
Represents an open restriction. License or key will be delivered on every request.
@odata.typestringRequired
The discriminator for derived types.
#Microsoft.Media.ContentKeyPolicyTokenRestrictionobject ContentKeyPolicyTokenRestriction
Represents a token restriction. Provided token must match these requirements for successful license or key delivery.
@odata.typestringRequired
The discriminator for derived types.
#Microsoft.Media.ContentKeyPolicyUnknownRestrictionobject ContentKeyPolicyUnknownRestriction
Represents a ContentKeyPolicyRestriction that is unavailable in the current API version.
@odata.typestringRequired
The discriminator for derived types.
Errors
400Bad Request
errorobject ErrorDetail Required
Pertinent information about the error
Show 3 propertiesHide 3 properties
codestringRequired
The error code.
detailstringRequired
The error message.
refstringRequired
A reference to the request that caused the error.
statusintegerRequired
The HTTP status code
401Unauthorized
errorobject ErrorDetail Required
Pertinent information about the error
Show 3 propertiesHide 3 properties
codestringRequired
The error code.
detailstringRequired
The error message.
refstringRequired
A reference to the request that caused the error.
statusintegerRequired
The HTTP status code
403Forbidden
errorobject ErrorDetail Required
Pertinent information about the error
Show 3 propertiesHide 3 properties
codestringRequired
The error code.
detailstringRequired
The error message.
refstringRequired
A reference to the request that caused the error.
statusintegerRequired
The HTTP status code
404Not Found
errorobject ErrorDetail Required
Pertinent information about the error
Show 3 propertiesHide 3 properties
codestringRequired
The error code.
detailstringRequired
The error message.
refstringRequired
A reference to the request that caused the error.
statusintegerRequired
The HTTP status code
500Internal Server Error
errorobject ErrorDetail Required
Pertinent information about the error
Show 3 propertiesHide 3 properties
codestringRequired
The error code.
detailstringRequired
The error message.
refstringRequired
A reference to the request that caused the error.
statusintegerRequired
The HTTP status code