Google Calendar plus Offline Plugin

Introduction

This plugin lets authorized users access the details of their Calendar events, create new events, or delete events.

Prerequisites

For using the plugin you'll need to get the API credentials as API Key and API Secret. Create your development account at https://console.developers.google.com and enable the Google Calendar API. Also working with Access Token requires the use of Google's Playground - https://developers.google.com/oauthplayground/

Setting up

I. Setup Google Developers Console

  1. Sign in to Google Console: https://console.developers.google.com
  1. Access “API & Services”
  1. Go to the “Credentials” tab and create an OAuth Client ID.
  1. In the “OAuth 2.0 Client IDs” list click on your created OAuth ID’s name. Add your redirect URls in the same fields.
Image without caption
5. Copy Client ID and Client Secret, and past it in plugins settings fields, API Key and API Secret.
Image without caption
💡
Hint: Remember to save your changes to the console.

II. Setting up the Google Playground for Access token action

For this action, you'll need to get a refresh token from google playground:
  1. Select the configuration tab, check the "Use your own OAuth credentials" checkbox and enter the "client ID" and "secret" assigned to a web application on your project
Image without caption
2. Select the scope Google Calendar API v3 as shown in the image below:
Image without caption
3. And Google OAuth2 API v2 as shown in the image below:
Image without caption
After that don't forget to click the "AuthorizeAPIs" button to authorize the settings.

III. Select the account that you will use to log in to google calendar.

4. After that, you'll get the authorization code. Exchange it to 'refresh' and 'access' tokens using the button action below. Use the Auto-refresh token feature.
Image without caption
5. Save the refresh token and past it to the field in the Bubble DataBase - User - refresh token
Image without caption
6. Use this refresh token whenever you need a valid access token.

Plugin Data / Actions Calls

Next, it is possible to use all API Calls and Actions that the plugin provides. Here is the list of them:

Data Calls

Google Calendar Offline - Retrieve List of Calendars: Returns the calendars on the user's calendar list. Google Calendar Offline - Retrieve Calendar Details: Returns specified calendar details. Google Calendar Offline - Retrieve Calendar Events: Returns events on the specified calendar. Google Calendar Offline - Get Event Details: Returns an event from a specified calendar. Google Calendar Offline - Retrieve Recurring Event Instances: Returns a recurring event instance.

Action Calls

Google Calendar Offline - Delete Calendar Event: Deletes an event. Google Calendar Offline - Create a Calendar Event: Creates an event. Google Calendar Offline - Create a Calendar Event with Attendees: Creates an event with attendee's emails. Google Calendar Offline - Create Calendar: Creates a calendar Google Calendar Offline - Delete Calendar: Deletes a calendar Google Calendar Offline - Create an All Day Calendar Event: Creates an all day calendar event Google Calendar Offline - Start Watching Events: See the Events with attendees guide for more information on scheduling event Google Calendar Offline - Stop Watching Events: See the Events with attendees guide for more information on scheduling event Google Calendar Offline - Edit Event: Edits an event details Google Calendar Offline - Get User Profile Info: Retrieves user information Google Calendar Offline - Get Access Token: can update the expired access token. For this action, you'll need to get a refresh token from google playground!
Note: The OAuth Playground will automatically revoke refresh tokens after 24h. You can avoid this by specifying your own application OAuth credentials using the Configuration panel.

Workflow Example

In this example, we demonstrate how to get an access token by exchanging it with a refresh token.
  1. On page load, we set the action to get the access token from the user's refresh token:
Image without caption
2. Storing a temporary value through custom state:
Image without caption
3. Making changes to user field idToken by storing the id token of the calendar page:
Image without caption

Changelogs

Update 27/11/2020 -
  • Added new API Call for a refresh Access token
Update 01/12/2020 -
  • Plugin Minor fixes
Update 31/05/2022 - Version: 1.37.0.
  • The 'Edit Event' call is divided into two calls - with and without the participant's email.
Update 13/07/2022 - Version: 1.38.0.
  • Added new action 'Create a Calendar Event with Attendees (advanced)
  • Added a new 'sendUpdates' parameter to choose whether to notify participants by email or not.
Image without caption
Image without caption

Demo to preview the settings