Songs API (0.0.1)

Download OpenAPI specification:Download

Returns a greeting message from Songs API

Responses

Response samples

Content type
application/json
{
  • "message": "Hello from Songs API"
}

Returns all songs

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Create a new song

Request Body schema: application/json
name
required
string

The name of the song.

artist
required
string

Artist who recorded the song.

publish_year
required
integer <int32>

The year the song was recorded.

Responses

Request samples

Content type
application/json
{
  • "name": "The Thrill is Gone",
  • "artist": "B.B. King",
  • "publish_year": 1969
}

Response samples

Content type
application/json
{
  • "id": "7ccc951a-25cf-4009-bfb1-b8ef4300db46",
  • "name": "The Thrill is Gone",
  • "artist": "B.B. King",
  • "publish_year": 1969
}

Gets a specific song by id.

path Parameters
id
required
string
Example: 7ccc951a-25cf-4009-bfb1-b8ef4300db46

The id of the song to retrieve.

Responses

Response samples

Content type
application/json
{
  • "id": "7ccc951a-25cf-4009-bfb1-b8ef4300db46",
  • "name": "The Thrill is Gone",
  • "artist": "B.B. King",
  • "publish_year": 1969
}

Updates existing song.

path Parameters
id
required
any
Example: 7ccc951a-25cf-4009-bfb1-b8ef4300db46

The id of the song to update.

Request Body schema: application/json
name
required
string

The name of the song.

artist
required
string

Artist who recorded the song.

publish_year
required
integer <int32>

The year the song was recorded.

Responses

Request samples

Content type
application/json
{
  • "name": "The Thrill is Not Gone",
  • "artist": "B.B. King",
  • "publish_year": 1969
}

Response samples

Content type
application/json
{
  • "id": "7ccc951a-25cf-4009-bfb1-b8ef4300db46",
  • "name": "The Thrill is Not Gone",
  • "artist": "B.B. King",
  • "publish_year": 1969
}

Partially updates an existing song.

path Parameters
id
required
any
Example: 7ccc951a-25cf-4009-bfb1-b8ef4300db46

The id of the song to update.

Request Body schema: application/json
Any of
name
required
string

The name of the song.

artist
string

Artist who recorded the song.

publish_year
integer

The year the song was recorded.

Responses

Request samples

Content type
application/json
{
  • "name": "The Thrill is Gone Again"
}

Response samples

Content type
application/json
{
  • "id": "7ccc951a-25cf-4009-bfb1-b8ef4300db46",
  • "name": "The Thrill is Gone Again",
  • "artist": "B.B. King",
  • "publish_year": 1969
}

Deletes an existing song.

path Parameters
id
required
any
Example: 7ccc951a-25cf-4009-bfb1-b8ef4300db46

The id of the song to update.

Responses

Response samples

Content type
application/json
{
  • "message": "Given identifier (ccc951a-25cf-4009-bfb1-b8ef4300db46) is invalid. Expected format: 8-4-4-4-12 hex."
}