Use Google Calendar as a data source

Resources

Data Source Type: REST/URL
Authentication: OAuthToken Authentication
Sample Query Basic query:
https://www.googleapis.com/calendar/v3/calendars/mycalendaremail@gmail.com/events

The above query with additional time and date parameters:
https://www.googleapis.com/calendar/v3/calendars/mycalendaremail@gmail.com/events?timeMin={date.startOfWeek.format("yyyy-MM-dd'T'HH:mm:ss")}-04:00&timeMax={date.endOfWeek.format("yyyy-MM-dd'T'HH:mm:ss")}-04:00
API Documentation Google Calendar API Documentation
API Explorer Google Calendar API explorer

Step-by-Step

Creating a data source using Google Calendar

To create a data source using Google Calendar data, you need to accomplish these tasks:

  • Start the data source creation process.
  • Write a query and enter it in Klipfolio.

Step 1. Start the data source creation process

To create a data source using Google Calendar, go to the Connector Gallery page in Klipfolio and select Google Calendar.

Step 2: Write a query and enter it into Klipfolio

Here is a sample query that will help you create a simple API call.

To retrieve all calendar events:

https://www.googleapis.com/calendar/v3/calendars/yourcalendaremail@gmail.com/events

  1. Enter the above query in the URL field in Klipfolio.
  2. At Data Format, select JSON.
  3. At Method, select GET.

Add to the query

You can use the base query above to retrieve all calendar events, or you can add query parameters to retrieve more specific information with the help of the Google Calendar API Documentation and Google Calendar API explorer.

Use the Google Calendar API explorer

The best way to build your query and add parameters is with the Google Calendar API explorer.

  1. Navigate to the Navigate to the Google Calendar API explorer.
  2. At Authorize requests using OAuth 2.0 (top right corner of the page) click the ON button.
  3. In the popup window, select Authorize.
  4. Choose the appropriate Google account for your calendar.
  5. Select Accept.
  6. Enter your chosen calendar ID
  7. Add any additional fields to the query string.
  8. Select Execute.
  9. Copy the Request URL into Klipfolio.

In the example above, we build off the base URL above and add date, time and week parameters.

Find a Calendar ID and time zone

Your calendar ID is typically the email address associated with your Google Calendar account. Your time zone is a value offset from UTC. If you are unsure of your calendar ID and/or time zone,

  1. Navigate to Google Calendar
  2. In the drop down menu of your chosen calendar, select Calendar settings.
  3. At Calendar Address, copy the calendar ID.
  4. At Calendar Time Zone copy the time zone in the same format. For example, -04:00.

Related Links