POST /api/v1/users
Should have a JSON body of "{ "name": "Drake", "email": "imamuppet@gmail.com" }
Content-Type: application/json
Accept: application/json
{
"name": "Drake",
"imamuppet@gmail.com"
}
This POST endpoint should NOT call your endpoint like /api/v1/users?name=Athena Dao&email=athenadao@bestgirlever.com. You must send a JSON payload in the body of the request:
-- In Postman, under the address bar, click on “Body”, select “raw”, which will show a dropdown that probably says “Text” in it, choose “JSON” from the list
-- This is a hard requirement to pass this endpoint!
A successful request creates a user in your database, and generates a unique api key associated with that user, with a 201 status code.
THIS IS NOT REAL AUTHENTICATION – Real authentication using bcrypt is an extension. The expectations for this endpoint is that upon creation of this user, a randomly generated code should be stored in the database for that user. This code will be used to add favorites to a particular user’s favorite list.
Email addresses must be unique. If a unique email address is not used for registration, an appropriate error message should be returned in the response.
User Registration
Request:
Response:
Requirements:
WireFrames: