PallyCon multi-DRM Packaging Callback Gateway API

Overview

PallyCon cloud server requests customer's service site for the identity value of the content during the packaging process for content encryption. The service site can set the content ID through the callback gateway web page.

Note

The callback gateway is not used when directly inputting CID as an execution parameter of CLI packager or when packaging multi-DRM contents (DASH, HLS) separately without integrating with PallyCon cloud (manual method). In these cases, setting the packaging callback gateway is unnecessary.

This document describes the callback gateway API specification for Content ID (CID) requests when packaging.

Content ID request workflow

package workflow

  1. Run packager

    • service site's admin runs PallyCon DRM Packager to encrypt content.
  2. Request Pack info

    • Packager requests PallyCon cloud server for encryption key which is used for content packaging.
  3. Request Content ID

    • PallyCon cloud server requests service site for Content ID through callback gateway page on the site.
  4. Respond Content ID

    • Service site's gateway page responds Content ID using the content's filename and path info.
  5. Respond Pack info

    • PallyCon cloud server responds pack info (Content ID and key) to packager.

Packaging Callback API (JSON type)

Request data spec

  • Request URI : requested at the URL which is registered in the 'CID Issue Page URL' setting on the PallyCon Admin site.
  • Request Method : POST
  • Chracter set : UTF-8
  • POST body : request parameters
Key Value
data base64 Encoding ( aes256 Encrypt ( JSON Data string ) )

* refer to AES256 Encryption section

JSON Data Format

{
    "file_name": "File name",
    "file_path": "File path",
    "nonce": "Random String"
}
Name Value Description
file_name string name of the content file
file_path string path of the content file
nonce string One time Random String. It should be the same string as in the response data.

Response data spec

  • body : base64 Encoding ( aes256 Encrypt ( JSON Data string ) )

JSON Data Format

{
    "error_code": "Error Code",
    "error_message": "Error Message",
    "cid": "Content ID",
    "nonce": "Random String"
}
Name Value Description
error_code string Success:"0000", Fail: error code of the failure (defined by the service site)
error_message string detailed message of the error
cid string Unique ID of the content file (max 200 byte)
nonce string One time Random String. Is should be the same string as in the request data.

JSON Example

Request data

{
    "file_name": "sample_content1.mp4",
    "file_path": "d:\content\lecture1\sample_content1.mp4",
    "nonce": "3426u3050329384g"
}

Response data

{  
    "error_code": "0000",
    "error_message": "success",
    "cid": "con-sample-123",
    "nonce": "3426u3050329384g"
}

Packaging Callback API (XML type old version)

Request data spec

  • Request URI : requested at the URL which is registered in the 'CID Issue Page URL' setting on the PallyCon Admin site.
  • Request Method : POST
  • Chracter set : UTF-8
  • POST body : request parameters
Key Value
data base64 Encoding ( aes256 Encrypt ( XML Data string ) )

* refer to AES256 Encryption section

XML Data Format

<?xml version='1.0' encoding='utf-8'?>
<RES>
    <FILENAME>File Name</FILENAME>
    <FILEPATH>File Path</FILEPATH>
    <NONCE>Random String</NONCE>
</RES>
Name Value Description
FILENAME string name of the content file
FILEPATH string path of the content file
NONCE string One time Random String. It should be the same string as in the response data.

Response data spec

  • body : base64 Encoding ( aes256 Encrypt ( XMLData string ) )

XML Data Format

<?xml version='1.0' encoding='utf-8'?>
<RES>
    <ERROR>Error Code</FILENAME>
    <ERRMSG>Error Message</FILEPATH>
    <CID>Content ID</CID>
    <NONCE>Random String</NONCE>
</RES>
Name Value Description
ERROR string Success:"0000", Fail: error code of the failure (defined by the service site)
ERRMSG string detailed message of the error
CID string Unique ID of the content file (max 200 byte)
NONCE string One time Random String. Is should be the same string as in the request data.

XML Example

Request data

<?xml version='1.0' encoding='utf-8'?>
<RES>
    <FILENAME>sample_content1.mp4</FILENAME>
    <FILEPATH>d:\content\lecture1\sample_content1.mp4</FILEPATH>
    <NONCE>3426u3050329384g</NONCE>
</RES>

Response data

<?xml version='1.0' encoding='utf-8'?>
<RES>
    <ERROR>0000</FILENAME>
    <ERRMSG>Success</FILEPATH>
    <CID>con-sample-123</CID>
    <NONCE>3426u3050329384g</NONCE>
</RES>

AES256 Encryption

AES256 Encryption
- mode : CBC
- key : 32 byte (Site key from PallyCon Admin site)
- iv : 16 byte (0123456789abcdef)
- padding : pkcs7

AES256 Encryption/Decryption should be processed as below using site authentication key which is created by ‘Service Request’ on PallyCon Admin site. ( The key can be found on PallyCon Admin’s settings page )


results matching ""

    No results matching ""