Booking API
Related Manuals
- Introduction to Fleet Complete API
- API User management
- API calls generic description
- Creating API account
- API Tasks management
Vehicle bookings management
Booking API is generic REST API, you can find full API description here: https://support.fleetcomplete.eu/s/fleet-management-api
To help you start testing here are some hints: You will need to download the YAML file to your computer. Please follow the link below to download YAML file: https://fleetcomplete.my.salesforce.com/sfc/p/#2B0000008aYH/a/JQ000002LiPt/AyJYi0_tdxLsRlh2TdfwiA4coqu07WmmVz1FsqY15AU To test out and browse the functionality we recommend using Swagger: https://editor-next.swagger.io/ (upload the YAML file via File -> Import file)
Authorizations
Run POST command to receive authentication token. Credentials for request body are same credentials you use to login to FC+ application e.g.
- Username: firstname.lastname@emaildomain.com
- Password: password used to login to FC+ application
Once you successfully executed the AUTH command and received authentication details in response click Authorisation in upper right corner. There you put the token provided to you in AUTH response and click Authorise.
Create Booking sequence
The booking is created in 2 steps
- Create Preliminary booking
POST/bookings The body of the request must contain values for parameters:
- "start_time": "string",
- "end_time": "string",
- "vehicle_id": 0,
- "person_id": 0,
- "destination": {
- "address": "Õnne 5, Tartu, Tartu, Tartumaa, EE"}, (lat, lng and areaID is destination node are NOT mandatory)
Once executed, booking is created but it stays in PRELIMINARY status. Preliminary booking is not visible in UI. If preliminary booking is not confirmed it is automatically deleted after some time (~30 mins).
- Convert preliminary booking to confirmed booking
You must run consecutive PATCH command to change booking status to NOTIFIED.
PATCH/bookings To parameters copy booking ID received in response to POST command ran above. You need to use the same request body as used in POST command but make sure ‘status’ value says ‘notified’. (if you need to make changes such as add some field values you can do within the same run) Run PATCH command to change booking status to ‘NOTIFIED’.
Once patched, booking becomes visible in UI, and notification email is triggered.
Other commands in booking sequence are run the same way by using booking ID.
Formatting hints
- TIME: "YYYY-MM-DDThh:mm:ss+02:00", (timezone hours depend on the country)
- VEHICLEID & PERSONID: ID numbers assigned to driver and vehicle as per FC+ setup.
- DESTINATION: lat & lng &areaID are NOT mandatory. You can only type address e.g. Viru 1, Tallinn, Tallinn, Harjumaa, EE
User section hints
Many commands run based on authorization token and do not require additional parameters. Commands where parameters are needed:
- Command: Get/users/me/bookings/available
End time parameter is mandatory. Response will show available vehicles based on stated end time.
- Command: Get/users/me/bookings/slots
End time parameter is mandatory. Response gives time slots when there are cars available.
NB! There is no possibility to create recurring booking via API.