POST /playlists/{playlistId}/songs

Přiřadí existující skladbu k playlistu. Přístup jen pro admina nebo vlastníka playlistu.

Path parameters

  • playlistId string Required

    Unikátní ID playlistu

application/json

Body Required

  • songId string Required

    ID skladby k přidání

Responses

  • 204

    Skladba úspěšně přidána do playlistu.

  • 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
  • 404 application/json

    Zdroj nenalezen

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

    Konflikt - skladba již v playlistu existuje

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

    Chyba serveru

    Hide response attributes Show response attributes object
    • code string
    • message string
POST /playlists/{playlistId}/songs
curl \
 --request POST 'https://api.mstonjek.cz/v1/playlists/playlist_001/songs' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"songId":"song_123"}'
Request example
{
  "songId": "song_123"
}
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 (404)
{
  "code": "NOT_FOUND",
  "message": "Zdroj uživatel 'user_123' nebyl nalezen."
}
Response examples (409)
{
  "code": "CONFLICT",
  "message": "Skladba již v playlistu existuje."
}
Response examples (500)
{
  "code": "INTERNAL_SERVER_ERROR",
  "message": "Server momentálně nedostupný"
}