As a user, I can make a POST request to the endpoint api/v1/favorites. In the body of the POST request, I must include a song title and can optionally include an artist. If the POST request is successful, I see a JSON response with newly posted record for the song and a 201 status. If the user submit invalid information in the POST request body, I should receive a 400 status code and receive a JSON response error message.
This endpoint uses MusixMatch API to get song information using song and optionally artist passed in the POST body request. See requirements below with specific requirements for request and response.
[x] Complete endpoint
[x] Account for sad paths
[x] Testing including sad path
[x] Feature deployed to Heroku
[x] Update README with information about endpoint
Request
POST /api/v1/favorites
Content-Type: application/json
Accept: application/json
body:
{
"title": "We Will Rock You"
}
Successful Response
status: 201
{
"id": 1,
"title": "We Will Rock You",
"artistName": "Queen"
"genre": "Rock",
"rating": 88
}
As a user, I can make a POST request to the endpoint
api/v1/favorites
. In the body of the POST request, I must include a song title and can optionally include an artist. If the POST request is successful, I see a JSON response with newly posted record for the song and a 201 status. If the user submit invalid information in the POST request body, I should receive a 400 status code and receive a JSON response error message.This endpoint uses MusixMatch API to get song information using song and optionally artist passed in the POST body request. See requirements below with specific requirements for request and response.
Request
Successful Response
Unsuccessful Response