API Specification
Contributors: Alicia Wang, Conner Swenberg
Values wrapped in < >
are placeholders for what the field values should be. Also be sure to read the request route carefully when you implement it.
NOTE ABOUT ERROR RESPONSES
The server should return an error response for:
POST
requests, if the user does not supply one of the fields in the body (e.g. name, username, etc.) with a status code of 400 (bad request)GET
,POST
andDELETE
requests, if the requested resource in the URL does not exist, with a status code of 404 (not found)
Expected Functionality
Get all users
GET
/api/users/
Make sure not to include each user’s balance when getting all users - this would be a confidentiality issue in real life!
Create a user
POST
/api/users/
If the user does not supply a name, a username, or both, you should return a failure response with a descriptive error message
Get a specific user
GET
/api/user/{id}/
Delete a specific user
DELETE
/api/user/{id}/
Send money from one user to another
POST
/api/send/
A sender should not be able to overdraw their balance! If a request comes in where the sender sends more money than they have, you should return an error with 400 status code.
Last updated
Was this helpful?