You are ask to create an API endpoint api/spotify/createNewPlaylists capable of:
creating a new playlists with empty songs
assigning the user's song choices to the new created Playlists
returning a response
CreateNewPlaylist functionality
This functionality is all about giving the user the opportunity send the new playlist they have customized and created (in our Jamming app) to their own Spotify accounts.
The Button used to trigger this functionality is indicated here:
IMPORTANT This ticket doesn't cover the Button functionality. For that check this other ticker #26
So the Button will have no colors and animations
Playlist customization
For this ticket we just want the customization to cover:
The playlists name indicated here by the user:
And in this case the mock-songs assign by default to the state
This meaning that the state will provide mock-data for you to use and add as default to the playlists to create
Learn more about this app's state here #21
How to create this using the Spotify API?
Here's what you need to know to accomplish this functionality with the Spotify API:
You need to have the access-token retrieved from the spotify API, learn how we did that here #22
With this access-token you are going to make the rest of the calls, passing it as a Bearer token, learn about it here
You need to request the user-id, learn how to do it here
Then, with the user-id you need to make a POST request to make a new empty/default playlists with the indicated name, learn how to do it here
Next, you need to add the mock-songs the to previous and just created playlist, learn how to do it here
This way, you should see a new created playlist in the user's spotify account with the costumized data
Now, in order for you to make the previous process, you first need to create a api/spotify/createNewPlaylist endpoint for this app.
This way the API requests are going to be handled securely
The data that we expect to be return from this api/spotify/createNewPlaylist endpoint is the a responseobject with a snapshot_id property returned from the last spotify API's call.
Learn about that here
State management
You can learn about this app state management in #21 Pull Request
This ticket must not save any data into the global state
Display the data
For the moment you just need to console.log the response!
About the Issue
You are ask to create an API endpoint
api/spotify/createNewPlaylists
capable of:CreateNewPlaylist functionality
This functionality is all about giving the user the opportunity send the
new playlist
they have customized and created (in our Jamming app) to their own Spotify accounts.The
Button
used to trigger this functionality is indicated here:Playlist customization
For this ticket we just want the customization to cover:
mock-songs
assign by default to the stateHow to create this using the Spotify API?
Here's what you need to know to accomplish this functionality with the
Spotify API
:access-token
retrieved from the spotify API, learn how we did that here #22access-token
you are going to make the rest of the calls, passing it as aBearer token
, learn about it hereuser-id
, learn how to do it hereuser-id
you need to make a POST request to make a new empty/default playlists with theindicated name
, learn how to do it heremock-songs
the to previous and just created playlist, learn how to do it hereapi/spotify/createNewPlaylist
Now, in order for you to make the previous process, you first need to create a
api/spotify/createNewPlaylist
endpoint for this app. This way the API requests are going to be handled securelyExpected data
The data that we expect to be return from this
api/spotify/createNewPlaylist
endpoint is the aresponse
object with asnapshot_id
property returned from the last spotify API's call. Learn about that hereState management
You can learn about this app state management in #21 Pull Request This ticket must not save any data into the global state
Display the data
For the moment you just need to
console.log
theresponse
!