Skip to content
Brojowski edited this page Jan 16, 2018 · 10 revisions

*Create a new user

POST/users{"email": String,"password": String,"client": String}HTTP/1.1201Created{"key": String,"token": String,"role": String,"refresh": String,"expires": String}

*Quickly create a fully applied user (for registering at the door)

POST/users/quickAuth->admin,staff{"name": String,// full name"email": String,// email address"phone": String// phone number}HTTP/1.1201Created{"_id": String,"email": String,"role": String,"created": Date,"application": {"name": String,"school": String,"phone": String,"shirt": String,"demographic": Boolean,"first": Boolean,"dietary": String,"year": String,"age": Number,"gender": String,"major": String,"conduct": Boolean,"travel": Boolean,"waiver": Boolean,"status": String,"going": Boolean,"checked": Boolean,"created": Date,"door": Boolean}}

Get a key and token

POST/users/token{"email": String,"password": String}HTTP/1.1201Created{"key": String,"token": String,"role": String}

Remove a token

DELETE/users/tokenAuthHTTP/1.1200OK

Get a list of all users

GET/usersAuth->admin,staffHTTP/1.1200OK{"users": [{"_id": String,"email": String,"role": String,"created": Date}]}

Get a user by ID

GET/users/:idAuth->admin,staffHTTP/1.1200OK{"_id": String,"email": String,"role": String,"created": Date}

*Partially update the logged in user

PATCH/usersAuth{"email": String,"password": String}HTTP/1.1200OK{"_id": String,"email": String}

*Partially update a user by ID

PATCH/users/:idAuth->admin{"role": 'attendee'|'staff'|'admin'}HTTP/1.1200OK{"_id": String,"email": String,"role": String,"created": String}

*Delete a user

DELETE/users/:idAuth->adminHTTP/1.1200OK{"_id": String}

Reset a password

This will send an email with a randomly generated new password to the user

POST/users/reset{"email": String}HTTP/1.1200OK{}

Clone this wiki locally