A booking is a parking reservation made by the driver. A parking spot needs to be booked in order for a stop to be considered valid.
POST /companies/:name/bookings
Creates a new booking for a specific parking spot and.
-
Resource URI: /companies/:name/bookings
-
HTTP Req type: POST
-
Req Content Type: application/x-www-form-urlencoded
-
Res Content Type: application/json
| Parameter |
Type |
Description |
| name |
String |
Name of the company that manages the parking spots |
| Parameter |
Type |
Description |
| parkingId |
Int |
Parking ID |
| email |
String |
Email of the driver |
| plate |
String |
License plate of the driver’s vehicle |
| HTTP Res Code |
Structure |
Description |
| 201 Created |
|
Resource has been successfully created |
| 422 Unprocessable Entity |
|
The parking spot has already been booked |
| 404 Not Found |
|
The parking spot or the company do not exist |
POST /companies/:name/bookings
{
"code": "201",
"status": "success",
"message": "Resource successfully created",
"content": {
"_id": "5e568d8f1ddc39111899206e",
"expireAt": "2020-02-26T15:23:59.039Z",
"company": "Company1",
"parkingId": 1,
"plate": "BB888FF",
"driverEmail": "[email protected]"
}
}