在「可見度」下方,確認適當使用者可透過電子郵件地址或 Google Workspace 網域中的群組存取應用程式。如果應用程式是透過 Google Workspace Marketplace SDK 部署,則不需要設定瀏覽權限,因為 Google Workspace Marketplace 設定的優先順序較高。
設定 Chat 應用程式時,您可能會收到 Google Chat API is only available to Google Workspace users 錯誤。這則訊息表示您用來設定 Chat API 的 Google 帳戶不屬於 Google Workspace 機構。如要建構 Chat 應用程式或使用 Chat API,請務必使用 Google Workspace 帳戶。
請注意,Google Chat 使用者不需 Google Workspace 帳戶,也能使用 Chat 應用程式。如要進一步瞭解使用者如何探索及安裝 Chat 應用程式,請參閱「建構互動式 Google Chat 應用程式」。
使用者可能無法加入聊天室或被移出聊天室
如果 Google Workspace 管理員禁止使用者開啟或關閉 Google Chat 記錄,有時使用者可能會因為使用者層級的設定與聊天室的設定衝突,而無法加入或留在聊天室中。這是因為使用者層級的設定會強制開啟或關閉 Google Chat 記錄,而聊天室會沿用機構層級的強制設定。
<HttpError 403 when requesting https://chat.googleapis.com/v1/spaces/{space}?alt=json returned "The administrator must grant the app the required OAuth authorization scope for this action.". Details: "The administrator must grant the app the required OAuth authorization scope for this action.">
這則錯誤訊息表示 Google Workspace 管理員尚未一次性核准 Chat 應用程式,使用以 https://www.googleapis.com/auth/chat.app.* 開頭的授權範圍。
如要解決這項錯誤,請按照下列步驟操作:
請 Google Workspace 管理員核准您的 Chat 應用程式。
在 Chat 應用程式邏輯中處理這項錯誤時,請考慮傳送訊息,宣布 Chat 應用程式需要管理員核准才能執行要求動作,例如:To perform this action, I need approval.
<https://support.google.com/a?p=chat-app-auth|Learn more>.
部署 Cloud 函式時,您可能會收到 Function
ChatApp in region REGION_NAME in project PROJECT_NAME already
exists 錯誤。這則訊息表示另一個 Cloud Functions 的名稱與您要部署的函式相同。變更名稱,然後重新部署函式。確認 Chat 應用程式使用的是 Cloud Function 的觸發網址,而非現有 Cloud Function 的觸發網址。
政策中提及的一或多位使用者不屬於獲准的客戶
部署 Cloud Function 時,您可能會收到 The operation
cannot be completed on the function: "One or more users named in the policy do
not belong to a permitted customer." 錯誤。如果發生這個錯誤,然後傳送訊息給 Chat 應用程式,系統會顯示錯誤訊息,指出應用程式沒有回應,因為 Google Chat 無法連上代管 Cloud Function 的伺服器。這則訊息表示名為「allUsers」的使用者沒有權限呼叫 Cloud Function。將「Cloud Functions 叫用者」角色授予「allUsers」,表示應用程式使用的 Cloud Function 可供大眾存取,且無需驗證。如要瞭解如何指派角色,請參閱授予單一角色。
這個錯誤可能表示 Google Cloud 專案受到網域限制。如要進一步瞭解網域限制條件,請參閱「依照網域設定身分限制」。
如要解決這個問題,請確認 Cloud Function 允許未經驗證的呼叫。如要瞭解如何允許未經驗證的現有 Cloud 函式叫用,請參閱「允許公開 (未經驗證) 存取」。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-08-04 (世界標準時間)。"],[[["\u003cp\u003eThis guide addresses common problems encountered while building and testing Google Chat apps, such as cards not rendering, apps not responding, and user access issues.\u003c/p\u003e\n"],["\u003cp\u003eTroubleshooting steps include verifying the Chat app's configuration in the Google Cloud console, ensuring the app is live and interactive features are enabled.\u003c/p\u003e\n"],["\u003cp\u003eUsers encountering access issues should check if the Chat app is allowed by their organization's administrator and has the necessary OAuth authorization scopes.\u003c/p\u003e\n"],["\u003cp\u003eFor Cloud Function-based apps, detailed guidance on checking logs, identifying errors, and fixing common Cloud Function errors like naming conflicts and permission issues is provided.\u003c/p\u003e\n"],["\u003cp\u003eUsers may be excluded from spaces due to conflicting Chat history settings between user-level and space-level configurations.\u003c/p\u003e\n"]]],["This document outlines common issues and troubleshooting steps for Chat apps. Key actions include: verifying app configurations in the Google Cloud Console, ensuring appropriate interactive features are enabled, and confirming correct connection settings. It highlights the necessity of a Google Workspace account for Chat API use and addresses user exclusion from spaces due to conflicting history settings. Other fixes include checking Cloud Function logs, resolving deployment errors, and ensuring proper user permissions for app access. Lastly, it also details on how to solve administrator OAuth errors.\n"],null,["This section describes common issues that you can encounter while building and testing Chat apps.\n\nA card message, dialog, or link preview doesn't render or work as expected\n\nFor help troubleshooting card errors, see [Troubleshoot and fix cards](/workspace/chat/troubleshoot-cards).\n\nApp is not responding\n\nIf you message the Chat app and it responds \"App is not responding,\"\nverify the Chat app's configuration:\n\n1. In the Google Cloud console, click **Menu**\n menu\n \\\u003e **More products**\n \\\u003e **Google Workspace**\n \\\u003e **Product Library**\n \\\u003e **Google Chat API**\n \\\u003e **Manage**\n \\\u003e **Configuration**.\n\n [Go to Chat API](https://console.cloud.google.com/apis/api/chat.googleapis.com/hangouts-chat)\n2. Under **App status** , make sure that you selected **Live - available to users**.\n\n3. Under **Interactive features** , make sure that settings are appropriate for your app's functionality. If your Chat app interacts with users, make sure you turn on **Enable interactive features**:\n\n 1. By default, apps can respond to direct messages from users.\n 2. If your app responds to messages in spaces and group chats, select **Join spaces and group conversations**.\n 3. Under **Connection settings** , make sure the **HTTP endpoint URL** , Apps Script project **Deployment ID** , Cloud Pub/Sub **Topic Name**, or Dialogflow agent is set correctly and that it is deployed.\n 4. Under **Visibility** , make sure the appropriate users have access to the app with email address or a group in the Google Workspace domain. If the app is deployed with [Google Workspace Marketplace SDK](/workspace/marketplace/overview), visibility settings aren't necessary because Google Workspace Marketplace settings take precedence.\n4. If the app is published with [Google Workspace Marketplace SDK](/workspace/marketplace/overview), review Google Workspace Marketplace settings.\n\n5. Click **Save**.\n\n6. Try messaging the app again.\n\nGoogle Chat API is only available to Google Workspace users\n\nWhen configuring the Chat app, you might receive the\nerror `Google Chat API is only available to Google Workspace users`. This message\nmeans that the Google Account that you've used to configure the\nChat API isn't part of a Google Workspace organization. To build a\nChat app or use the Chat API, you must use a\n[Google Workspace\naccount](https://workspace.google.com/features/).\n\nNote that Google Chat users can use Chat apps without a\nGoogle Workspace account. To learn more about how users discover and install\nChat apps, see\n[Build interactive Google Chat apps](/workspace/chat/interact-users-overview).\n\nUsers can be excluded from spaces\n\nIf a Google Workspace administrator [disallows users to turn Chat history on or off](https://support.google.com/a/answer/7664184), then there might be times when users can't join or stay in a space due to a conflict between a user-level setting that forces chat history on or off and a space that inherits the organization-level forced setting.\n\nFor example, if a user has a Chat history setting forced \"on\" and a space has a Chat history setting forced \"off\", then that user might not be able to join the space. Additionally, that user might be removed from the space if they joined prior to the conflict and then they post a message in the space after the conflict.\n\nIn this scenario, and other scenarios where there are conflicts between history settings, Chat API might not be able to create a membership, or creating a message with user authentication might remove the authenticated user with a conflicting Chat history setting from the space.\n\nTo learn more, see [Users can be excluded from spaces](https://support.google.com/a/answer/9948515#zippy=%2Cmy-top-level-setting-is-chat-preferred) in the Google Workspace Admin Help center.\n\nTroubleshoot the Advanced Chat service in Google Apps Script\n\nSee the Apps Script page about the\n[Advanced Chat Service](/apps-script/advanced/chat#troubleshoot).\n\nUsers are unable to add a Chat app to a space\n\nIf users encounter the error message\n`This organization's administrator must allow users to install this Chat app`\nwhen trying to add a Chat app to a space, this error\nmight be caused by one of the following reasons:\n\n- The organization has disabled Chat apps.\n- The organization hasn't added this specific Chat app to the organization's allowlist.\n\nIf a user encounters this error message when trying to interact with a\nChat app, it might be caused by the organization\ngranting access to a sub-organizational unit, without enabling it for the\nparent organizational unit.\n\nFor information about how to resolve this issue, see\n[Allow users to install Chat apps](https://support.google.com/a/answer/7651360).\n\nThe administrator must grant the app the required OAuth authorization scope for this action\n\nWhen\n[authenticating as a Chat app](/workspace/chat/authenticate-authorize-chat-user),\nyou might receive the following error: \n\n \u003cHttpError 403 when requesting https://chat.googleapis.com/v1/spaces/{space}?alt=json returned \"The administrator must grant the app the required OAuth authorization scope for this action.\". Details: \"The administrator must grant the app the required OAuth authorization scope for this action.\"\u003e\n\nThis error message means that a Google Workspace administrator hasn't\nyet granted one-time approval to the Chat app to use\nauthorization scopes that begin with the name\n`https://www.googleapis.com/auth/chat.app.*`.\n\nTo resolve the error:\n\n- Ask the Google Workspace administrator to [grant approval to your Chat app](https://support.google.com/a?p=chat-app-auth). When handling this error in your Chat app logic, consider [sending a message](/workspace/chat/create-messages) announcing that the Chat app needs administrator approval to perform the requested action, perhaps: `To perform this action, I need approval.\n \u003chttps://support.google.com/a?p=chat-app-auth|Learn more\u003e.`\n- If the Chat API method supports the `https://www.googleapis.com/auth/chat.bot` authorization scope, which doesn't require administrator approval, consider using it instead. To check which authorization scopes a method supports, see the [Authenticate and authorize Google Chat apps and Google Chat API requests](/workspace/chat/authenticate-authorize#asynchronous-chat-calls).\n\nTroubleshoot Cloud Function errors\n\nIf the Chat app is implemented with Cloud Functions and\nit isn't working, the following sections help troubleshoot and fix the issue.\n\nCheck Cloud Function logs\n\nAs a first step, check the Cloud Functions logs for errors.\n\n1. In the Google Cloud console, go to the Cloud Functions page:\n\n [Go to Cloud Functions](https://console.cloud.google.com/functions)\n2. To open the logs, find your Chat app's Cloud\n Function, then click\n **Show actions** more_vert\n \\\u003e **View logs**.\n\nThe Logs Explorer opens and runs a query showing Cloud Function logs, including\nerrors.\n\nIf the default information logged is not enough to debug your app, you can add\nadditional logging from your Cloud Function code. See [View and write Cloud\nFunction logs](https://cloud.google.com/functions/docs/monitoring/logging).\n\nCheck Cloud Function errors\n\nApart from the logs, Cloud Function might also report errors encountered while\nrunning.\n\n1. In the Google Cloud console, go to the Cloud Functions page:\n\n [Go to Cloud Functions](https://console.cloud.google.com/functions)\n2. Click your Chat app's Cloud Function.\n\n3. On the Function details page, errors are listed under **Errors**.\n\n4. To further troubleshoot an error, click it.\n\nFix common Cloud Function errors\n\nThe following errors are sometimes encountered when building a\nChat app with Cloud Functions.\n\nFunction ChatApp in region \u003cvar translate=\"no\"\u003eREGION_NAME\u003c/var\u003e in project \u003cvar translate=\"no\"\u003ePROJECT_NAME\u003c/var\u003e already exists\n\nWhen deploying a Cloud Function, you might receive the error `Function\nChatApp in region `\u003cvar translate=\"no\"\u003eREGION_NAME\u003c/var\u003e` in project `\u003cvar translate=\"no\"\u003ePROJECT_NAME\u003c/var\u003e` already\nexists`. This message means that another Cloud Function has the same name as the\none you're deploying. Change the name, and\ndeploy the function again. Verify that the Chat app uses the Trigger URL for\nyour Cloud Function, not the Trigger URL of the preexisting Cloud Function.\n\nOne or more users named in the policy do not belong to a permitted customer\n\nWhen deploying a Cloud Function, you might receive the error `The operation\ncannot be completed on the function: \"One or more users named in the policy do\nnot belong to a permitted customer.\"` If you get this error and then message the\nChat app, you get an error saying that the app isn't responding because Google\nChat can't reach the server hosting the Cloud Function. This message means that\na user named \"allUsers\" doesn't have permission to call the Cloud Function.\nGiving \"allUsers\" the \"Cloud Functions Invoker\" role means that the Cloud\nFunction that powers the app is publicly available and accessible without\nauthentication. To learn how to assign a role, see\n[Grant a single role](https://cloud.google.com/iam/docs/granting-changing-revoking-access#grant-single-role).\n\nThis error might mean that the Google Cloud project is domain restricted. For\nmore information about domain restriction constraints, refer to\n[Restricting identities by domain](https://cloud.google.com/resource-manager/docs/organization-policy/restricting-domains#console_1).\n\nTo resolve this issue, verify that your Cloud Function allows unauthenticated\ninvocations. To learn how to allow unauthenticated invocations for an existing\nCloud Function, refer to\n[Allowing public (unauthenticated) access](https://cloud.google.com/run/docs/authenticating/public)."]]