Skip to main content
Sniko’s Appointment Tool can sync with Google Calendar and Microsoft (Outlook) Calendar. When a calendar is connected, Sniko reads existing events to determine availability and writes new bookings back to the calendar. Each Appointment Tool maintains its own calendar connections, so different tools can connect to different calendars.

Google Calendar

Create an OAuth app

1

Create a Google Cloud project

Go to console.cloud.google.com, create a new project (or select an existing one), and enable the Google Calendar API under APIs & Services → Library.
2

Configure the OAuth consent screen

Under APIs & Services → OAuth consent screen, set the app name, support email, and authorized domain. Add the following scopes:
  • https://www.googleapis.com/auth/calendar
  • https://www.googleapis.com/auth/calendar.events
Set the app to External if your users are outside your Google Workspace organization.
3

Create OAuth credentials

Under APIs & Services → Credentials, click Create Credentials → OAuth client ID. Choose Web application.Add your callback URL as an Authorized redirect URI:
{APP_URL}/calendar/google/callback
Download the credentials JSON or copy the Client ID and Client Secret.
4

Add credentials to your .env

.env
GOOGLE_CLIENT_ID=your_google_client_id.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=your_google_client_secret
GOOGLE_REDIRECT_URI=${APP_URL}/calendar/google/callback
The redirect URI is derived automatically from APP_URL in config/services.php. Make sure APP_URL matches the domain registered in your Google OAuth app exactly, including the scheme (https://).

Callback URL

GET {APP_URL}/calendar/google/callback
This route handles the OAuth code exchange with Google, validates the CSRF token embedded in the state parameter, and stores the access and refresh tokens against the Appointment Tool’s calendar record.

Microsoft Calendar (Outlook)

Register an Azure app

1

Create an app registration

Go to portal.azure.com and navigate to Azure Active Directory → App registrations → New registration.Set the name, and under Supported account types choose the appropriate option:
  • Accounts in this organizational directory only — for single-tenant deployments
  • Accounts in any organizational directory and personal Microsoft accounts — for multi-tenant or personal account support
2

Add a redirect URI

Under Authentication → Add a platform → Web, add the redirect URI:
{APP_URL}/calendar/microsoft/callback
3

Add API permissions

Under API permissions → Add a permission → Microsoft Graph, add the following Delegated permissions:
  • Calendars.ReadWrite
  • offline_access
  • User.Read
Click Grant admin consent if your organization requires it.
4

Create a client secret

Under Certificates & secrets → New client secret, create a secret and copy its value immediately (it will not be shown again).
5

Add credentials to your .env

.env
MICROSOFT_CLIENT_ID=your_azure_application_client_id
MICROSOFT_CLIENT_SECRET=your_azure_client_secret_value
MICROSOFT_REDIRECT_URI=${APP_URL}/calendar/microsoft/callback
MICROSOFT_TENANT_ID=common
Set MICROSOFT_TENANT_ID to your Azure tenant ID to restrict sign-in to your organization, or leave it as common to allow personal and work accounts.

Callback URL

GET {APP_URL}/calendar/microsoft/callback
This route exchanges the authorization code with Microsoft’s token endpoint and stores the tokens. Microsoft Calendar connections are stored internally with the provider identifier outlook.

Connecting a calendar to an Appointment Tool

1

Open an Appointment Tool

Navigate to Appointment Tools, then open the tool you want to connect a calendar to. Click Edit.
2

Select a provider

In the Calendar Connections section, click Connect Google Calendar or Connect Microsoft Calendar.Sniko calls the connection API (POST /appointment-tools/{id}/calendar-connections/google/connect or .../microsoft/connect). If your OAuth credentials are not configured in .env, you will see an error prompting you to add them.
3

Authorize access

You are redirected to the Google or Microsoft OAuth consent screen. Sign in and grant calendar access.
4

Confirm the connection

After authorization, you are redirected back to the Appointment Tool edit page with a success message. The calendar connection status changes to Active and sync is enabled automatically.

Sync direction

Each calendar connection has a configurable sync direction. Update it under the calendar connection settings:
SettingBehavior
bothImport events from the calendar and export new bookings to it (default)
import_onlyRead the calendar to determine availability; do not write new bookings back
export_onlyWrite new bookings to the calendar; ignore existing calendar events for availability

Webhook registration

Sniko registers push notification channels with Google and Microsoft so calendar changes are reflected in near real time without polling. These channels are renewed automatically before they expire. Inbound calendar webhook notifications are received at:
ProviderURL
Google CalendarPOST {APP_URL}/calendar/webhooks/google
Microsoft CalendarPOST {APP_URL}/calendar/webhooks/microsoft
These endpoints do not require authentication and are verified by provider-specific validation (Google uses a channel token; Microsoft uses a client state secret).

Manual sync

To trigger an immediate sync from the calendar to Sniko:
POST /appointment-tools/{id}/calendar-connections/{provider}/sync
This endpoint is rate-limited to 5 requests per minute per user. The response includes events_imported, events_updated, and events_count.

Disconnecting a calendar

To disconnect a calendar, click Disconnect on the calendar connection or call:
POST /appointment-tools/{id}/calendar-connections/{provider}/disconnect
This sets sync_enabled to false and the connection status to inactive. Existing bookings are not deleted, but the calendar will no longer sync. To reconnect, start the OAuth flow again.
Disconnecting a calendar does not revoke the OAuth token on the provider side. To fully revoke access, visit your Google Account or Microsoft Account security settings and remove Sniko from the connected apps list.

Build docs developers (and LLMs) love