Skip to content

Algorithm Related

Brendan Lai edited this page Mar 23, 2021 · 8 revisions

Endpoint

POST: /groups/generatePlaylist

Endpoint used to generate a playlist. Collects the user data from everyone in the group. Pass all the user ids that should be used for the playlist.

Request Body: 
{ 
  groupCode: String, 
  userID: [String], 
  refreshToken: String,
  playlistName: String
}

POST: /groups/AddToSpotify

Endpoint used to add a previously generated playlist to the users Spotify. Request body below. Someone correct me if I'm using the right request too. Note that the playlistID is the corresponding objectID in mongoDB. the prop name in mongoDB is "_id". It responds with message successful and the corresponding spotifyPlaylistID which can be used to find the playlist doing: "https://open.spotify.com/playlist/:playlistID>"

{
   playlistID: String,
   refreshToken: String,
   groupCode: String
}

POST: /groups/generateMoodsPlaylist

Generate groups mood based playlist. Must select between the four options ("sad" "chill" "party" "happy"). note that party is the only half well implemented mood really I think.

{ 
  groupCode: String, 
  userID: [String], 
  refreshToken: String,
  playlistName: String,
  selectedMood: String
}

// Create playlist Post generate playlist // Add plyalist to Spotify // get group playlist

Clone this wiki locally