Skip to content

PostSong

Walter Lara edited this page Apr 25, 2022 · 20 revisions

Post Song

Allows to add a new Song.

Request

URL: /v1/songs

Method: POST

Path Parameters: None

Query Parameters: None

Headers:

Authorization: Bearer {accessToken}

Content-Type: application/json

Content:

Field Type Description Requirement Type
title string Song title. Required
genres string list List of genres. Optional
covertArtUrl string Valid URL of covert art picture file. Optional
description string Song description. Optional
credits string list Song production credits Optional

Content example:

{
    "title": "Blinding Lights",
    "genres": ["Synthwave","R&B/Soul"],
    "covertArtUrl": "https://somewebsite/weeknd-cover.png",
    "description": "Song by The Weeknd",
    "credits": "Produced by Max Martin and Oscar Holter"
}

✅ Success Response

Code: 200 OK

Headers:

Content-Type: application/json

Content:

Field Type Description Condition
songId string UUID of the added Song. Always

Content example:

{
    "songId": "7bd2862f-8deb-4814-8943-156d9dab80dd"
}

❌ Error Responses

1. Bad Request

Code: 400 BAD REQUEST

Condition: If a mandatory content field is missing.

Headers:

Content-Type: application/json

Content example:

{
    "code": 400,
    "description": "Bad Request",
    "cause": "missing title"
}

2. Unauthorized

Code: 401 UNAUTHORIZED

Condition: If {accessToken} is invalid or expired.

See Also

Patch Song (Update Song)

Get Song

Get Songs

Delete Song

Clone this wiki locally