PallyCon Service API Guide V2

Overview

Customers of PallyCon service can check various data such as content packaging and license issuance on PallyCon Web Console. But there are also cases that API-based data access is needed. So we provide PallyCon Service API to allow the customers integrate our server-side data with their system.

This document describes how to use the PallCon Service API V2 which was released in December 2021.

API Basics

PallyCon Service API uses JSON Web Token(JWT) for secure transmission of information.

You can create and test the token using an online JWT tool or a server-side programming language.

Service API JWT Specification
Service API JWT Specification

The token should be signed using an account-specific secret key with HMAC SHA256(HS256) algorithm. Please create a ticket on Helpdesk to get your Service API Key and the account seq value used in the token payload.

JWT Structure

As shown on the above image, an encoded JWT token has the following format:

base64UrlEncode(header) + "." + base64UrlEncode(payload) + "." + HS256 signature value

Payload Specification

The token uses json payload data as below example:

{
    "sub" : "PallyConAPI",
    "aud" : "INKA",
    "iss" : "PallyCon",
    "account_id" : "Your PallyCon account ID",
    "account_seq": "Your PallyCon account SEQ",
    "exp": 1583191411
}
Key Required Value
sub Y Fixed value as PallyConAPI
aud Y Fixed value as INKA
iss Y Fixed value as PallyCon
account_id Y Your account ID of PallyCon service
account_seq Y Your PallyCon account’s SEQ (can be requested via Helpdesk ticket)
exp N Expiration date of the token (type: date number)

SEQ is a key value used to index key data in PallyCon service API.

Common Response Specification

When calling the PallyCon Service API, you’ll get one of the HTTP status codes listed below.

HTTP Status Code Description
401 JWT Token specification is incorrect or the user information cannot be found
403 Do not have permission for the called API
200 HTTP communication success

When the HTTP status code is 200 (HTTP communication success), you’ll get the below response data in JSON format.

Key Type Value
error_code String 0000: Success / other numbers: failure
error_message String Shows the error message on failed request
data JSON Result of the successful API request

Account Management API

These APIs are for managing PallyCon service account and sites.

A site in PallyCon service means a service site of our customer where PallyCon solution is applied. A PallyCon account has one site by default, and additional sites can be added to an account if needed. (e.g. a reseller account with multiple customers) A site has a unique ID as four alphanumeric characters.

Get Site List

This API retrieves the list of sites under the PallyCon account.

Request

Parameter Type Required Description
Authorization Header Y Encoded JWT data
api_code String Y Fixed API code as UC011004100

Response.data

Key Type Description
site_id String Unique ID of the site (four alphanumeric characters)
service_name String Name of the service site
product_list Array Product List
product_list.[].service_code String Service code ( PD001 : DRM, PD002 : FWM )
product_list.[].status_code String Service Status (SE000 : In service, SE001 : Suspended )

Request Additional Service Site

This API requests additional service site for the account. (in case of multiple service sites in an account)

Request

Parameter Type Required Description
Authorization Header Y Encoded JWT data
api_code String Y API code value as UA010310200
service_name String Y Name of the additional service site

Response.data

Key Type Description
seq Int Sequence number of the request

Get Status of Additional Site Request

This API returns the status of request for additional service site.

Request

Parameter Type Required Description
Authorization Header Y Encoded JWT data
api_code String Y API code value as UA010310100
from String N Start date of the search (YYYY-MM-DD)
to String N End date of the search (YYYY-MM-DD)
req_status String N Status of the request
search_type String N Type of the search (account_id, site_id)
search_keyword String N Keyword for the search (used when search_type is set)
page_unit Int N Number of search result (default:25, max: 1000)
page_index Int N Index of result page when the results are more than page_unit

Response.data

Key Type Description
seq Int Sequence number of the request
account_id String ID of the service account
site_id String ID of the service site
service_name String Name of the service site
status String Status of the additional site request
update_time String Datetime of the status update
reg_time String Datetime of the request registration

Get Sub-member List

This API returns the list of sub-members in an account.

Request

Parameter Type Required Description
Authorization Header Y Encoded JWT data
api_code String Y API code value as UA010700200
page_unit Int N Number of search result (default:25, max: 1000)
page_index Int N Index of result page when the results are more than page_unit

Response.data

