POST /cxf/pri/v1/packagedassets
Asset packaging
The asset packaging APIs are used in some encoder integrations, like AWS MediaPackage, which requires an extra packaging step. We need the PRI client to send an HTTP POST request with a payload including all mandatory packaging requests fields (in particular the asset identifier (ID), pivot asset or harvested asset ID (source URI)) to the following URL:
http://<server>:<port>/<relative_path>/cxf/pri/v1/packagedassets
Packaging request headers
Header | Type | Description | Required value |
---|---|---|---|
Accept | String | application/json | Yes |
Content-Type | String | application/json | Yes |
Packaging query parameters
The query parameters must be empty.
Body
Attribute | Type | Description | Always present |
---|---|---|---|
| String | Public unique identifier of the packaged asset | Yes |
| String | The friendly name of the PackagedAsset, for display purposes | No |
| String |
| Yes |
| Integer | The priority of the PackagedAsset, 1 highest to 5 lowest | No |
| String | Identifier of the package requester | No |
| KeyValuePair | The metadata of the PackagedAsset | No |
| DrmTOType | Provides the DRM details to be used to secure the playable packaged asset for each of the packaging formats. Encoder dependent – if the encoder has its own independent configuration for defining DRM IDs (normally identical to the live streams), this object does not need to be provided. | No |
| PackagingInfoTOType | Provides the | No |
PackagingInfoTOType
Attribute | Type | Description | Always present |
---|---|---|---|
| String | Unique identifier of the packaging group | Yes |
| String | The friendly name of the PackagedAsset, for display purposes | No |
| KeyValuePair | The metadata of the Packaging System | No |
An example of a POST JSON payload:
{
"id":"ltcu_eventp1",
"sourceUri":"s3://s3.amazonaws.com/mediapackageBucket/GLOBAL_echpr01/",
"deliveryURL":null,
"metadata":[{"key":"destinationUri","value":"as3://s3.amazonaws.com/nagra-terminators-vod-output/videos/"}],
"packagingInfo":[{"packagingGroupId":"PackagingGroup1","packagingFormat":"HLS","metadata":[]}]
}
An example of a POST JSON payload with DRM details:
{
"id":"ltcu_eventp1",
"sourceUri":"s3://s3.amazonaws.com/mediapackageBucket/GLOBAL_echpr01/",
"deliveryURL":null,
"metadata":[{"key":"destinationUri","value":"as3://s3.amazonaws.com/nagra-terminators-vod-output/videos/"}],
"drm":[{"drmId":"drmId1","packagingFormat":"HLS","metadata":[]}],
"packagingInfo":[{"packagingGroupId":"PackagingGroup1","packagingFormat":"HLS","metadata":[]}]
}
Packaging success response
An HTTP 201 response occurs when a packaged asset is created.
Parameter | Type | Description | Always present |
---|---|---|---|
| String | Public unique identifier of the packaged asset | Yes |
| String | The friendly name of the CapturedAsset, for display purposes | No |
| String |
| No |
| Integer | The priority of the PackagedAsset, 1 highest to 5 lowest | No |
| The status of the PackagedAsset. The status is set by the recorder and cannot be set by a client request. The supported values are: Scheduled, InProgress, Completed, Failed, Cancelled, Expired | Yes | |
| String | Identifier of the package requester | No |
| String | The delivery URL of the PackagedAsset. Access to the asset via this URL can only be guaranteed after the packaged asset status is "Completed". | Yes |
| KeyValuePair | The metadata of the PackagedAsset | No |
| dateTime | The date request to package the asset was accepted by the PRI server.
| No |
| Array | Provides the DRM details to be used to secure the playable packaged asset for each of the packaging formats. Encoder dependent – if the encoder has its own independent configuration for defining DRM IDs (normally identical to the live streams), this object does not need to be provided. | NO |
| PackagingInfoTOType | Provides the | No |
An example of a POST success response payload with DRM details:
{
"id":"ltcu_eventp1",
"sourceUri":"s3://s3.amazonaws.com/mediapackageBucket/GLOBAL_echpr01/",
"status":"Completed"
"deliveryURL":"deliveryURL",
"created": "2014-11-06T14:39:57.007Z",
"metadata":[{"key":"destinationUri","value":"as3://s3.amazonaws.com/nagra-terminators-vod-output/videos/"}],
"drm":[{"drmId":"drmId1","packagingFormat":"HLS","metadata":[]}],
"packagingInfo":[{"packagingGroupId":"PackagingGroup1","packagingFormat":"HLS","metadata":[]}]
}
Error response
An HTTP 400 response occurs for a bad request.
An HTTP 500 response occurs when there is a PRI Adapter internal error (e.g., mandatory parameters are unspecified).
An HTTP 501 response occurs for method not implemented.
An HTTP 504 response occurs for encoder timeout.
An example error response for HTTP error code 504:
{
"statusCode": "504",
"statusMessage": "Internal Error ::Connection timed out to the Envivio Halo encoder::Connection refused"
}