Retrieves all stops
-
Resource URI: /stops
-
HTTP Req type: GET
-
Res Content Type: application/json
Parameter |
Type |
Description |
company |
String |
Name of the parking company that manages the parking spots |
plate |
String |
License plate |
email |
String |
Driver email |
HTTP Res Code |
Structure |
Description |
200 OK |
|
Returns the list of stops |
404 Not found |
|
The resource cannot be found |
GET /stops?company=Company1
{
"code": "200",
"status": "success",
"message": "Resource successfully retrieved",
"content": [
{
"driverEmail": "[email protected]",
"start": "2020-01-28T11:17:41.881Z",
"end": "2020-01-28T19:30:39.817Z",
"valid": true,
"paid": null,
"_id": "5e30185521d84707a4195b39",
"parkingId": 1,
"company": "Company1",
"plate": "BB888FF",
"cost": 4
},
{
"driverEmail": null,
"start": "2020-01-28T15:44:38.304Z",
"end": null,
"valid": false,
"paid": null,
"_id": "5e3056e6db3f7a3d748dd8d4",
"parkingId": 1,
"company": "Company1",
"plate": "EF234GH",
"cost": null
}
]
}
Updates a stop to add a timestamp of the driver’s payment.
-
Resource URI: /stops/:id
-
HTTP Req type: PATCH
-
Res Content Type: application/json
Parameter |
Type |
Description |
id |
String |
Id of the stop |
HTTP Res Code |
Structure |
Description |
200 OK |
|
Resource has been successfully updated |
404 Not found |
|
The resource cannot be found |
PATCH /stop/5e30185521d84707a4195b39
{
"code": "200",
"status": "success",
"message": "Resource successfully updated",
"content": [
{
"driverEmail": "[email protected]",
"start": "2020-01-28T11:17:41.881Z",
"end": "2020-01-28T19:30:39.817Z",
"valid": true,
"paid": 2020-01-28T22:32:39.817Z,
"_id": "5e30185521d84707a4195b39",
"parkingId": 1,
"company": "Company1",
"plate": "BB888FF",
"cost": 4
}
]
}
The stops simulation APIs allow to simulate the arrival and departure of a driver. When a vehicle parks, the sensor detects the plate number and checks for a booking. If there are no bookings, the stop is considered invalid.
Simulates a driver parking on a specific parking spot by creating a new stop document.
-
Resource URI: /stop/start
-
HTTP Req type: POST
-
Req Content Type: application/x-www-form-urlencoded
-
Res Content Type: application/json
Parameter |
Type |
Description |
parking |
Int |
Parking ID |
company |
String |
Name of the company that manages the parking spot |
plate |
String |
License plate read by the sensor |
HTTP Res Code |
Structure |
Description |
201 Created |
|
Resource has been successfully created |
POST /stop/start
{
"code": "201",
"status": "success",
"message": "Resource successfully created",
"content": [
{
"driverEmail": "[email protected]",
"start": "2020-01-28T11:17:41.881Z",
"end": null,
"valid": true,
"paid": null,
"_id": "5e30185521d84707a4195b39",
"parkingId": 1,
"company": "Company1",
"plate": "BB888FF",
"cost": null
}
]
}
}
Simulates a driver leaving a parking spot. When the driver leaves, the corresponding stop document is updated with the departure timestamp, and the total cost is calculated.
-
Resource URI: /stops/end
-
HTTP Req type: PATCH
-
Res Content Type: application/json
Parameter |
Type |
Description |
parking |
Int |
Parking ID |
company |
String |
Name of the company that manages the parking spot |
plate |
String |
License plate read by the sensor |
HTTP Res Code |
Structure |
Description |
200 OK |
|
Resource has been successfully updated |
404 Not found |
|
The resource cannot be found |
PATCH /stop/end
{
"code": "200",
"status": "success",
"message": "Resource successfully updated",
"content": [
{
"driverEmail": "[email protected]",
"start": "2020-01-28T11:17:41.881Z",
"end": "2020-01-28T19:30:39.817Z",
"valid": true,
"paid": null,
"_id": "5e30185521d84707a4195b39",
"parkingId": 1,
"company": "Company1",
"plate": "BB888FF",
"cost": 4
}
]
}
}