Receive and respond to Google Chat events

Stay organized with collections Save and categorize content based on your preferences.

When users interact with Google Chat apps, the app synchronously receives and can respond to an event. Examples of event types include messages, @mentions, card clicks, and getting added to or removed from a space.

Chat apps can respond to these events with either a text message or card message, each of which is represented as a JSON object. This guide explains how to implement interactive features in card messages

Text messages

Text messages are perfect for simple notifications. They support @mentions and basic formatting like bold, italics, and code.

For example, an app might use a text message to notify software developers that code freeze is approaching:

Example text message in Google Chat that announces code freeze
Figure 1: A text message alerts a Chat space about a code freeze.

To learn more, see Send a text message.

Card messages

Card messages support a defined layout, interactive UI elements like buttons, and rich media like images. Use card messages to present detailed information, gather information from users, and guide users to take a next step. Card messages can appear in a conversation stream as a message on its own or appended to a text message, or as dialog windows that open over a conversation.

For example, an app might use a card message to run a poll:

Running a poll in a Chat space with a card message
Figure 2: A card message lets people in a Chat space vote in a poll.

To help users complete multi-step processes, like filling in form data, cards can be strung together sequentially in a dialog. Dialogs open in windows that let apps interact with a user directly.

For example, an app might start a dialog to gather contact details:

A dialog featuring a variety of different widgets.
Figure 3: An open dialog prompting a user to add a contact.

To learn more, see Send a card message.