Plugins
Templates

Google Calendar + Offline Plugin

Link to plugin page: https://zeroqode.com/plugin/google-calendar-+-offline-1504096048797x789449841875615700

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

  2. Access “API & Services”

  3. Go to the “Credentials” tab and create an OAuth Client ID.

  4. In the “OAuth 2.0 Client IDs” list click on your created OAuth ID’s name. Add your redirect URls in the same fields.

5. Copy Client ID and Client Secret, and past it in plugins settings fields, API Key and API Secret.

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

2. Select the scope Google Calendar API v3 as shown in the image below:

3. And Google OAuth2 API v2 as shown in the image below:

3. 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.

5. Save the refresh token and past it to the field in the Bubble DataBase - User - refresh token

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:

2. Storing a temporary value through custom state:

3. Making changes to user field idToken by storing the id token of the calendar page:

Changelogs

Update 27/11/2020 -

  • Added new API Call for a refresh Access token

Update 01/12/2020 -

  • Plugin Minor fixes

Demo to preview the settings