Once you’ve created a chatbot, you can publish it so that it’s available to selected people or groups, or to everyone in your domain. This lets users start a direct message with the bot or add it to a room, by choosing it from the proposed recipient list as shown below.
Users can also narrow the proposed recipient list by @mentioning the bot by name. For example, if you publish a bot called “schedulerbot” and a user in your domain types “@sch”, then Google Chat will propose your bot as one of the autocomplete options.
Enabling the Google Chat API (formerly Hangouts Chat API)
You need to set up a project for your bot in the Google API Console with the Google Chat API enabled:
- Use the button below to create a new project (or select an existing one) and
add a service account to it. Give the service account the Project Owner
Enable the API
- Save the downloaded JSON key. Your bot can use this key to authenticate messages that it sends to spaces asynchronously.
- Open your project in the API Console. In the list of APIs, click Hangouts Chat API.
- Select the Configuration tab and enter the information for the bot, as described below.
After you save this bot definition in the API Console, your bot will become available to the specified users in your domain.
Configuring the bot
When you choose the configuration tab of the Google Chat API, you will see a screen like the one shown below.
At the top of this form, there is a Bot Status field that appears only after you've configured your bot. This field lets you control whether the bot is Live or Disabled.
The rest of the page lets you configure your bot by specifying the following information:
|Bot name||The name that users will use when interacting with your bot.|
|Avatar URL||An HTTPS URL pointing to a square graphics image (e.g. PNG or JPEG), at least 128x128, that will appear as the avatar for your bot.|
|Description||A description of the bot's functionality which appears below your bot's name.|
|Functionality||A set of fields that determine what events can trigger the bot:
|Connection settings||The endpoint for the bot, which is one of the following:
|Permissions||The developer-specified permissions for the bot. You can give install permissions to all members of your domain, or just to selected individuals or groups. NOTE: If your administrator requires bots to be whitelisted, these permissions will not take effect until you list your bot on G Suite Marketplace and have it whitelisted by your administrator.|
Granting bot configuration permissions
You can grant specific users access to the bot configuration page. To do this, use the Chat Bots Owner and Chat Bots Viewer IAM roles. Users with these roles can't navigate to the bot configuration page via the APIs & Services dashboard, but can access the configuration page by navigating to the console for their project as follows: