Update an artist
PUT
/api/v1/artists/{artistId}
Update the information of a legendary Argentine Rock artist. Make sure to provide accurate data.
Authorizations
bearerAuth
TypeHTTP (bearer)
or
apiKeyHeader
TypeAPI Key (header: X-API-Key)
Parameters
Path Parameters
artistId*
Typeinteger
RequiredExample
1
format
int64
Request Body
JSON
{
"id": 1,
"name": "Charly García",
"description": "One of the most influential rock musicians in Argentine history.",
"image": "https://cdn.rock-legends.com/photos/charly.jpg",
"band": "Sui Generis"
}
Responses
OK
application/json
JSON
{
"id": 1,
"name": "Charly García",
"description": "One of the most influential rock musicians in Argentine history.",
"image": "https://cdn.rock-legends.com/photos/charly.jpg",
"band": "Sui Generis"
}
PUT
/api/v1/artists/{artistId}
Playground
Authorization
Variables
Key
Value
Body
JSON
{
id
:
1
name
:
Charly García
description
:
One of the most influential rock musicians in Argentine history.
image
:
https://cdn.rock-legends.com/photos/charly.jpg
band
:
Sui Generis
}
Samples
cURL
curl https://stoplight.io/mocks/enzonotario/argentine-rock/122547792/api/v1/artists/1 \
--request PUT \
--header 'Authorization: Bearer Token' \
--header 'Content-Type: application/json' \
--data '{
"id": 1,
"name": "Charly García",
"description": "One of the most influential rock musicians in Argentine history.",
"image": "https://cdn.rock-legends.com/photos/charly.jpg",
"band": "Sui Generis"
}'
JavaScript
fetch('https://stoplight.io/mocks/enzonotario/argentine-rock/122547792/api/v1/artists/1', {
method: 'PUT',
headers: {
Authorization: 'Bearer Token',
'Content-Type': 'application/json'
},
body: JSON.stringify({
id: 1,
name: 'Charly García',
description: 'One of the most influential rock musicians in Argentine history.',
image: 'https://cdn.rock-legends.com/photos/charly.jpg',
band: 'Sui Generis'
})
})
PHP
$ch = curl_init("https://stoplight.io/mocks/enzonotario/argentine-rock/122547792/api/v1/artists/1");
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer Token', 'Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'id' => 1,
'name' => 'Charly García',
'description' => 'One of the most influential rock musicians in Argentine history.',
'image' => 'https://cdn.rock-legends.com/photos/charly.jpg',
'band' => 'Sui Generis'
]));
curl_exec($ch);
curl_close($ch);
Python
requests.put(
"https://stoplight.io/mocks/enzonotario/argentine-rock/122547792/api/v1/artists/1",
headers={
"Authorization": "Bearer Token",
"Content-Type": "application/json"
},
json={
"id": 1,
"name": "Charly García",
"description": "One of the most influential rock musicians in Argentine history.",
"image": "https://cdn.rock-legends.com/photos/charly.jpg",
"band": "Sui Generis"
}
)