curl --request PUT \
--url https://api.royalti.io/product/{id}/artists \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"artists": [
"artist-id-1",
"artist-id-2"
]
}
'{
"message": "Artist added to product"
}/product//artists
curl --request PUT \
--url https://api.royalti.io/product/{id}/artists \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"artists": [
"artist-id-1",
"artist-id-2"
]
}
'{
"message": "Artist added to product"
}/product/{id}/artists endpoint updates the artists associated with a specific product. It replaces all existing artist associations with the provided list.
Method:PUT
Path Parameter:
| Parameter | Type | Description |
|---|---|---|
| id | string | The unique identifier of the product. |
| Parameter | Type | Description |
|---|---|---|
| artists | array | Array of artist IDs to associate with the product. |
const response = await fetch('https://api.royalti.io/product/example-id/artists', {
method: 'PUT',
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
"artists": [
{}
]
})
});
const data = await response.json();
console.log(data);