Skip to main content
Google Chat

Learn how to create a Torq bot for Google Chat, enabling real-time updates and seamless automation within your chat environment.

Updated over 3 months ago

Integrating Google Chat with Torq enhances your team's communication and automation capabilities, enabling seamless interaction and real-time updates within your chat environment.

Creating a Google Chat Integration

Follow the instructions to create a Google Cloud Platform (GCP) integration, with some adjustments in the following sections:

Enable GCP Domain-Wide Delegation

The recommended process is to follow the Google Cloud Platform (GCP) guide, which includes enabling GCP domain-wide delegation. However, if you prefer not to enable this, you can skip the Enable GCP Domain-Wide Delegation and Authorize the Service Account sections. Instead, create a Google Chat OAuth integration, allowing you to authenticate with Google Chat as yourself, limiting actions to your user account without acting on behalf of others.

  • The steps Send Message, Ask a Question, and Send Interactive Form can be authenticated with the Google Chat integration without enabling GCP domain-wide delegation.

  • If you prefer not to enable domain-wide delegation, you'll need to create a Google Chat OAuth integration for all other Google Chat steps.

  • The Google Chat OAuth steps specifically require the OAuth integration.

Authorize the Service Account

In step 6 provide these additional scopes:

https://www.googleapis.com/auth/chat.bot
https://www.googleapis.com/auth/chat.memberships.app
https://www.googleapis.com/auth/chat.spaces

Enable APIs

  1. In the API Library select the Google Chat API and click MANAGE.

  2. Go to CONFIGURATION and set the HTTP endpoint URL to:

https://interactivity.torq.io/google-chat/v1/interactivity-hooks

If you are in the EU, set the HTTP endpoint URL to:

https://interactivity.eu.torq.io/google-chat/v1/interactivity-hooks

3. Set the Authentication Audience to Project Number.

4. In APIs & Services > Enabled APIs & services, enable the API named IAM Service

Account Credentials API.

5. In IAM & Admin > IAM, locate your principal (service account) in the list.

6. Click GRANT ACCESS, fill in the principal, and add the role of Service Account

Token Creator.

Create a Google Chat Integration in Torq

  1. Go to Integrations > Steps > Google Chat, and click Add.

  2. Provide the credentials file you saved in step 3.5

  3. Enter the GCP project number.

  4. Give the integration a unique and meaningful name.

Project number gcp

Google Chat OAuth Integration

Follow these steps to get the client ID and secret from Google Workspace:

  1. Log in to your Google Workspace project: console.cloud.google.com.

  2. Go to APIs & Services > +ENABLE APIS AND SERVICES. Select the cards of the APIs you want to use in Torq and make sure they are enabled.

    Use the integration token in workflow steps
  3. Go to Credentials > +CREATE CREDENTIALS and select OAuth client ID.

    Enable APIs and services in Google Workspace
  4. Provide the following information and click CREATE.

    1. Application type: Web application.

    2. Name: provide a meaningful name.

    3. Authorized Javascript origins: https://app.torq.io or EU: https://app.eu.torq.io

    4. Authorized redirect URIs: Copy the value of the Callback URL field in the integration creation form in Torq: https://redir.torq.io/integrations/google_chat_token_oauth

      Copy the Callback URL from the integration creation form
  5. Copy the Client ID and Client Secret and save them for the next step.

Create a Google Chat OAuth Integration in Torq

Perform these steps in Torq.

  1. Go to Build > Integrations > Steps > Google Chat OAuth, and click Add.

  2. Enter a meaningful name for the integration.

  3. Enter the client ID and secret you copied previously.

  4. Review the default suggested scopes and add any others as needed.

  5. Click Add.

When updating an integration, attempting to create an integration after a failure, or creating a new integration with the same credentials, you may need to go to https://myaccount.google.com/u/0/permissions, select your app, and click REMOVE ACCESS.

Did this answer your question?