Key Type Description
group_name String The sub-member’s group name
group_seq Int Sequence number of the group (refer to the below table)
member_seq Int Sequence number of the sub-member
member_email String Email address of the sub-member
status_code String Status code (MT001: active member, MT002: inactive)
reg_date String Date of the sub-member registration (YYYY-MM-DD)
  • Group SEQ List
    Group seq Description
    1000 BIZ Group. Can access service usage history, integration information and payment related pages.
    1001 TS Group. Can access service usage history, integration information and SDK download pages.
    1014 Clients Group. Can access service usage history pages only.

Create Sub-member

This API creates a sub-member in an account.

Request

Parameter Type Required Description
Authorization Header Y Encoded JWT data
api_code String Y API code value as UA010700200
member_email String Y Email address of the sub-member
group_seq Int N Sequence number of a member group to set

Response.data

Key Type Description
member_seq Int Sequence number of the sub-member

Reset Password for Sub-member

This API resets password of a sub-member.

Request

Parameter Type Required Description
Authorization Header Y Encoded JWT data
api_code String Y API code value as UA010700200
member_seq Int Y Sequence number of the sub-member

Response

This API returns the default response data.

Update Sub-member Information

This API updates a sub-member’s information such as group and status.

Request

Parameter Type Required Description
Authorization Header Y Encoded JWT data
api_code String Y API code value as UA010700200
member_seq Int Y Sequence number of the sub-member
member_status String N Status code to apply (MT001: active, MT002: inactive)
group_seq Int N Sequence number of a member group to set

Response

This API returns the default response data.

Common Service API

Describes the service APIs that are common to multiple products in PallyCon service.

Get the status of a service status change request

This API returns the status of service status change request. (for the latest request)

Request

Parameter Type Required Description
Authorization Header Y Encoded JWT data
api_code String Y Fixed code of the API (UC011004100)
site_id PathVariable Y SITE ID
service_code String Y Service Code (PD001:DRM, PD002:FWM)

Response

Key Type Description
site_id String Site ID
req_group_id String Request ID (PK)
reg_type String Request Type Code
reg_message String Request Message
reg_status String Request Status (ST001: Request, ST002: Cancel, ST003:Approve)
reg_id String Register ID
reg_dt String Register Date (UTC +00:00 기준)
update_dt String Update Date (UTC +00:00 기준)

Request service status change

This API registers requests to change the status of product services.

Request

Parameter Type Required Description
Authorization Header Y Encoded JWT data
api_code String Y Fixed code of the API (UC011004100)
site_id PathVariable Y SITE ID
service_code String Y Service Code (PD001:DRM, PD002:FWM)
request_type String Y Request Type Code (SM001: service resume request, SM002: service suspension request, SM003: trial extension request)
request_message String N Request Message

Response.data

Key Type Description
site_id String Site ID
req_group_id String Request ID (PK)
reg_type String Request Type Code
reg_message String Request Message
reg_id String Register ID
reg_dt String Register Date (UTC +00:00)

Cancel service status change request

This API cancels the request for a change in the service status of the product.

Request

Parameter Type Required Description
Authorization Header Y Encoded JWT data
api_code String Y Fixed code of the API (UC011004100)
site_id PathVariable Y SITE ID
service_code String Y Service Code (PD001:DRM, PD002:FWM)
request_type String Y Request Type Code (SM004:Cancel Service Change Request)
request_group_id String Y Request ID (PK)

Response.data

Key Type Description
site_id String Site ID
req_group_id String Request ID (PK)
reg_type String Existing Request Type Code
reg_status String Request Status Code (ST001: Request, ST002: Cancel, ST003:Approve)
reg_message String Request Message
reg_id String Register ID
reg_dt String Register Date (UTC +00:00)
update_dt String Update Date (UTC +00:00)

DRM Service API

These APIs are for retrieving DRM-related data.

Get DRM License List

This API retrieves the list of each DRM license that was responded in a certain period.

Request

Parameter Type Required Description
Authorization Header Y Encoded JWT data
api_code String Y API code value (UA003001100)
site_id String Y The Site ID value shown on PallyCon Console
from String N Start date of the search (YYYY-MM-DD)
to String N End date of the search (YYYY-MM-DD)
search_status String N License issuance status (success or fail)
search_condition String N Search category (cid, drm_type, user_id, device_id, device_model)
search_keyword String N The keyword for category search (valid when search_condition is set)
page_unit Int N Number of search result (default:25, max: 1000)
page_index Int N Index of result page when the results are more than page_unit
  • Request Sample
