A user represents a web application user. This can be a parking company, municipality or municipal police employee.
Post user credentials to retrieve the authentication token.
-
Resource URI: /login
-
HTTP Req type: POST
-
Req Content Type: application/x-www-form-urlencoded
-
Res Content Type: application/json
Parameter |
Type |
Description |
email |
String |
User email |
password |
String |
User password |
HTTP Res Code |
Structure |
Description |
200 OK |
|
Returns the user’s authentication token |
404 Not Found |
|
Resource cannot be found |
Registers a new user
-
Resource URI: /users
-
HTTP Req type: POST
-
Req Content Type: application/x-www-form-urlencoded
-
Res Content Type: application/json
Parameter |
Type |
Description |
name |
String |
User name |
surname |
String |
User surname |
email |
String |
User email |
role |
String |
User role:
- Municipality
- ParkingCompany
- Police
|
company |
String |
User company (Only if user is a parking company employee) |
password |
String |
User password |
HTTP Res Code |
Structure |
Description |
200 OK |
|
User has been successfully registered. Returns the user’s authentication token |
422 Unprocessable Entity |
|
User already exists |
Sends bearer token to return user’s data.
-
Resource URI: /users
-
HTTP Req type: GET
-
Res Content Type: application/json
HTTP Res Code |
Structure |
Description |
200 OK |
|
Returns user data |
401 Unauthorized |
|
Invalid or missing authorization token |
GET /users
{
"company": null,
"_id": "5dfe2a7fabe3ee3954e6935d",
"name": "Morena",
"surname": "Barboni",
"email": "[email protected]",
"username": "morena",
"role": "Municipality",
}