构建交互式 Google Chat 应用
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
本页面简要介绍了可用于构建互动式 Google Chat 应用的框架。
借助互动式 Chat 应用,用户可以执行以下任何操作:
- 将 Chat 应用添加到 Chat 聊天室或私信。
- 向聊天应用发送消息或接收来自聊天应用的消息。
- 使用命令提示聊天应用。
- 预览来自外部服务或系统的链接。
- 向 Chat 应用提交信息,例如在对话框或卡片消息中输入文字。
用户如何发现和使用互动式 Chat 应用
用户可以通过多种方式发现和使用发布到 Marketplace 的聊天应用,包括:
- 在 Google Chat 或 Marketplace 中搜索并安装 Chat 应用。
- 与已添加到 Chat 聊天室的 Chat 应用互动。
- 在 Google Workspace 管理员代表用户安装 Chat 应用后,用户可以在私信面板中发现该 Chat 应用。
如需开始使用 Chat 应用,Google Chat 用户可以向 Chat 应用发送私信,也可以将其添加到聊天室中。用户还可以通过 @提及 Chat 应用来添加该应用。如需了解详情,请参阅使用 Chat 应用。
以下示例展示了用户如何 @提及 Chat 应用以将其添加到聊天室:

为互动式 Chat 应用选择框架
如需构建可与用户互动的 Chat 应用,您可以选择以下框架:
- Google Workspace 加购项:可让您扩展其他 Google Workspace 应用,并在 Google Workspace Marketplace 中将您的 Chat 应用与其他类型的应用一起列出。
如需了解详情,请参阅 Google Workspace 插件文档中的扩展 Google Chat。
- Chat API 互动事件:可让您构建其他功能,例如 Chat 应用首页,并使用其他架构,例如 Pub/Sub 和 Dialogflow CX。如需了解详情,请参阅接收和响应互动事件。
对于每个框架,下表显示了有关如何针对每种 Google Chat 应用架构配置和创建基本互动式 Chat 应用的文档:
配置 |
加购 |
聊天 API 互动事件 |
配置 Chat API |
文档 |
文档 |
快速入门 |
|
Apps 脚本 |
文档 |
文档 |
HTTP 服务 |
文档 |
文档 |
Dialogflow CX |
不适用于加购项。 |
文档 |
Pub/Sub |
不适用于加购项。 |
文档 |
构建互动功能
下表针对每个框架显示了用于构建互动功能的文档:
功能 |
加购 |
聊天 API 互动事件 |
发送消息 |
文档 |
|
响应命令 |
文档 |
文档 |
构建互动式对话框 |
文档 |
文档 |
收集和处理信息 |
文档 |
文档 |
预览 Chat 消息中的链接 |
文档 |
文档 |
为 Chat 应用构建首页 |
不适用于加购项。 |
文档 |
连接到外部系统和工具 |
文档 |
文档 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-08。
[null,null,["最后更新时间 (UTC):2025-08-08。"],[],[],null,["# Build an interactive Google Chat app\n\nThis page provides an overview of the frameworks that you can use to build an\ninteractive Google Chat app. \n\nInteractive Chat apps let users do any of the following:\n\n- Add Chat apps to Chat spaces or direct messages.\n- Send messages to or receive messages from Chat apps.\n- Prompt Chat apps with a command.\n- Preview links from an external service or system.\n- Submit information to Chat apps, such as entering text into a dialog or card message.\n\nHow users discover and use interactive Chat apps\n------------------------------------------------\n\nUsers can discover and use Chat apps published to the\nMarketplace in many ways, including the following:\n\n- Search and install Chat apps from Google Chat or the Marketplace.\n- Interact with a Chat app that's been added to a Chat space.\n- Discover the Chat app in their direct messages panel after a Google Workspace administrator installed the Chat app on their behalf.\n\nTo start using a Chat app, Google Chat users can\nstart a direct message with the Chat app or add it to a\nspace. Users can also add the Chat app by @mentioning\nit. For more information, see\n[Use Chat apps](https://support.google.com/chat/answer/7655820).\n\nThe following example shows how a user @mentions a\nChat app to add it to a space:\n\nChoose a framework for your interactive Chat app\n------------------------------------------------\n\nTo build a Chat app that interacts with users, you\ncan choose between the following frameworks:\n\n- **Google Workspace add-on** : Lets you extend other Google Workspace applications and list your Chat app with other types of apps on the Google Workspace Marketplace. To learn more, see [Extend Google Chat](/workspace/add-ons/chat) in the Google Workspace add-on documentation.\n- **Chat API interaction event** : Lets you build additional features such as a [Chat app homepage](/workspace/chat/send-app-home-card-message) and use other architectures such as Pub/Sub and Dialogflow CX. To learn more, see [Receive and respond to interaction events](/workspace/chat/receive-respond-interactions).\n\n### Configure an interactive Chat app\n\nFor each framework, the following table shows the documentation for configuring\nand creating a basic interactive Chat app for each\n[Google Chat app architecture](/workspace/chat/structure):\n\n| Configuration | Add-on | Chat API interaction events |\n|------------------------|-----------------------------------------------------------------|-----------------------------------------------------------------------------|---|\n| Configure the Chat API | [Documentation](/workspace/add-ons/chat/configure) | [Documentation](/workspace/chat/configure-chat-api) |\n| **Quickstarts** | |||\n| Apps Script | [Documentation](/workspace/add-ons/chat/quickstart-apps-script) | [Documentation](/workspace/chat/quickstart/apps-script-app) |\n| HTTP service | [Documentation](/workspace/add-ons/chat/quickstart-http) | [Documentation](/workspace/chat/quickstart/gcf-app) |\n| Dialogflow CX | Unavailable for add-ons. | [Documentation](/workspace/chat/build-dialogflow-chat-app-natural-language) |\n| Pub/Sub | Unavailable for add-ons. | [Documentation](/workspace/chat/quickstart/pub-sub) |\n\n### Build interactive features\n\nFor each framework, the following table shows the documentation for\nbuilding interactive features:\n\n| Feature | Add-on | Chat API interaction events |\n|---------------------------------------|------------------------------------------------------------------------|-------------------------------------------------------------|\n| Send messages | [Documentation](/workspace/add-ons/chat/send-messages) | |\n| Respond to commands | [Documentation](/workspace/add-ons/chat/commands) | [Documentation](/workspace/chat/commands) |\n| Build interactive dialogs | [Documentation](/workspace/add-ons/chat/dialogs) | [Documentation](/workspace/chat/dialogs) |\n| Collect and process information | [Documentation](/workspace/add-ons/chat/collect-information) | [Documentation](/workspace/chat/read-form-data) |\n| Preview links in Chat messages | [Documentation](/workspace/add-ons/chat/preview-links) | [Documentation](/workspace/chat/preview-links) |\n| Build a homepage for your Chat app | Unavailable for add-ons. | [Documentation](/workspace/chat/send-app-home-card-message) |\n| Connect to external systems and tools | [Documentation](/workspace/add-ons/guides/connect-third-party-service) | [Documentation](/workspace/chat/connect-web-services-tools) |\n\nRelated topics\n--------------\n\n- [Build a Google Chat app as a Google Workspace add-on](/workspace/add-ons/chat)\n- [Receive and respond to interaction events](/workspace/chat/receive-respond-interactions)\n- [Choose a Google Chat app architecture](/workspace/chat/structure)"]]