curl -H 'authorization:Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJQYWxseUNvbkFQSSIsImF1ZCI6IklOS0EiLCJpc3MiOiJQYWxseUNvbiIsImFkbWluIjp0cnVlLCJ1c2VySWQiOiJ0ZXN0dXNlciJ9.p7VJmRryoaSVU2qn9PDuoDRIFxphw0N2786bR6zhELQ' 'https://service.pallycon.com/api/v2/drm/license?api_code=UA003001100&site_id=DEMO&from=2020-03-01&to=2020-03-02&search_status=success&search_condition=cid&search_keyword=test'

Response.data (Array)

Key Type Description
cid String Unique content ID
status String License issuance status (success, fail)
error_code String Error code (0000 for successful license issuance)
drm_type String Type of DRM (PlayReady, Widevine, FairPlay, NCG)
user_id String Unique ID of end user
device_id String Unique ID of client device
device_model String Device model name
license_type String Type of DRM license integration (token, gateway)
platform_name String Client platform name
reg_time String Datetime of the license request
  • Response Sample
{
    "_links":{
        "self":{
            "href":"http://service.pallycon.com/api/v2/drm/license"
        }
    },
    "error_code":"0000",
    "data":[{
        "cid":"configtest",
        "status":"success",
        "error_code":"0000",
        "drm_type":"FairPlay",
        "user_id":"uuu",
        "device_id":"13406080a61bef63aaa1d99a32f51e31c804e659",
        "device_model":"iOS-device",
        "license_type":"gateway",
        "platform_name":"iOS",
        "reg_time":"20200302235959"
    },
    {
        "cid":"configtest",
        "status":"success",
        "error_code":"0000",
        "drm_type":"FairPlay",
        "user_id":"uuu",
        "device_id":"13406080a61bef63aaa1d99a32f51e31c804e659",
        "device_model":"iOS-device",
        "license_type":"gateway",
        "platform_name":"iOS",
        "reg_time":"20200302235956"
    }],
    "count":2
    }
}

Get DRM User List

This API retrieves the list of end user ID that acquired license in a certain period.

Request

Parameter Type Required Description
Authorization Header Y Encoded JWT data
api_code String Y Fixed code of the API (UA003001100)
site_id String Y The Site ID value shown on PallyCon Console
from String N Start date of the search (YYYY-MM-DD)
to String N End date of the search (YYYY-MM-DD)
search_keyword String N The user ID to search
page_unit Int N Number of search result (default:25, max: 1000)
page_index Int N Index of result page when the results are more than page_unit
  • Request Sample
curl -H 'authorization:Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJQYWxseUNvbkFQSSIsImF1ZCI6IklOS0EiLCJpc3MiOiJQYWxseUNvbiIsImFkbWluIjp0cnVlLCJ1c2VySWQiOiJ0ZXN0dXNlciJ9.p7VJmRryoaSVU2qn9PDuoDRIFxphw0N2786bR6zhELQ' 'https://service.pallycon.com/api/v2/drm/user?api_code=UA003001100&site_id=DEMO&from=2020-03-01&to=2020-03-02

Response.data (Array)

Key Type Description
user_id String Unique ID of end user
license_cnt Int Number of licenses requested by the user
device_cnt Int Number of client devices used by the user
success Int Number of successful license issuance
fail Int Number of failed license issuance
  • Response Sample
{
    "_links":{
       "self":{
            "href":"http://service.pallycon.com/api/v2/drm/user"
        }
    },
    "error_code":"0000",
    "data":[{
        "user_id":"ta5uwrsw",
        "license_cnt":1,
        "device_cnt":1,
        "success":1,
        "fail":0
    },
    {
        "user_id":"uuu",
        "license_cnt":1729,
        "device_cnt":1,
        "success":1729,
        "fail":0
    },
    {
        "user_id":"5xhsdd36",
        "license_cnt":1,
        "device_cnt":1,
        "success":1,
        "fail":0
    }],
    "count":3
    }
}

Get DRM Device List

This API retrieves the list of client devices that acquired license in a certain period.

Request

Parameter Type Required Description
Authorization Header Y Encoded JWT data
api_code String Y Fixed code of the API (UA003001100)
site_id String Y The Site ID value shown on PallyCon Console
from String N Start date of the search (YYYY-MM-DD)
to String N End date of the search (YYYY-MM-DD)
search_keyword String N The device ID to search
page_unit Int N Number of search result (default:25, max: 1000)
page_index Int N Index of result page when the results are more than page_unit
  • Request Sample
