Booking
This guide covers the different aspects of Booking in the MapsIndoors Web SDK. The concept of booking in MapsIndoors implies that specific Locations in your MapsIndoors dataset are treated as bookable resources. Typical bookable resources are meeting rooms and workspaces.
A MapsIndoors dataset can only have bookable resources if an integration with a booking provider exists. Examples of booking providers are Google Calendar and Microsoft Office 365. These providers and more, can be added and integrated to your MapsIndoors solution by request.
The central service in the SDK managing bookings is the Booking Service, mapsindoors.services.BookingService
.
The Booking Service can help with the following tasks:
List Bookable Locations
Work with Bookings
Listing Bookings for a Location
Performing a Booking of a Location
Cancelling a Booking of a Location
By default, the
BookingService
performs anonymous bookings using a service account known to MapsIndoors. However, it is also possible to list, perform and cancel Bookings on behalf of a user.
Bookable Locations
To determine whether or not a Location is bookable, you can use the bookingService.getBookableLocationsUsingQuery()
method. Below is an example of querying for bookable Locations:
The above example creates a query for Locations that are bookable for a time span between now and 1 hour ahead.
To check if a specific Location is bookable, it is possible to parse the Location
object as a parameter to the getBookingsUsingQuery
function.
Bookings
A booking is a time-boxed event model referring to the resource being booked and the users participating in the booked event.
Listing Bookings for a Location
Before trying to book a Location for a given time, it is convenient to know in advance, whether or not the Location is already booked for the given time.
It is possible to get a list of bookings using the bookingService.getBookableLocationsUsingQuery()
method.
The above example creates a query for bookings that exist for a location with timespan between 1 hour ago and 24 hours ahead.
Performing a Booking of a Location
It is possible to execute a booking creation request using the bookingService.performBooking()
method, which takes a booking object as input. If the booking is successfully performed, the booking will return in the block, with an assigned bookingId
.
In the above example a Booking
object is created and several properties are assigned:
The ID of related Location object
A title for the booking
A description for the booking
Participants for the Event being created through the booking
Start and end time
Depending on the booking provider, the participants will receive invites for an event created by this booking request.
Cancelling a Booking of a Location
It is possible to cancel a created Booking
using the bookingService.cancelBooking()
method, which takes an existing Booking
object as input.
Last updated