Skip to content

Add a new album

POST
/api/v1/artists/{artistId}/albums

Add a new album to a legendary Argentine Rock artist. Make sure it’s a masterpiece!

Authorizations

Parameters

Path Parameters

artistId*
Typeinteger
Required
Example1

Request Body

JSON
[
{
"id": 1,
"name": "1",
"year": 1976,
"image": "2"
},
"La Máquina de Hacer Pájaros",
"https://cdn.rock-legends.com/photos/la-maquina.jpg"
]

Responses

Created
JSON
[
{
"id": 1,
"name": "1",
"year": 1976,
"image": "2"
},
"La Máquina de Hacer Pájaros",
"https://cdn.rock-legends.com/photos/la-maquina.jpg"
]

Samples

cURL
curl -X POST https://stoplight.io/mocks/enzonotario/argentine-rock/122547792/api/v1/artists/{artistId}/albums
JavaScript
fetch("https://stoplight.io/mocks/enzonotario/argentine-rock/122547792/api/v1/artists/{artistId}/albums", { method: "POST" })
  .then(response => response.json())
  .then(data => console.log(data));
PHP
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://stoplight.io/mocks/enzonotario/argentine-rock/122547792/api/v1/artists/{artistId}/albums");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Python
import requests
response = requests.post("https://stoplight.io/mocks/enzonotario/argentine-rock/122547792/api/v1/artists/{artistId}/albums")
print(response.json())
Powered by VitePress OpenAPI