echo-lab / collab-playlist

A full stack app developed for research on Collaborative Playlists.
2 stars 0 forks source link

Decide proper status codes for some endpoints #59

Open Noam-Bendelac opened 3 years ago

Noam-Bendelac commented 3 years ago

Living document of what status codes different endpoints will have:

Route Status code

Errors: /admin/*, wrong admin key | 4031 /api/*, not logged in2 | 401 /api/playlists/:id[/*], id doesn't exist OR exists but user is not allowed | 404 /api/playlists/:id[/*], spotify playlist doesn't exist (if checked) | 500 Successes: POST /api/playlists/:pid/tracks/:tid/chat | 201 PUT /api/playlists/:pid/tracks/:tid/removed | 200 POST /api/playlists/:id/tracks | 201 POST /api/playlists/:id/chat | 201

1 I think it's ok to say "this resource exists but you don't have access" — the code is open source anyway 2 No access_token cookie OR access_token not found in userid cache; this assumes the refresh token endpoint will be moved out of /api/