Skip to main content
Google Calendar
Updated this week

By integrating Google Calendar with DX, you can measure time spent in meetings to analyze and improve developer focus time. DX imports historical events from Google Calendar, only for DX contributors.

To ensure accuracy in what is categorized as a meeting, DX excludes the following calendar items from being imported:

  • Events with duration of less than 15 minutes or more than 4 hours

  • Events with a single attendee

Prerequisites

To connect Google Calendar to DX, you need:

  • a Google Cloud service account

  • Domain Wide Delegation enabled

Setup instructions

Follow the steps below to connect Google calendar to DX.

Step 1

Enable the Google Calendar API using the following steps:

  1. Go to the API Console.

  2. From the projects list, select a project or create a new one.

  3. If the APIs & services page isn't already open, open the console left side menu and select APIs & services, and then select Library.

  4. Click on Google Calendar API. If you need help finding the API, use the search field.

  5. Click ENABLE.

Reference: Link

Step 2

A service account is a special kind of account typically used by an application to make authorized API calls through domain-wide delegation.

To setup service account, follow these steps:

  1. In the Google Cloud console, go to the Create service account page. The remaining steps appear in the Google Cloud console.

  2. Select a Google Cloud project.

  3. Enter a service account name to display in the Google Cloud console.

    The Google Cloud console generates a service account ID based on this name. Edit the ID if necessary. You cannot change the ID later.

  4. Optional: Enter a description of the service account.

  5. If you don't want to set access controls now, click Done to finish creating the service account. To set access controls now, click Create and continue and continue to the next step.

  6. Optional: Choose one or more IAM roles to grant to the service account on the project.

  7. When you are done adding roles, click Continue.

  8. Optional: In the Service account users role field, add members that need to attach the service account to other resources.

  9. Optional: In the Service account admins role field, add members that need to manage the service account.

  10. Click Done to finish creating the service account.

  11. The Unique ID of the service account is the Client ID that needs to be entered when enabling Domain-wide delegation in the next step.

Reference: Link

Step 3

Domain-wide delegation lets you grant client applications permission to access your Workspace users' data without requiring their consent.

  1. Sign in with a super administrator account to the Google Admin console.

    If you aren’t using a super administrator account, you can’t complete these steps.

  2. Click Add new.

  3. Enter the Client ID for either the service account or the OAuth2 client.

  4. In OAuth Scopes, add https://www.googleapis.com/auth/calendar.readonly

  5. Click Authorize. If you get an error, the client ID might not be registered with Google or there might be duplicate or unsupported scopes. If Multi-party approval is enabled for your organization, authorizing domain-wide delegation for a client app requires approval from another super admin.

  6. Point to the new client ID, click View details, and make sure that every scope is listed. If a scope is not listed, click Edit, enter the missing scope, and click Authorize. You can't edit the client ID.

Reference: Link

API Reference

The table below lists the specific API endpoints that are used by DX.

Endpoint URL

Link to Endpoint Documentation

Permissions Needed

events

List the events in a user's calendar

Errors

The table below lists potential error codes when adding a connection in DX.

Error

Description

invalid_credentials

Your API credentials entered are not valid.

invalid_permissions

Your API token does not have the permissions required by DX.

no_resources

Your service account does not have access to any projects or repositories.

Did this answer your question?