Creating a Webhook from Google Chat to Make

Hey everyone,

So basically what I am trying to do is to have a webhook from Make receive a trigger when a certain chat message is typed into a Google Chat / Space. Sadly I couldn’t find any documentation from Make itself, even though there is a Chat Listener module.

I do realize that this is probably a more complicated setup, but I don’t really have a clue where to start, even though I am somewhat experienced with scripting/webhooks.

Is there some sort of tutorial or documentation that I can look at? Or maybe someone has some keywords on topics that I should look at to figure this out, help is much appreciated.

Thanks in advance for any answers!

Hello @JohnNew,

Is this the module you’re referring to?
image

If so there’s a link to the help page that describes what you need to do to set it up.
See the “Online Help” linked text.

It links to this page: https://www.make.com/en/help/app/google-chat

Hi @Donald_Mitchell,
thank you for your answer, but this documentation seems outdated. It refers to a verification method with e-mail and client key and does not explain how to actually get data from google chat into make.

First you create a connection.
Once the connection is established, you can execute the module using Run Once.
When the module executes, it will get data from Google Chat.
In order to use that data, you’d need to connect another module, etc…

1 Like

Hey Donald, I really appreciate you trying to help here, but this is not helpful at all. I know how Make works, I have worked with it for more than two years now. My problem lies in your first sentence. Thanks for telling me I need to create a connection, my question was how I do that. I’ll need to do some backend stuff in the Google Cloud console and I don’t know how to do that, hence me asking if there are some ressources available.

Sorry, maybe we’re just not on the same page I guess.

You haven’t confirmed if that Google Chat - Chat Listener module was the one you were trying to use. I assume so since its description matches what you described in your first post.

The document you say is outdated is what you need to follow.
You need to go to Google Cloud API Console, create a project, then a service account, then create a private key for that service account.
The email address and private key need to get entered into fields when creating the connection in Make.
Are you saying you followed that doc and got stuck somewhere?

Follow this main guide on how to set up a custom OAuth 2.0 custom app in Make.

Provided below are additional supplementary instructions in case the above isn’t clear enough.


Enable APIs

1. Enable the relevant APIs that you want to use

Search for the relevant Google API here: https://console.cloud.google.com/apis/library

  • Go to each API page that you want to use, end click “Enable”

  • Usually you’ll want to enable at least Drive (includes Docs/Sheets) and Gmail.


OAuth Client

Direct Link: https://console.cloud.google.com/apis/credentials

2a. Create “OAuth client ID” Credentials

2b. Insert all the Google Redirect URIs for your app

Google Redirect URIs

Here are some commonly-needed redirect URIs you need for your Google Cloud Console OAuth app. If you set these up, you can reuse the same GCP app for other Google apps and modules on Make.

https://www.make.com/oauth/cb/google
https://www.make.com/oauth/cb/google-custom
https://www.make.com/oauth/cb/google-restricted
https://www.make.com/oauth/cb/google-cloud-speech
https://www.make.com/oauth/cb/youtube
https://www.make.com/oauth/cb/oauth2
https://www.integromat.com/oauth/cb/oauth2

Note: Once you’ve set these up, you can use/reuse the same Make connection for all the supported Google apps & modules on Make - you’ll only have to enable the APIs for your custom app.


OAuth consent screen

Direct Link: https://console.cloud.google.com/apis/credentials/consent/edit

3a. Insert Two Authorised Domains

  • Insert make.com and integromat.com

  • Fill in other required fields

  • Click “Save and Continue”.

3b. Add All Scopes

  • Click “Add or Remove Scopes”

  • Select 100 “Rows per page”, for each page, check all the rows, OR

  • Manually type in the scopes you need

  • Click “Update” at the bottom

3c. Step through and go to dashboard

At the last step/page, click “BACK TO DASHBOARD” instead of “Prepare for Verification”

3d. Publish your GCP OAuth2 app

You will need to set your OAuth application to “Production”, otherwise the credentials expire very frequently.

  • To do this, go back to “OAuth consent screen

  • Then click the “PUBLISH APP” button

  • Then click the “CONFIRM” button


Create New Connection (HTTP, or respective Google module)

You can find the Client ID and Client Secret in the OAuth2 app you created in GCP, on the right-hand side of where you inserted the callback URLs in step 2:

4a. Specific Google module (Sheets, Docs, Drive, Gmail, etc.)

Insert the GCP app client ID and secret here BEFORE clicking “Sign in”

(Gmail example)

OR,

4b. HTTP OAuth 2.0 Request module

You need a “Authorize Parameters” key of redirect_uri with the above Make OAuth2 callback URL.

Hope this helps! Let me know if there are any further questions or issues.

@samliew

P.S.: Investing some effort into the Make Academy will save you lots of time and frustration using Make.

Hi Sam,
Thanks for your answer, but again, this is not what I am looking for. I already did this to send automated messages in chat. My question is specifically on this module:

I need a verification token from google and when I enter that, I get a webhook that receives Post Requests from somewhere in Google, I presume. My question is where to get the verification token and where I can put in the webhook to start listening to messages.

Hey @JohnNew,

I don’t think you’d want to use this particular module, it seems as though some helper modules may be missing - disabled or not even created by whoever created this app. It’s odd that there are two different Google Chat apps that have different modules but both lead to the same help page. Now it makes sense when you say the help page seems outdated, as it references the other module.

Instead, you can create a new subscription to Google Chat Message Events.
Each message (or batch of messages) gets sent to the webhook address you specify and you can just use a Custom Webhook Trigger for this instead of Google Chat modules.
The data comes in base64 encoded and unfortunately, doesn’t appear Make has a base64 decode module or function yet. You’d have to create your own.

Here’s the Google reference: Create a Google Workspace subscription  |  Google for Developers

There are a lot of requirements, including responding/acknowledging the message so that it doesn’t try to re-send it.

Here’s a list of chat/space events you can subscribe to:

This reference explains the parts of the payload, including the bit about the data being the message data base64 encoded:
https://cloud.google.com/pubsub/docs/push

Here’s what the payload looks like:

I take this back, there is a way to decode base64 by combining toString and toBinary.
image

See https://www.make.com/en/help/functions/string-functions#base64--text-

1 Like