Configure the Google Chat API

Each Google Chat app that you create requires its own Google Cloud project with the Chat API enabled and configured. This page shows you how to configure the Chat API.

Prerequisites

Choose a display name, avatar, and description for your Chat app

To call the Chat API, you must set up a Google Chat app with the following information:

Field Description Format
App name The display name for the Chat app. Up to 25 alphanumeric characters
Avatar URL The image that displays as your Chat app's avatar. An HTTPS URL pointing to a square graphics image (PNG or JPEG). Recommended size is 256 by 256 pixels or more.
Description A brief description that the purpose of the Chat app. Up to 40 alphanumeric characters

The Chat app's name, avatar, and description are displayed to users in the Chat UI. For some Chat API write requests, Chat uses this information to attribute the actions that a Chat app takes in Chat.

For example, if you call the spaces.create() method, Chat includes the name of the Chat app in the description of who created the space, as shown in the following image:

Google Chat app creates a space for a user.
Figure 1. The attribution message that Chat displays when the spaces.create() method is used to create a space on behalf of a user.

To interact with Chat apps, users can also see or use this information in the following ways:

  • Invoke the Chat app by @mentioning its name.
  • Find and start a direct message with the Chat app. In the Apps menu, direct messages display the Chat app's name and avatar.
  • From the compose bar, users can browse Chat apps and see their name, avatar, and description.

Configure your Chat app in the Google Cloud console

When you have your Chat app details, open your Cloud project and configure the Chat API:

  1. In the Google Cloud console, go to the Chat API page and click the Configuration page:

    Go to Chat API Configuration page

  2. Under Application info, fill out the App name, Avatar URL, and Description fields.

  3. Under Interactive features, click the Enable interactive features toggle to the off position to disable interactive features for the Chat app. You can set this up later. To learn about configuring and building interactive features, see Receive and respond to user interactions.

  4. Optional: Under Logs, select the Log errors to Logging checkbox to use Google Cloud Logging. For more information, see Query error logs for Chat apps.

  5. Click Save.

Grant other people permission to configure a Chat app

You can grant specific users access to the Chat app configuration page. Use the Chat apps Owner and Chat apps Viewer IAM roles. Users with these roles can't navigate to the Chat apps configuration page by using the APIs & Services dashboard, but can access the configuration page by navigating to the Google Cloud console for the Chat app's host Cloud project as follows:

https://console.developers.google.com/apis/api/chat.googleapis.com/hangouts-chat?project=PROJECT_ID

Where PROJECT_ID is the project ID of the Google Cloud project hosting the Chat app.