Preview Asset Defaults
curl --request POST \
--url https://api.royalti.io/defaultsettings/preview/asset \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"artistId": "660e8400-e29b-41d4-a716-446655440001",
"assetData": {
"assetName": "New Track",
"duration": 180
}
}
'import requests
url = "https://api.royalti.io/defaultsettings/preview/asset"
payload = {
"artistId": "660e8400-e29b-41d4-a716-446655440001",
"assetData": {
"assetName": "New Track",
"duration": 180
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
artistId: '660e8400-e29b-41d4-a716-446655440001',
assetData: {assetName: 'New Track', duration: 180}
})
};
fetch('https://api.royalti.io/defaultsettings/preview/asset', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.royalti.io/defaultsettings/preview/asset",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'artistId' => '660e8400-e29b-41d4-a716-446655440001',
'assetData' => [
'assetName' => 'New Track',
'duration' => 180
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.royalti.io/defaultsettings/preview/asset"
payload := strings.NewReader("{\n \"artistId\": \"660e8400-e29b-41d4-a716-446655440001\",\n \"assetData\": {\n \"assetName\": \"New Track\",\n \"duration\": 180\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.royalti.io/defaultsettings/preview/asset")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"artistId\": \"660e8400-e29b-41d4-a716-446655440001\",\n \"assetData\": {\n \"assetName\": \"New Track\",\n \"duration\": 180\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.royalti.io/defaultsettings/preview/asset")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"artistId\": \"660e8400-e29b-41d4-a716-446655440001\",\n \"assetData\": {\n \"assetName\": \"New Track\",\n \"duration\": 180\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Asset preview generated successfully",
"data": {
"original": {},
"withDefaults": {},
"appliedDefaults": [
{
"field": "<string>",
"value": "<unknown>",
"source": {
"entityType": "<string>",
"entityId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"category": "<string>"
}
}
]
}
}{
"status": "error",
"message": "Invalid request parameters"
}{
"status": "error",
"message": "Unauthorized"
}{
"status": "error",
"message": "Internal server error"
}Default Settings
Preview Asset Defaults
POST /defaultsettings/preview/asset
POST
/
defaultsettings
/
preview
/
asset
Preview Asset Defaults
curl --request POST \
--url https://api.royalti.io/defaultsettings/preview/asset \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"artistId": "660e8400-e29b-41d4-a716-446655440001",
"assetData": {
"assetName": "New Track",
"duration": 180
}
}
'import requests
url = "https://api.royalti.io/defaultsettings/preview/asset"
payload = {
"artistId": "660e8400-e29b-41d4-a716-446655440001",
"assetData": {
"assetName": "New Track",
"duration": 180
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
artistId: '660e8400-e29b-41d4-a716-446655440001',
assetData: {assetName: 'New Track', duration: 180}
})
};
fetch('https://api.royalti.io/defaultsettings/preview/asset', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.royalti.io/defaultsettings/preview/asset",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'artistId' => '660e8400-e29b-41d4-a716-446655440001',
'assetData' => [
'assetName' => 'New Track',
'duration' => 180
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.royalti.io/defaultsettings/preview/asset"
payload := strings.NewReader("{\n \"artistId\": \"660e8400-e29b-41d4-a716-446655440001\",\n \"assetData\": {\n \"assetName\": \"New Track\",\n \"duration\": 180\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.royalti.io/defaultsettings/preview/asset")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"artistId\": \"660e8400-e29b-41d4-a716-446655440001\",\n \"assetData\": {\n \"assetName\": \"New Track\",\n \"duration\": 180\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.royalti.io/defaultsettings/preview/asset")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"artistId\": \"660e8400-e29b-41d4-a716-446655440001\",\n \"assetData\": {\n \"assetName\": \"New Track\",\n \"duration\": 180\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Asset preview generated successfully",
"data": {
"original": {},
"withDefaults": {},
"appliedDefaults": [
{
"field": "<string>",
"value": "<unknown>",
"source": {
"entityType": "<string>",
"entityId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"category": "<string>"
}
}
]
}
}{
"status": "error",
"message": "Invalid request parameters"
}{
"status": "error",
"message": "Unauthorized"
}{
"status": "error",
"message": "Internal server error"
}Description
POST /defaultsettings/preview/asset Description: Preview how defaults will be applied to an asset, showing original data, data with defaults, and which defaults were applied from which sources. Authorization:- Required role:
useror higher
POST
Request Body:
| Parameter | Type | Description | Required |
|---|---|---|---|
| labelId | uuid | Label context | No |
| artistId | uuid | Artist context | No |
| userId | uuid | User context | No |
| assetData | object | Partial asset data to test | No |
Code Examples
const response = await fetch('https://api.royalti.io/defaultsettings/preview/asset', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
"labelId": "sample-labelId",
"artistId": "sample-artistId",
"userId": "sample-userId",
"assetData": {}
})
});
const data = await response.json();
console.log(data);
import requests
response = requests.post(
'https://api.royalti.io/defaultsettings/preview/asset',
json={"labelId":"sample-labelId","artistId":"sample-artistId","userId":"sample-userId","assetData":{}}
)
data = response.json()
print(data)
curl -X POST https://api.royalti.io/defaultsettings/preview/asset \
-H "Content-Type: application/json" \
-d '{"labelId":"sample-labelId","artistId":"sample-artistId","userId":"sample-userId","assetData":{}}'
Authorizations
JWT Authorization header using the Bearer scheme. Format: "Bearer {token}"
Body
application/json
⌘I