Skip to main content

Google project setup

TheBooking uses one Google Cloud project and one OAuth web client for all Google Accounts connected to the WordPress site.

Before you begin​

  • Serve WordPress over HTTPS.
  • Sign in to the Google account that is to own the Cloud project.
  • In TheBooking, open Settings > Integrations and turn on Google Calendar. Then open Settings > Google Calendar, and keep the Google API Redirect URI and Google API Authorized JS Origin at hand.
The Google API Redirect URI and Authorized JS Origin to copy into the OAuth client in Google Cloud

Configure Google Cloud​

  1. Create or select a dedicated project in the Google Cloud console.
  2. Enable the Google Calendar API from the API Library.
  3. Configure the Google Auth consent screen with an application name, support email, and developer contact.
  4. Add test users while the application is in testing, or complete Google's publication and verification requirements for the intended audience.
  5. Create an OAuth client with application type Web application.
  6. Add the exact authorized redirect URI and JavaScript origin shown by TheBooking. A mismatch produces Google's redirect_uri_mismatch error.
The OAuth client in the Google Cloud console, with the authorized redirect URI, the client ID, and the client secrets
  1. In Settings > Google Calendar, enter the client ID in API Client ID, the client secret in API Client Secret, and the name of the application in API App Name.

Do not publish the client secret, place it in documentation screenshots, or reuse credentials from an unrelated application.

Google changes the console navigation regularly. Refer to Google's current web-server OAuth guide if a label has moved.

Settings​

Settings > Google Calendar appears when Google Calendar is on under Settings > Integrations.

SettingWhat it doesDefault
API Client IDThe client ID of the OAuth client.Empty
API Client SecretThe client secret of the OAuth client. Keep it private.Empty
API App NameThe name of the OAuth consent screen, which users see when they authorize the account.Empty
Allow service providers to connect their own Google AccountLets providers connect their own accounts. It appears when providers are enabled. See Connect a Google account.Off
Allow service providers to use override commands.Lets providers use slot commands in the titles of their events. It appears when providers are enabled, can manage their own availability, and can connect their own accounts. See Providing availability.Off
Google Calendar refresh delayHow long, in seconds, TheBooking keeps the availability read from Google Calendar before reading it again. With 0, it reads Google Calendar at every request. A longer delay saves Google API quota, but changes in Google Calendar appear later.60
Google API Redirect URIThe address to copy into the authorized redirect URIs of the OAuth client.—
Google API Authorized JS OriginThe origin to copy into the OAuth client, only if Google asks for it.—

Next step​

Connect a Google account and verify that its calendars are listed before assigning calendar roles.