Mint a playback token
Mints a short-lived (~60 seconds) x-dt-auth-token JWT for a player embed to present to DRMtoday's license servers right before playback starts. Alternative to self-signing with the CRT signing secret.
curl -X POST "https://api.5centscdn.com/v2/drm/token" \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"contentId": "2ba1e28f1b9614c18c9318c5293d78df",
"zoneid": 20456,
"relativepath": "movies/trailer/master.m3u8",
"userId": "viewer-4e01cc4e"
}'
import requests
import json
url = "https://api.5centscdn.com/v2/drm/token"
headers = {
"Content-Type": "application/json",
"X-API-Key": "YOUR_API_KEY"
}
data = {
"contentId": "2ba1e28f1b9614c18c9318c5293d78df",
"zoneid": 20456,
"relativepath": "movies/trailer/master.m3u8",
"userId": "viewer-4e01cc4e"
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://api.5centscdn.com/v2/drm/token", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-Key": "YOUR_API_KEY"
},
body: JSON.stringify({
"contentId": "2ba1e28f1b9614c18c9318c5293d78df",
"zoneid": 20456,
"relativepath": "movies/trailer/master.m3u8",
"userId": "viewer-4e01cc4e"
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"contentId": "2ba1e28f1b9614c18c9318c5293d78df",
"zoneid": 20456,
"relativepath": "movies/trailer/master.m3u8",
"userId": "viewer-4e01cc4e"
}`)
req, err := http.NewRequest("POST", "https://api.5centscdn.com/v2/drm/token", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("X-API-Key", "YOUR_API_KEY")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://api.5centscdn.com/v2/drm/token')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request['X-API-Key'] = 'YOUR_API_KEY'
request.body = '{
"contentId": "2ba1e28f1b9614c18c9318c5293d78df",
"zoneid": 20456,
"relativepath": "movies/trailer/master.m3u8",
"userId": "viewer-4e01cc4e"
}'
response = http.request(request)
puts response.body
{
"result": "success",
"token": "eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJ...",
"exp": 1758648660,
"assetId": "2ba1e28f1b9614c18c9318c5293d78df",
"licenseServers": {
"widevine": "https://lic.drmtoday.com/license-proxy-widevine/cenc/?specConform=true",
"playready": "https://lic.drmtoday.com/license-proxy-headerauth/drmtoday/RightsManager.asmx",
"fairplay": "https://lic.drmtoday.com/license-server-fairplay/",
"wiseplay": "https://lic.drmtoday.com/license-proxy-wiseplay/"
},
"fairplayCertUrl": "https://lic.drmtoday.com/license-server-fairplay/cert/5centscdn_svc10001"
}
/drm/token
Target server for requests. Edit to use your own host.
API key (sent in header)
The media type of the request body
DRMtoday asset ID. Required unless zoneid and relativepath are both given, in which case the content ID is derived as md5("{zoneid}:/{relativepath}").
Push zone ID of the asset. Use together with relativepath instead of contentId.
Path of the asset relative to the zone root. Use together with zoneid instead of contentId.
Optional viewer or session identifier, included in DRMtoday's delivery logs.
Request Preview
Response
Response will appear here after sending the request
Authentication
API Key for authentication. Provide your API key in the header.
Body
DRMtoday asset ID. Required unless zoneid and relativepath are both given, in which case the content ID is derived as md5("{zoneid}:/{relativepath}").
2ba1e28f1b9614c18c9318c5293d78dfPush zone ID of the asset. Use together with relativepath instead of contentId.
20456Path of the asset relative to the zone root. Use together with zoneid instead of contentId.
movies/trailer/master.m3u8Optional viewer or session identifier, included in DRMtoday's delivery logs.
viewer-4e01cc4eResponses
Operation outcome.
successerrorSigned x-dt-auth-token JWT, valid for about 60 seconds.
Token expiry as a Unix epoch timestamp in seconds.
DRMtoday asset ID the token was minted for.
License server URLs for each DRM system.
FairPlay certificate URL for this service. Null if no FairPlay certificate is uploaded.