Set up Google Calendar spoke

  • Release version: Washingtondc
  • Updated August 3, 2023
  • 4 minutes to read
  • Set up an outbound integration between your ServiceNow instance and the Google Calendar Application Programming Interfaces (API) by setting up a connection and credential record.

    Before you begin

    • Request Integration Hub subscription.
    • Activate the Google Calendar spoke plug-in.
    • Ensure that you have a Google Workspace account
    • Ensure that you have a domain and an email address related with the domain. For example, www.mydomain.com and jane-admin@mydomain.com.
      Note:
      you can only register one email address per domain in Google Workspace.
    • Role required: admin

    Create OAuth application on Google Calendar

    Create an OAuth application on the Google Calendar that authenticates requests to access the Google Calendar APIs from your ServiceNow instance. After successful authentication, you can generate an OAuth token that your ServiceNow can use to access the Google Calendar APIs.

    Before you begin

    Google Calendar spoke integration requirements:
    • A domain and an email address associated with the domain. For example, www.mydomain.com and jane-admin@mydomain.com. Note that you can only register one email address per domain in Google Workspace.
    • Google Workspace login credentials created with the same domain.

    Role required: admin.

    Procedure

    1. Log in to https://console.developers.google.com with your Google Workspace credentials.
    2. Create a project on Google Workspace.
      The project provides the OAuth application and the permissions to access the Google Calendar APIs from your ServiceNow instance.
      1. Select the button.
        Create project button for Google Calendar on Google Workspace.
      2. On the Select a Project window, select NEW PROJECT.
      3. In the Project name field, enter a unique name for the project.
      4. In the Location field, select BROWSE to select an organization.
      5. Select CREATE.
        The Notifications window confirms that the project is created.

        Project creation confirmation.

      6. Select SELECT PROJECT.
    3. Enable the Google Calendar API permissions.
      1. Select + ENABLE APIS AND SERVICES.
        Enable API and Services button.
      2. On the Welcome to the API Library page, navigate to the Google calendar API card under the Google Workspace heading.
        Google Calendar API button.
      3. Select Google Calendar API.
      4. Select ENABLE.
        The Google calendar API is enabled on your project.

        Google Calendar API is enabled.

    4. Create the credentials that the connection and credential form will store.
      1. Select CREATE CREDENTIALS.
        Create credentials button to access Google Calendar API.
      2. Fill the form.
        Table 1. Google Calendar API credentials
        Select an API Name of the API that your ServiceNow instance accesses.
        Note:
        Ensure that the Google Calendar API option is chosen.
        What data will you be accessing? * Type of data that your ServiceNow instance accesses from the Google Calendar application.
        Tip:
        To create an OAuth application, select User data.
      3. Select NEXT.
      4. In the OAuth Consent Screen section, fill the form.
        Table 2. OAuth Consent Screen form
        Field Description Mandatory?
        App name Custom name of the OAuth app. Yes
        User support email Users of the OAuth app can send their queries on consent to this email. Yes
        App logo Logo of the OAuth app, No
        Developer contact information Google uses this email ID to inform you about any changes to the project. Yes
      5. Select SAVE AND CONTINUE.
    5. Optional: Specify the permissions to access specific Google Calendar API.
      1. Under the SCOPES heading, select ADD OR REMOVE SCOPES.
      2. In the Update selected scopes window, enter Google Calendar in the Enter property name or value field.Enter Google Calendar in the field.
      3. From the list, select Google Calendar API.
      4. Select the required APIs from the list.Select required Google Calendar APIs.
      5. Select UPDATE.
    6. Generate the OAuth Client ID and related details.
      You must enter the OAuth Client ID and related details in the connection and credential form.
      1. In the Application type field, select Web application.
      2. In the Name field, enter a custom name for the application.
      3. To add a redirect URL, under the Authorised redirect URIs heading, select + ADD URI.
      4. Enter the URL of your ServiceNow instance.
      5. Select CREATE.
        The credentials for the OAuth application are created, as shown in the image.Copy or download the OAuth credentials.
    7. Select DONE.

    Create Connection and Credential record for the Google Calendar spoke

    Create a connection and credential record that enables your ServiceNow instance to integrate with the Google Calendar Application Programming Interface (API).

    Before you begin

    Role required: admin.

    About this task

    The connection and credential record includes the details that you had set up when you created the OAuth app. See Create OAuth application on Google Calendar.

    Procedure

    1. Navigate to All > Process Automation > Flow Designer.
    2. Select Connections.
    3. In the Search all connections field, enter Google Calendar.Search the Google Calendar connection card.
    4. On the Google_Calendar card, click View Details.
    5. Click Configure.Google Calendar connection and credential record configure button.
    6. Fill the details in the form.
      Table 3. Google Calendar connection and credentials form
      Field Description
      Connection Name Name of the connection with the Google Calendar API.
      Note:
      The first and default connection name is Google_Calendar which is read-only. To provide a custom name to the connection, create a connection by selecting Add Connection.
      Connection URL The URL to the Google Calendar APIs.

      Enter https://googleapis.com.

      API Version Version of the Google Calendar APIs that your ServiceNow instance accesses.

      Enter V3.

      OAuth Client ID The ID of the client that accesses the OAuth app you had created.
      Tip:
      You can find the OAuth Client ID in the JSON file you had downloaded while creating the OAuth app. See Create OAuth application on Google Calendar.
      OAuth Client Secret The secret that your ServiceNow instance uses to prove its identity to the OAuth app.
      Tip:
      You can find the OAuth Client secret in the JSON file you had downloaded while creating the OAuth app. See Create OAuth application on Google Calendar.
      OAuth Redirect URL The redirect URL to the application after the OAuth app authenticates the request from your ServiceNow instance.
      Tip:
      You can find the OAuth Redirect URL in the JSON file you had downloaded while creating the OAuth app. See Create OAuth application on Google Calendar.
      OAuth Authorization URL The URL provided by the OAuth service provider that your ServiceNow instance can use to initiate the OAuth authorization process.
      Tip:
      You can find the OAuth Authorization URL in the JSON file you had downloaded while creating the OAuth app.
      OAuth Token URL The URL provided by an OAuth service provider that your ServiceNow instance can use to exchange an authorization code for an access token.
      Tip:
      You can find the OAuth Authorization URL in the JSON file you had downloaded while creating the OAuth app.
    7. Select Configure and Get OAuth Token.
    8. Log in to Google Workspace and get the OAuth Token.
      The connection and credential record is created.