建構互動式 Google Chat 應用程式
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
本頁面提供可用於建構互動式 Google Chat 應用程式的架構總覽。
使用者可以透過互動式 Chat 應用程式執行下列操作:
- 在 Chat 聊天室或私人訊息中新增 Chat 應用程式。
- 傳送訊息給 Chat 應用程式,或接收 Chat 應用程式傳送的訊息。
- 使用指令提示 Chat 應用程式。
- 預覽外部服務或系統的連結。
- 將資訊提交至 Chat 應用程式,例如在對話方塊或資訊卡訊息中輸入文字。
使用者如何探索及使用互動式 Chat 應用程式
使用者可以透過多種方式探索及使用發布至 Marketplace 的 Chat 應用程式,包括:
- 在 Google Chat 或 Marketplace 中搜尋及安裝 Chat 擴充應用程式。
- 與已新增至 Chat 聊天室的 Chat 擴充應用程式互動。
- Google Workspace 管理員代表使用者安裝 Chat 應用程式後,使用者就能在即時訊息面板中找到該應用程式。
如要開始使用 Chat 應用程式,Google Chat 使用者可以傳送即時訊息給 Chat 應用程式,或將其新增至聊天室。使用者也可以 @提及 Chat 應用程式來新增。詳情請參閱「使用 Chat 擴充應用程式」。
以下範例說明使用者如何 @提及 Google 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 應用程式:
建構互動功能
下表列出各架構的互動式功能建構文件:
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-08 (世界標準時間)。
[null,null,["上次更新時間: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)"]]