The Google Chat API includes a REST resource and Chat events.
REST resources grant access to Chat messages, spaces, and attachments.
Common uses of Chat REST resources include the following tasks:
- Create, delete, and update messages.
- List people and Chat bots conversing in a space.
- List all the spaces your Chat bot has been added to.
Chat events let Chat bots receive and respond to events sent by Chat API, such as getting added to a space or messaged by a user. Chat bots receive a JSON-formatted payload of information about the event, such as what space the bot was added to, which the Chat bot uses to process and send a JSON-formatted response, such as a welcome message.
Here is a list of common terms used in the Google Chat API:
- A Chat message including the sender, space, text, attachments, and cards. A message is represented by a message resource.
- A UI element that can contain both interactive and static widgets such as text, images, and buttons. A card is represented by a card resource.
- A conversation between two or more users, or 1:1 messages between a user and a Chat bot. A space is represented by a space resource.
- An event represents actions that Chat bots can respond to, such as receiving messages, card clicks, and being added or removed from a space. Events are represented by the event type.
- A user's inclusion in a space, including whether or not they have joined or have a pending invitation. Membership is represented by a membership resource.
To get started with Google Chat API:
To learn about developing with Google Workspace APIs, including handling authentication and authorization, refer to Get started as a Workspace developer.
To learn how to start working with Chat REST resource, read Use the REST API.
To learn how to start working with the Chat events, read Receive and respond to Google Chat events.
To learn how to configure and run a simple Chat bot, read Build a Google Chat bot with Google Cloud Functions.