This document describes the API used to serve chords from the database to the frontend.
Note: this is a v0 API, hence it is subject to breaking changes at any time without warning.
Returns a list of all artists in the database.
A list of strings representing artist names.
*This data is autogenerated from the songs in the database. Hence, there is
no need for POST, PUT, or DELETE methods for the /api/v0/artists
endpoint.
Returns all songs matching the given query.
Name | Required? | Description |
---|---|---|
artist |
optional | If provided, the response will contain songs by the given artist. |
id |
optional | If provided, the response will only contain the metadata for the song with the given ID. |
query |
optional | If provided, the response will contain songs whose names match the search query. |
If no query parameters are provided, then this method will return all songs in the database.
A list of SongMeta
objects.
This method requires authorisation.
Add a new song to the database.
NB: this method only initialises the metadata - after receiving the new
song ID, make a separate call to PUT /api/v0/chords
to provide the chords.
A SongMeta
object describing the metadata of the new song to be created.
There is no need to set the id
field, as this will be automatically assigned
upon creation.
A SongMeta
object describing the metadata of the newly created song.
This will include the new song ID.
This method requires authorisation.
Update the metadata for a song in the database.
Name | Required? | Description |
---|---|---|
id |
required | The ID of the song to update metadata for. |
A SongMeta
object describing the new metadata for this song. The id
field
will be ignored. All other fields will be set to the provided values
(and dropped if no value is provided).
A SongMeta
object describing the updated metadata for this song.
This method requires authorisation.
Delete a song from the database. The song's chords will also be deleted.
Name | Required? | Description |
---|---|---|
id |
required | The ID of the song to delete. |
Returns the chords for a given song.
Name | Required? | Description |
---|---|---|
id |
required | The ID of the song to retrieve chords for. |
The requested chords, in plain-text format.
This method requires authorisation.
Updates the chords for a given song.
Name | Required? | Description |
---|---|---|
id |
required | The ID of the song to update chords for. |
The new chords for this song, in plain-text format.
The updated chords for this song, in plain-text format.
*Each instance of the chords
resource type is tied to an instance of the
songs
resource type. Hence, there is no need for POST or DELETE methods for
the /api/v0/chords
endpoint - just use the corresponding method
for /api/v0/songs
.
Returns other artists related to a given artist.
Name | Required? | Description |
---|---|---|
artist |
required | The artist for which to get related artists. |
A list of strings representing artist names.
Describes metadata for a song. The format is like this:
{
// Unique ID assigned upon creation in DB
"id": 1037,
"name": "Your Song",
"artist": "Elton John",
"album": "Elton John",
// The position of this song on the album
"trackNum": 1
}