Umožňuje částečně upravit existující skladbu (např. název, délku, nebo žánr). Přístup jen pro admina nebo interpreta, který skladbu vlastní.
PATCH
/songs/{songId}
curl \
--request PATCH 'https://api.mstonjek.cz/v1/songs/song_123' \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "Content-Type: application/json" \
--data '{"title":"string","duration":42,"artistIds":["string"],"genre":"string"}'
Request examples
{
"title": "string",
"duration": 42,
"artistIds": [
"string"
],
"genre": "string"
}
Response examples (200)
{
"id": "8d3f7e7a-6a6b-4b99-9b52-6f9d7d2a0a11",
"title": "Losing It",
"duration": 245,
"artistIds": [
"8d3f7e7a-6a6b-4b99-9b52-6f9d7d2a0a11"
],
"genre": "Electronic"
}
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 (422)
{
"code": "VALIDATION_FAILED",
"message": "Vstupní data obsahují chyby.",
"errors": [
{
"field": "email",
"message": "Emailová adresa není platná."
}
]
}
Response examples (500)
{
"code": "INTERNAL_SERVER_ERROR",
"message": "Server momentálně nedostupný"
}