Auth - Login user
/users/login
Parameter
| Field | Type | Description |
|---|---|---|
| String |
email, must be unique |
|
| password | String |
password |
| name | String |
name |
| role_id | Integer |
user's role_id |
{
"email": "janedoe@example.com",
"password": "thisisabadpassword",
"name": "Jane Doe",
"role_id": 3
}
Success 200
| Field | Type | Description |
|---|---|---|
| message | String |
welcome message |
| user_id | Integer |
user's id |
| token | String |
JSON web token |
HTTP/1.1 200 OK
{
"message": "Welcome Jane Doe!",
"user_id": 3,
"token" : "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6InRlc3RAZXhhbXBsZS5jb20iLCJpYXQiOjE1NjkzMDA3NTUsImV4cCI6MTU2OTM4NzE1NX0.MqSP9WknoX-hqVuhPxcqgeMDUyt9DA4nU34OjTQLo2k"
}
Error 4xx
| Name | Type | Description |
|---|---|---|
| UnauthorizedUser | 404 |
The user's credentials are invalid |
HTTP/1.1 404 Unauthorized
{
"message": "Invalid credentials."
}