GCalendar Integration

[TOC] OS Services Booking provides an option to integrate your booking system with Google Calendar. This integration works as follows:

  • When a customer books an appointment with a resource, the appointment is automatically added to that employee’s Google Calendar.
  • If the booking request is canceled or removed by the administrator or the customer, the corresponding appointment will be removed from the employee’s Google Calendar as well.

This feature helps resources keep track of their schedules in real-time and ensures that their availability remains up to date.

OS Services Booking does not check an resource’s Google Calendar availability before adding an appointment to it. This means that even if the resource already has an event scheduled on Google Calendar, OS Services Booking will still add the new booking without detecting conflicts. To prevent double bookings, resources should manually manage their schedules in OS Services Booking or adjust their availability settings accordingly.

To user Google Calendar, you need to have:

  1. A Google Account for creating and using Google Calendars

Three Steps to adding OS Services Booking access to your Google Calendar.

  • Create an App in Google
  • Install the Google library and key file in you OS Services Booking directory
  • Setup to connect OS Services Booking with GCalendar

Create an Google App

Login to Google and go to the Developer's Console..
https://console.developers.google.com/project
Click on 'Create Project'

Enter a name (can be anything you like, here I used OS Services Booking)

Enable Calendar API, Service Account and get Json key
or

If your Google account is G-Suite, you can register the Internal OAuth consent, while if your Google account isn't G-Suite, you just can register External OAuth constent and more complex. Below pictures are Internal consent registration
You need to register OAuth Consent before you can create OAuth Client ID for Web application

Generate a JSON Key

  • In the list of service accounts, click on the newly created service account.
  • Go to the Keys tab.
  • Click Add Key > Create new key.
  • Select JSON and click Create

Download the JSON File
The JSON key file will be automatically downloaded to your computer. Keep this file secure, as it contains sensitive credentials.

Upload the JSON Key to OS Services Booking
After downloading the JSON key file to your computer, please upload it to the following folder:

components → com_osservicesbooking Then, enter the key name information in the resource management section.

The CLIENT ID and EMAIL ADDRESS fields will be needed when you setup an OS Services Booking resource to write to a Google Calendar. Click on Generate new P12 key. Save the generated key on your local PC for later upload to your web site.

Setup “Gcalendar Integration” feature on OSB

Go to Configuration => Tab Booking Configuration and Select Yes at the dropdown select list
After above step, you need to enter the Employee’s Google account and Gcalendar ID. To implement this step, please go to Resource modification page.

Client ID, App Name, App Email Address are all obtained from the Google App Credentials screen above. To get the Calendar ID, open the Calendar settings screen in Google. In the Calendar Settings screen near the bottom you will see the Calendar Address section and on the right the Calendar ID.

Finally you will need to set your calendar as shared with the Google App's email address from above. Enter the Service Account and select permission: Make changes to events

If the option "Make changes to events" is blocked, you need to do below steps to un-block it.

  1. Open this page: https://admin.google.com/ac/appslist/core
  2. Select Application Calendar
  3. Open category: Sharing Setting -> External sharing options for primary calendars, please select option: "Share all information, and allow managing of calendars"
  4. Re-assign Service account to the GCalendar with permission Make changes to events

Now new bookings for this resource will be added to your Google Calendar. If all the above steps are completed, you have successfully configured "Google Calendar Integration". From now on, when a customer makes a booking request for your resource, their Google Calendar will be updated with the appointment.