OS Services Booking - Google Calendar Sync

Overview

The Google Calendar Sync plugin automatically retrieves events from each resource's (employee's) personal Google Calendar and converts them into busy time slots within OS Services Booking. This ensures customers can only book available time slots that do not conflict with the resource's existing personal schedule.


How It Works

  1. The plugin runs automatically every 3 hours, triggered by website traffic — no cron job required.
  2. Each sync cycle processes one resource at a time, rotating through all configured resources in sequence.
  3. Events fetched from Google Calendar are converted into busy time entries in the resource's profile.
  4. Events originally created by OS Services Booking (tagged osb_source = OS_SERVICES_BOOKING) are automatically skipped to prevent duplicate busy time entries.

Features

Automatic Busy Time Sync

Reads events from a resource's Google Calendar and blocks out the corresponding time slots in OS Services Booking, preventing customers from booking during those periods.

Smart Duplicate Prevention

The plugin recognizes events created by OS Services Booking itself and skips them during sync, avoiding redundant or conflicting busy time records.

Multi-Day Event Support

Events spanning multiple days are handled accurately. The plugin splits them into individual daily records:

  • First day: from the event's start time to 23:59
  • Middle days: full day, 00:00 – 23:59
  • Last day: from 00:00 to the event's end time

Sequential Per-Resource Sync

To avoid overloading the server or Google API, the plugin syncs one resource per cycle. Once all resources have been synced, the rotation restarts automatically.

Multiple Authentication Methods

Supports both types of Google Service Account credentials:

Type File Format Notes
Service Account JSON .json Recommended (modern)
P12 Key .p12 Supported for legacy setups

Requirements

Each resource must be configured with the following Google API credentials to participate in the sync:

Field Description
Client ID Google API application client ID
App Email Address Google Service Account email
Key File Authentication key file (.json or .p12)
Google Calendar ID The ID of the Google Calendar to sync from

Note: Resources missing any of the above fields will be skipped during sync.


Configuration

  1. Install and enable the System - OSB Google Calendar Sync plugin in Joomla's Plugin Manager.
  2. Ensure Google Calendar integration is enabled in OS Services Booking → Configuration.
  3. For each resource, fill in the Google API credentials under their profile in the backend.

Important Notes

  • The sync window covers from today up to 3 months ahead, keeping the data relevant and the API calls lightweight.
  • Busy time records imported from Google Calendar are flagged with feed_from_google = 1, distinguishing them from manually created busy times.
  • If a resource's Google Calendar cannot be accessed (invalid credentials, API error), that resource is skipped and the sync continues with the next one.