-
Notifications
You must be signed in to change notification settings - Fork 1
Users
Users belong to a particular organization. There are varying roles that a user can take from user to company recruiter. Any comment left for a student is tied to a User account
The following routes are supported for performing operations on the User entity.
RegisterUser POST /user
Login POST /auth/login
GetUser GET /user/{userKey}
GetUsers GET /user/org/{orgKey}
GetUsersByOrgName GET /user/orgName/{orgName}
UpdateUser PUT /user/{userKey}
DeleteUser DELETE /user/{userKey}
A user contains sufficient information to be able to login and perform operations on behalf of an organization.
name string Name
email string Email address, used for authentication
password string Account password, think about not returning when getting User(s), code was removed at some point
Note: to run in Postman, just take the information contained in the quotes of --data and paste in the body field.
Registers a User to the database
curl -X POST http://xtern-matching.appspot.com/user \
--data '{"name": "Joe Smith",
"email":"somewhere@gmail.com",
"password":"user1",
"orgKey": 123456}'None
User already exists in Datastore
Error executing query
Error hashing password
Invalid structure for Datastore
Attempts a login with the given credentials and generates a web token for authentication
xtern-matching.appspot.com/login
curl -X POST xtern-matching.appspot.com/login \
--data '{ "email":"somewhere@gmail.com",
"password":"user1"}'{token: , organizationName : }
#### Errors
##### Internal Server Error 500:
> Error hashing password
Error validating user
***
### <a name="GetUser"></a>GetUser
> Gets the corresponding user associated with the particular key
#### URL Structure:
> xtern-matching.appspot.com/user/{userKey}
#### Example Request:
```bash
curl -X GET xtern-matching.appspot.com/user/123456
User JSON Representation
Error executing query
Datastore ErrFieldMismatch if types do not agree of if data structure models differ
Gets Users that are associated with a particular organization
xtern-matching.appspot.com/user/org/{orgKey}
curl -X GET xtern-matching.appspot.com/user/org/123456List_of(User JSON Representation)
Error executing query
Error decoding orgKey Datastore ErrFieldMismatch if types do not agree of if data structure models differ
Gets Users that are associated with a particular organization by organization name
xtern-matching.appspot.com/user/orgName/{orgKey}
curl -X GET xtern-matching.appspot.com/user/orgName/"Qualcomm"List_of(User JSON Representation)
Error executing query
Error getting orgKey from orgName Datastore ErrFieldMismatch if types do not agree of if data structure models differ
Updates a user in the database. Uses the Id provided in the JSON request body to update the User. If the password is to remain the same, use "" for the value
xtern-matching.appspot.com/user/
curl -X PUT xtern-matching.appspot.com/user/123456 \
--data '{"name": "Joe Smith",
"email":"somewhere-different@gmail.com",
"password":"user1"}'None
Error hashing new password
Datastore ErrFieldMismatch if types do not agree of if data structure models differ
Removes a User from the database
xtern-matching.appspot.com/user/{userKey}
curl -X DELETE xtern-matching.appspot.com/user/6348855016685568None
Error deleting User in Datastore