Update a CRT template
curl -X POST "https://api.5centscdn.com/v2/drm/crt-templates/c3d9a1e4-7b2f-4e6a-9d8c-5f1b0a2e7c34" \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"name": "rental-relative-expiration",
"description": "Expires 7 days after issuance; playback must finish within 48 hours.",
"tags": [
"profile",
"rental"
],
"template": {
"storeLicense": true,
"profile": {
"type": "purchase"
}
}
}'
import requests
import json
url = "https://api.5centscdn.com/v2/drm/crt-templates/c3d9a1e4-7b2f-4e6a-9d8c-5f1b0a2e7c34"
headers = {
"Content-Type": "application/json",
"X-API-Key": "YOUR_API_KEY"
}
data = {
"name": "rental-relative-expiration",
"description": "Expires 7 days after issuance; playback must finish within 48 hours.",
"tags": [
"profile",
"rental"
],
"template": {
"storeLicense": true,
"profile": {
"type": "purchase"
}
}
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://api.5centscdn.com/v2/drm/crt-templates/c3d9a1e4-7b2f-4e6a-9d8c-5f1b0a2e7c34", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-Key": "YOUR_API_KEY"
},
body: JSON.stringify({
"name": "rental-relative-expiration",
"description": "Expires 7 days after issuance; playback must finish within 48 hours.",
"tags": [
"profile",
"rental"
],
"template": {
"storeLicense": true,
"profile": {
"type": "purchase"
}
}
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"name": "rental-relative-expiration",
"description": "Expires 7 days after issuance; playback must finish within 48 hours.",
"tags": [
"profile",
"rental"
],
"template": {
"storeLicense": true,
"profile": {
"type": "purchase"
}
}
}`)
req, err := http.NewRequest("POST", "https://api.5centscdn.com/v2/drm/crt-templates/c3d9a1e4-7b2f-4e6a-9d8c-5f1b0a2e7c34", 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/crt-templates/c3d9a1e4-7b2f-4e6a-9d8c-5f1b0a2e7c34')
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 = '{
"name": "rental-relative-expiration",
"description": "Expires 7 days after issuance; playback must finish within 48 hours.",
"tags": [
"profile",
"rental"
],
"template": {
"storeLicense": true,
"profile": {
"type": "purchase"
}
}
}'
response = http.request(request)
puts response.body
{
"result": "success",
"uuid": "c3d9a1e4-7b2f-4e6a-9d8c-5f1b0a2e7c34",
"name": "rental-relative-expiration",
"description": "Expires 7 days after issuance; playback must finish within 48 hours.",
"tags": [
"profile",
"rental"
],
"template": {
"profile": {
"type": "rental",
"relativeExpiration": "PT168H",
"playDuration": "PT48H"
},
"storeLicense": true
}
}
/drm/crt-templates/{templateuuid}Target server for requests. Edit to use your own host.
API key (sent in header)
Unique identifier (UUID) of the CRT template, as returned by the list and create endpoints.
The media type of the request body
Optional short name of the template.
Description of the template.
CRT claim-shape object merged into every CRT signed against this template. Replaces the existing template body.
Request Preview
Response
Response will appear here after sending the request
Authentication
API Key for authentication. Provide your API key in the header.
Path Parameters
Unique identifier (UUID) of the CRT template, as returned by the list and create endpoints.
c3d9a1e4-7b2f-4e6a-9d8c-5f1b0a2e7c34Body
Description of the template.
Expires 7 days after issuance; playback must finish within 48 hours.CRT claim-shape object merged into every CRT signed against this template. Replaces the existing template body.
{"storeLicense":true,"profile":{"type":"purchase"}}Responses
Operation outcome. Returns error on validation failure.
successerrorUnique identifier of the CRT template.
Short name of the template.
Description of the template.
Free-form tags for organizing templates. Omitted when the template has no tags.
CRT claim-shape object merged into every CRT signed against this template.