application/json

Body Required

Responses

  • 201 application/json

    Vytvořeno

  • 400 application/json

    Chyba v požadavku klienta

    Hide response attributes Show response attributes object
    • code string
    • message string
  • 401 application/json

    Chyba autentizace

    Hide response attributes Show response attributes object
    • code string
    • message string
  • 403 application/json

    Nedostatečná oprávnění

    Hide response attributes Show response attributes object
    • code string
    • message string
  • 409

    Conflict

  • 500 application/json

    Chyba serveru

    Hide response attributes Show response attributes object
    • code string
    • message string
POST /artists
curl \
 --request POST 'https://api.mstonjek.cz/v1/artists' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"name":"Daft Punk","genres":["electronic","house"],"country":"FR","debutYear":1993,"popularity":92}'
Request example
{
  "name": "Daft Punk",
  "genres": [
    "electronic",
    "house"
  ],
  "country": "FR",
  "debutYear": 1993,
  "popularity": 92
}
Response examples (201)
{
  "data": {
    "id": "8d3f7e7a-6a6b-4b99-9b52-6f9d7d2a0a11",
    "name": "Daft Punk",
    "genres": [
      "electronic",
      "house"
    ],
    "userId": "user_123",
    "country": "FR",
    "debutYear": 1993,
    "popularity": 92
  }
}
Response examples (400)
{
  "code": "BAD_REQUEST",
  "message": "Neplatný formát dat v těle požadavku."
}
Response examples (401)
{
  "code": "UNAUTHORIZED",
  "message": "Token není platný"
}
Response examples (403)
{
  "code": "FORBIDDEN",
  "message": "Nemáte oprávnění"
}
Response examples (500)
{
  "code": "INTERNAL_SERVER_ERROR",
  "message": "Server momentálně nedostupný"
}