Google Chat

Getting started with Google Hangouts Chat

Important

The modules integrate with Google Hangouts Chat, Google's messaging platform for teams (G Suite users). They DO NOT work with Google Hangouts, which is a messaging platform available to all Google users.

To use any of these modules, you need to have a G Suite account with administrator rights, or ask your account administrator to help set up the connection between Google Hangouts Chat and Make. If you do not have a G Suite account yet, you can create one at workspace.google.com. The Google Chat API needs to be enabled in the Admin Console, as follows. First, click on the Enable APIs and Services link.

61f26ea3e928e.png

In the Search bar, type Google Chat API and click on the result.

On the next screen, click the Enable button. Make can now be connected as a Google Chat bot.

61f26ea51f47e.png

For 3rd party service integration with Hangouts Chat, Google uses the concept of chat bots. A chat bot acts like a regular participant in chat rooms or direct messages, even though, behind the scenes, it is implemented as a remote web service or a Google Apps Script project. There are only two requirements for integrating your Make scenario with Hangouts Chat: first, you need to provide a URL to which Google will forward chat messages (and events such as "Added to Chat Room"), and second, the calculation of the response inside a scenario must take less that 30 seconds. For the first requirement, create a new Make scenario and insert Google Hangouts Chat > Chat Listener. Clicking on the module will let you create a new webhook (just give it a name and click Save), which will provide a dedicated URL that can be used to receive chat messages from Google.

61f26ea6080e8.png

Copy this URL by clicking the Copy address to clipboard button. Then, go to your G Suite Admin Console, select the Hangouts Chat API in the Enabled APIs and services section, and open its Configuration tab. Here you can give your Bot a name, choose if it will be available only in direct messages, chat rooms, or both, and finally, fill in its Bot URL from Make.

61f26ea75fb04.png

Now that Google knows where to send your messages, you can start building a response inside your Make scenario (just keep in mind that it needs to reach Google in less than 30 seconds). Sending a response is as simple as inserting a Chat Response module in the scenario's data flow. Below is an example scenario which uses filters to send a different response based on if the incoming message was a notification that your Bot was added to a chat room, or if it was an actual text message.

61f26ea87eabc.png

The conversation with the Bot (in this case, named "makedev") will look similar to the following:

61f26ea9d1020.png

Make can also send one-off messages (not expecting a response) to any Hangouts Chat chat room that has a webhook URL associated with it. To create a chat room webhook in Hangouts Chat, click on the arrow next to the number of chat room participants to display the dropdown menu, and then select Configure webhooks.

61f26eaac87e8.png

In the pop-up window, click on Add Webhook, then give the webhook a name, and click Save. Copy the generated URL.

61f26eabb3531.png

In Make, use the Inject Message Into Room module, which enables you to create a new connection, and use the chat room URL generated in the previous step as the destination.

61f26eac9d464.png

After running the scenario, the message should appear in the Hangouts Chat chat room.

61f26eae09361.png