Page tree
Skip to end of metadata
Go to start of metadata

GENERATE TOKEN

This action generates the content protection token. Generated token should be added to the content URL prior to adding it in the web page code or as a media player source. Please note that if Client IP address (ec_clientip) is included the token is end-user specific and content will be allowed only for the particular IP address.

Token must be added as a GET parameter. Example:

Generated token is: 3ervZSQ49CLquPrrY

Then link is: https://download.cloudycdn.services/...  .../media?3ervZSQ49CLquPrrY

Options

Name

Type

Value

Required

Comment

ec_expire

String (Datetime)

Y-m-d H:i:s

No

Token expire time after which the content will be not available.

ec_clientip

String(15)


No

End user IP address which can be obtained from HTTP request.

item_typeStringlive | media | record | fileYes
item_idInteger
Yes
subitem_typeStringplayback_hls | playback_dash | media_source | media_transcode | recording_bitrateYes

Not required for file

subitem_idInteger
No
Item TypeFor PlaybackFor download

subitem_typesubitem_idsubitem_typesubitem_id
recordplayback_hls | playback_dash
NOT REQUIRED
recording_bitrate

REQUIRED (Bitrate name from bitrates list in records response list)

mediaplayback_hls | playback_dash
NOT REQUIRED (Manifest ID. If not set, will use default manifest)
media_source | media_transcodeREQUIRED (Source or transcoded file ID)
liveplayback_hls | playback_dash
NOT REQUIRED (Manifest ID. If not set, will use default manifest)
live_manifest_hls | live_manifest_dashREQUIRED (Manifest ID)
fileNOT USED

Example

$data = array('object' => 'token', 'action' => 'generate',

'options' => array(

'ec_expire' => '2016-06-24 20:00:00',

‘ec_clientip' => '8.8.8.8',

'item_type' => 'media',

'item_id' => 666

)

);

Response

Response FieldsTypeSample ValueComment
statusCode
Integer00 - Success
statusMessage
String"Created"Error or confirmation message
data
Array
Array of response data

tokenString
gjSvWPrwvWHerFf
Generated token
  • No labels