-
Notifications
You must be signed in to change notification settings - Fork 1
User Routes
Alex Aralis edited this page Aug 1, 2017
·
7 revisions
Authorization token NOT required. Creates a new user and returns a session token along with the user data.
POST /user
requires
{
email: String,
username: String,
password: String,
isTutor: ?Boolean,
subjects: ?Array<String>,
zipCode: ?Number,
wage: ?Number,
}returns
{
token: String,
user: {
_id: String,
email: String,
username: String
isTutor: Boolean,
subjects: Array<String>,
zipCode: Number,
wage: Number,
}
}Authorization required. Returns the given tokens user information.
GET /user
returns
{
_id: String,
email: String,
username: String,
isTutor: Boolean,
subjects: Array<String>,
zipCode: Number,
wage: Number,
}Get single user. requires auth.
GET /user/:userId
returns
{
user: User,
message: string,
}Authorization required. Deletes the user account if the password of the account associated with the provided authorization token is provided.
DELETE user/
requires
{
password: String
}
returns
```javascript
{
user: User,
message: String
}
Authorization required. If the field exists in the User model, update that field with the given value. Fields that are not part of the user model will be ignored.
PATCH /user
requires
{
username: ?String,
email: ?String,
password: ?String,
isTutor: ?Boolean,
subjects: ?Array<String>,
zipCode: ?Number,
wage: ?Number,
}returns
{
user: User
}