API for HealthCareSystem
All the REST API routes to the server described below.
Create a user.
-
URL
/api/auth/signup
-
Method:
POST
-
Data Params
{ username : username, email : email, password : password, roles : ["user","admin"] }
-
Success Response:
- Code: 200
Content:{ "message": "User was registered successfully!" }
- Code: 200
-
Error Response:
- Code: 400 Bad Request
Content:{ "message": "Failed! Username is already in use!" }
OR
- Code: 500 Internal Server Error
Content:{ "message": "Server Error" }
- Code: 400 Bad Request
Login user with email and password
-
URL
/api/auth/signin
-
Method:
POST
-
Data Params
{ email : email, password : password }
-
Success Response:
- Code: 200
Content:{ "id": "userId", "username": "username", "email": "email", "roles": [ "ROLES" ], "accessToken":"JWT_ACCESS_TOKEN" }
- Code: 200
-
Error Response:
- Code: 404 NOT FOUND
Content:{ "message": "User Not found." }
OR
- Code: 401 Unauthorized
Content:{ "message": "Invalid Password!" }
OR
- Code: 500 Internal Server Error
Content:{ "message": "Server Error" }
- Code: 404 NOT FOUND