ID: updateArtist
Update an artist
PUT
/api/v1/artists/{artistId}Update the information of a legendary Argentine Rock artist. Make sure to provide accurate data.
Authorizations
Parameters
Path Parameters
artistId*
Typeinteger
RequiredExample
1
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
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}Samples
Bruno
put {
url: https://stoplight.io/mocks/enzonotario/argentine-rock/122547792/api/v1/artists/1
}
headers {
Content-Type: application/json
}
body {
{
"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"
}
}
Bruno
put {
url: https://stoplight.io/mocks/enzonotario/argentine-rock/122547792/api/v1/artists/1
}
headers {
Content-Type: application/json
}
body {
{
"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
curl -X PUT \
'https://stoplight.io/mocks/enzonotario/argentine-rock/122547792/api/v1/artists/1' \
-H "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:{'Content-Type':'application/json'},body:'{"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"}'})
.then(response => response.json())
.then(data => console.log(data));
PHP
<?php
$url = 'https://stoplight.io/mocks/enzonotario/argentine-rock/122547792/api/v1/artists/1';
$method = 'PUT';
$headers = [
'Content-Type' => 'application/json',
];
$body = 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"});
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
Python
import requests
url = 'https://stoplight.io/mocks/enzonotario/argentine-rock/122547792/api/v1/artists/1'
headers = {
'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'
}
response = requests.put(url, headers=headers, json=data)
print(response.json())