curl -H 'authorization:Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJQYWxseUNvbkFQSSIsImF1ZCI6IklOS0EiLCJpc3MiOiJQYWxseUNvbiIsImFkbWluIjp0cnVlLCJ1c2VySWQiOiJ0ZXN0dXNlciJ9.p7VJmRryoaSVU2qn9PDuoDRIFxphw0N2786bR6zhELQ' 'https://service.pallycon.com/api/v2/drm/device?api_code=UA003001100&site_id=DEMO&from=2020-03-01&to=2020-03-02

Response.data (Array)

Key Type Description
device_id String Unique ID of client device
device_model String Client device model
license_cnt Int Number of licenses requested from the device
success Int Number of successful license issuance
fail Int Number of failed license issuance
  • Response Sample
{
    "_links":{
        "self":{
            "href":"http://service.pallycon.com/api/v2/drm/device"
        }
    },
    "error_code":"0000",
    "data":[{
        "device_id":"ea2e698d95b28441422f4997d6ffd5450a",
        "device_model":"ChromeCDM-Windows-2",
        "license_cnt":1732,
        "success":1732,
        "fail":0
    },
    {
        "device_id":"13406080a61bef63aaa1d99a32f51e31c804e659",
        "device_model":"iOS-device",
        "license_cnt":1729,
        "success":1729,
        "fail":0
    },
    {
        "device_id":"ab3dd736cd46607abbd81ec942e07a620a",
        "device_model":"ChromeCDM-Mac-2",
        "license_cnt":1,
        "success":1,
        "fail":0
    },
    {
        "device_id":"d838f619-69e0-4e3a-9b48-5a1b52ce287a",
        "device_model":"playready-device",
        "license_cnt":1728,
        "success":1728,
        "fail":0
    }],
    "count":4
}

Get DRM CID License List

This API retrieves the number of licenses issued for each CID(content ID) in a certain period.

Request

Parameter Type Required Description
Authorization Header Y Encoded JWT data
api_code String Y Fixed code of the API (UA003001100)
site_id String Y The Site ID value shown on PallyCon Console
from String N Start date of the search (YYYY-MM-DD)
to String N End date of the search (YYYY-MM-DD)
search_status String N License issuance status (success or fail)
page_unit Int N Number of search result (default:25, max: 1000)
page_index Int N Index of result page when the results are more than page_unit
  • Request Sample
curl -H 'authorization:Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJQYWxseUNvbkFQSSIsImF1ZCI6IklOS0EiLCJpc3MiOiJQYWxseUNvbiIsImFkbWluIjp0cnVlLCJ1c2VySWQiOiJ0ZXN0dXNlciJ9.p7VJmRryoaSVU2qn9PDuoDRIFxphw0N2786bR6zhELQ' 'https://service.pallycon.com/api/v2/drm/cid-drmLicense?api_code=UA003001100&site_id=DEMO&from=2020-03-01&to=2020-03-02

Response.data (Array)

Key Type Description
cid String Unique ID of content
license_cnt Int Number of licenses issued for the content
  • Response Sample
{
    "_links":{
        "self":{
            "href":"http://service.pallycon.com/api/v2/drm/cid-drmLicense"
        }
    },
    "error_code":"0000",
    "data":[
    {
    "cid":"bigbuckbunny",
    "license_cnt":1733
    },
    {
    "cid":"configtest",
    "license_cnt":1729
    }],
    "count":2
}

Get DRM CID User List

This API retrieves the number of end users who acquired license for a CID(content ID) in a certain period.

Request

Parameter Type Required Description
Authorization Header Y Encoded JWT data
api_code String Y Fixed code of the API (UA003001100)
site_id String Y The Site ID value shown on PallyCon Console
cid String Y Unique ID of the content
from String N Start date of the search (YYYY-MM-DD)
to String N End date of the search (YYYY-MM-DD)
search_status String N License issuance status (success or fail)
page_unit Int N Number of search result (default:25, max: 1000)
page_index Int N Index of result page when the results are more than page_unit
  • Request Sample
curl -H 'authorization:Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJQYWxseUNvbkFQSSIsImF1ZCI6IklOS0EiLCJpc3MiOiJQYWxseUNvbiIsImFkbWluIjp0cnVlLCJ1c2VySWQiOiJ0ZXN0dXNlciJ9.p7VJmRryoaSVU2qn9PDuoDRIFxphw0N2786bR6zhELQ' 'https://service.pallycon.com/api/v2/drm/cid-user?api_code=UA003001100&site_id=DEMO&cid=bigbuckbunny&from=2020-03-01&to=2020-03-02

