- Login a user
POST /api/users/login
- Register a user
POST /api/users/register
- Confirm email
POST /api/users/confirmemail
- Reset password
POST /api/users/resetpassword
- Confirm reset password
POST /api/users/confirmpassword
- Update and return updated user
POST /api/users/update
- Read and return a user
POST /api/users/read
- Query and return users
POST /api/users/query
Login a user
URL : /api/users/login
Method : POST
Authentication : Logged out
Data Constraints
{
"email": "(STRING - REQUIRED) The email of the user",
"password": "(STRING - REQUIRED) The unhashed password of the user",
"sessionId": "(STRING - OPTIONAL) The current session id"
}
Response Code
200: OK
400: Argument Validation Errors
400: User not found
401: Unauthorized
500: Database Error
Success Response
{
"status": "200",
"response": {
"id": "1",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
}
}
Error Response
{
"status": "400",
"response": {
"error": "Invalid email/password"
}
}
{
"status": "400",
"response": {
"error": "User not found"
}
}
{
"status": "401",
"response": {
"error": "Already logged in"
}
}
{
"status": "500",
"response": {
"error": "Mybatis error"
}
}
Register a user
URL : /api/users/register
Method : POST
Authentication : Logged out
Data Constraints
{
"name": "(STRING - REQUIRED) The name of the new user",
"email": "(STRING - REQUIRED) The email of the user",
"phone": "(STRING - REQUIRED) The phone of the user",
"password1": "(STRING - REQUIRED) The unhashed password1 of the user",
"password2": "(STRING - REQUIRED) The unhashed password2 of the user"
}
Response Code
200: OK
400: Argument Validation Errors
400: User already exists
401: Unauthorized
500: Database Error
Success Response
{
"status": "200",
"response": {
"id": "1",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
}
}
Error Response
{
"status": "400",
"response": {
"error": "Invalid email/password"
}
}
{
"status": "400",
"response": {
"error": "User already exists"
}
}
{
"status": "401",
"response": {
"error": "Already logged in"
}
}
{
"status": "500",
"response": {
"error": "Mybatis error"
}
}