Response.data (Array)

Key Type Description
cid String Unique ID of content
user_id String Unique ID of end user
license_cnt Int Number of licenses issued for the content
  • Response Sample
{
    "_links":{
        "self":{
            "href":"http://service.pallycon.com/api/v2/drm/cid-user"
        }
    },
    "error_code":"0000",
    "data":[{
        "cid":"bigbuckbunny",
        "user_id":"test-user",
        "license_cnt":1728
    },
    {
        "cid":"bigbuckbunny",
        "user_id":"rd1z7c08",
        "license_cnt":1
    }],
    "count":2
}

Get DRM Packaging History

This API retrieves the DRM packaging records in a certain period.

Request

Parameter Type Required Description
Authorization Header Y Encoded JWT data
api_code String Y Fixed code of the API (UA003001100)
site_id String Y The Site ID value shown on PallyCon Console
from String N Start date of the search (YYYY-MM-DD)
to String N End date of the search (YYYY-MM-DD)
search_condition String N Search category (cid, drm_type, user_id, device_id, device_model)
search_keyword String N The keyword for category search (valid when search_condition is set)
last_created_time_cid String N Creation time of the lastly retrieved CID item (for pagination)
last_update_time String N Update time of the lastly retrieved item (for pagination)

When the last_created_time_cid and last_update_time are set, the response will contain the data that is later than the settings.

Response.data (Array)

Key Type Description
site_id String Site ID value shown on PallyCon Console
cid String Unique ID of the content
track String content track type (default: HD)
created_time String Datetime of the first packaging for the content
update_time String Datetime of re-packaging for the content

Get DRM Integration Info

This API retrieves the information for DRM integration.

Request

Parameter Type Required Description
Authorization Header Y Encoded JWT data
site_id Path Variable Y The Site ID value shown on PallyCon Console
api_code String Y Fixed code of the API (UA003004100)

Response.data

Key Type Description
site_id String Site ID value shown on PallyCon Console
site_key String Encryption key for the service site integration (32 bytes base64 string)
access_key String Additional encryption key for the integration
license_callback_url String Webpage URL for callback type license integration (deprecated)
package_callback_url String Webpage URL for callback type packager integration (deprecated)
kms_token String Security token for KMS integration such as CPIX and SPEKE API
token_duration Int Duration of a license token validity (in seconds)
iv String Site-specific initial vector (IV) value for DRM encryption

Update DRM Integration Info

This API updates the information for DRM integration.

Request

Parameter Type Required Description
Authorization Header Y Encoded JWT data
site_id Path Variable Y The Site ID value shown on PallyCon Console
api_code String Y Fixed code of the API (UA003004100)
license_callback_url String N Webpage URL for callback type license integration (deprecated)
package_callback_url String N Webpage URL for callback type packager integration (deprecated)
token_duration Int N Duration of a license token validity (in seconds)

Response

This API returns the default response data.

Register FairPlay Certificate

This API registers the FPS certificate to PallyCon service.

Request

Parameter Type Required Description
Authorization Header Y Encoded JWT data
site_id Path Variable Y The Site ID value shown on PallyCon Console
api_code String Y Fixed code of the API (UA003004200)
ask String Y Application secret key generated on Apple developer site
key_pw String Y Private key password (max 32 bytes)
fps_cert blob Y FPS certificate file (.der or .cer)
private_key blob Y Private key file (.pem)

Response

This API returns the default response data.

Get MAL, MAU, MAD values

This API searches for MAL(Monthly Active License), MAU(Monthly Active Users), and MAD(Monthly Active Devices) for the target date.

For MAD, you need to set persistentStateRequired in the player to generate a unique ID per PC for the desktop Chrome browser (see HTML Player sample source).

Without this setting, the same ID will be applied to the Chrome browser on all PCs and reflected in MAD as one device.

Request

Parameter Type Required Description
Authorization Header Y Encoded JWT data
api_code String Y Fixed code of the API : UA003003100
site_id String Y Site id
target_date String Y Search Date (YYYY-MM-DD)

Response.data (Object)

Key Type Description
license_cnt Integer MAL (Monthly Active Licenses)
user_acc_cnt Integer MAU (Monthly Active Users)
device_acc_cnt Integer MAD (Monthly Active Devices)
target_date Integer Search Date
Previous