Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Mỗi ứng dụng Google Chat mà bạn tạo đều cần có dự án Google Cloud riêng, trong đó Chat API được bật và định cấu hình. Trang này hướng dẫn cách định cấu hình Chat API.
Chọn tên hiển thị, hình đại diện và nội dung mô tả cho ứng dụng Chat
Khi bật Chat API, bạn sẽ định cấu hình thông tin chi tiết về ứng dụng Chat xuất hiện cho người dùng trong Chat, bao gồm cả tên hiển thị, hình đại diện và nội dung mô tả. Những thông tin này chỉ xuất hiện trong Chat. Để xuất bản ứng dụng Chat lên Marketplace, bạn cũng phải chỉ định thông tin chi tiết xuất hiện trong trang thông tin trên Marketplace của ứng dụng Chat.
Để gọi API Chat, bạn phải thiết lập một ứng dụng Google Chat có thông tin sau:
Trường
Mô tả
Định dạng
Tên ứng dụng
Tên hiển thị của ứng dụng Chat.
Tối đa 25 ký tự chữ và số
URL hình đại diện
Hình ảnh xuất hiện dưới dạng hình đại diện của ứng dụng Chat.
Một URL HTTPS trỏ đến hình ảnh đồ hoạ vuông (PNG hoặc JPEG).
Kích thước đề xuất là 256 x 256 pixel trở lên.
Mô tả
Nội dung mô tả ngắn gọn về mục đích của ứng dụng Chat.
Tối đa 40 ký tự bao gồm chữ và số
Tên, hình đại diện và nội dung mô tả của ứng dụng Chat sẽ xuất hiện với người dùng trong giao diện người dùng Chat. Đối với một số yêu cầu ghi API Chat, Chat sử dụng thông tin này để phân bổ các hành động mà một ứng dụng Chat thực hiện trong Chat.
Ví dụ: nếu bạn gọi phương thức spaces.create(), Chat sẽ thêm tên của ứng dụng Chat vào phần mô tả về người tạo không gian, như minh hoạ trong hình ảnh sau:
Hình 1. Thông báo ghi nhận quyền tác giả mà Chat hiển thị khi phương thức spaces.create() được dùng để tạo không gian thay cho người dùng.
Để tương tác với các ứng dụng Chat, người dùng cũng có thể xem hoặc sử dụng thông tin này theo những cách sau:
Gọi ứng dụng Chat bằng cách đề cập đến tên của ứng dụng.
Tìm và bắt đầu một tin nhắn trực tiếp bằng ứng dụng Chat. Trong trình đơn Ứng dụng, tin nhắn trực tiếp sẽ hiển thị tên và hình đại diện của ứng dụng Chat.
Trên thanh soạn tin, người dùng có thể duyệt xem các ứng dụng Chat và xem tên, hình đại diện cũng như nội dung mô tả của các ứng dụng đó.
Định cấu hình ứng dụng Chat trong Google Cloud Console
Khi bạn có thông tin chi tiết về ứng dụng Chat, hãy mở dự án trên Cloud và định cấu hình Chat API:
Trong Google Cloud Console, hãy chuyển đến trang Chat API rồi nhấp vào trang Configuration (Cấu hình):
Trong mục Thông tin ứng dụng, hãy điền thông tin vào các trường Tên ứng dụng, URL hình đại diện và Nội dung mô tả.
Trong phần Tính năng tương tác, hãy nhấp vào nút bật/tắt Bật tính năng tương tác để chuyển sang vị trí tắt nhằm vô hiệu hoá các tính năng tương tác cho ứng dụng Chat. Bạn có thể thiết lập tính năng này sau. Để tìm hiểu về cách định cấu hình và tạo các tính năng tương tác, hãy xem phần Nhận và phản hồi các hoạt động tương tác của người dùng.
Không bắt buộc: Trong mục Nhật ký, hãy chọn hộp đánh dấu Ghi lỗi vào Logging để sử dụng Google Cloud Logging. Để biết thêm thông tin, hãy xem phần Truy vấn nhật ký lỗi cho các ứng dụng Chat.
Nhấp vào Lưu.
Cấp cho người khác quyền định cấu hình Chat API
Bạn có thể cấp quyền truy cập cho một số người dùng cụ thể vào trang cấu hình ứng dụng Chat bằng cách cấp cho họ vai trò Chủ sở hữu ứng dụng Chat hoặc Người xem ứng dụng Chattrong dịch vụ Quản lý danh tính và quyền truy cập (IAM) trên Google Cloud.
Người dùng có các vai trò này không thể chuyển đến trang cấu hình ứng dụng Chat bằng cách sử dụng trang tổng quan API và dịch vụ, nhưng có thể truy cập vào trang cấu hình bằng cách chuyển đến bảng điều khiển Google Cloud cho dự án Cloud lưu trữ ứng dụng Chat như sau:
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-07-31 UTC."],[[["\u003cp\u003eEvery Google Chat app needs its own Google Cloud project with the Chat API enabled and configured, following specific prerequisites.\u003c/p\u003e\n"],["\u003cp\u003eChat apps require a display name, avatar URL, and description, which are visible to users and used by Chat for attributions.\u003c/p\u003e\n"],["\u003cp\u003eThe Chat API is configured in the Google Cloud console, where you can set the app's details, enable/disable interactive features, and optionally enable error logging.\u003c/p\u003e\n"],["\u003cp\u003eAccess to the Chat app configuration page can be granted to other users via specific Google Cloud IAM roles.\u003c/p\u003e\n"]]],["Each Google Chat app requires a dedicated Google Cloud project with the Chat API enabled. Configuration involves setting up the app's display name (up to 25 characters), avatar URL (square image, 256x256 pixels or more), and description (up to 40 characters). In the Google Cloud console, you must fill out these application details, and optionally, enable or disable interactive features and log errors. Additionally, you can grant specific users access to configure the Chat API by assigning them the \"Chat apps Owner\" or \"Chat apps Viewer\" IAM roles.\n"],null,["# Configure the Google Chat API\n\nEach Google Chat app that you create requires its own\nGoogle Cloud project with the Chat API enabled and configured. This page\nshows you how to configure the Chat API.\n\nPrerequisites\n-------------\n\n- A Business or Enterprise [Google Workspace](https://support.google.com/a/answer/6043576) account with access to [Google Chat](https://workspace.google.com/products/chat/).\n- [Create a Google Cloud project](/workspace/guides/create-project).\n- [Configure the OAuth consent screen](/workspace/guides/configure-oauth-consent).\n- [Enable the Google Chat API](/workspace/guides/enable-apis).\n\nChoose a display name, avatar, and description for your Chat app\n----------------------------------------------------------------\n\nWhen you enable the Chat API, you configure the details about your\nChat app that appear to users in Chat,\nincluding a display name, avatar, and description. These details only appear\nin Chat. To publish your Chat app to the\nMarketplace, you must also specify the details that\nappear in your Chat app's\n[Marketplace listing](/workspace/marketplace/create-listing).\n\nTo call the Chat API, you must set up a\nGoogle Chat app with the following information:\n\n| Field | Description | Format |\n|-------------|-----------------------------------------------------|----------------------------------------------------------------------------------------------------------------|\n| App name | The display name for the Chat app. | Up to 25 alphanumeric characters |\n| Avatar URL | The image that displays as your Chat app's avatar. | An HTTPS URL pointing to a square graphics image (PNG or JPEG). Recommended size is 256 by 256 pixels or more. |\n| Description | A brief description of the purpose of the Chat app. | Up to 40 alphanumeric characters |\n\nThe Chat app's name, avatar, and description are\ndisplayed to users in the Chat UI. For some Chat API\nwrite requests, Chat uses this information to attribute the\nactions that a Chat app takes in Chat.\n\nFor example, if you call the `spaces.create()` method, Chat\nincludes the name of the Chat app in the\ndescription of who created the space, as shown in the following image:\n**Figure 1** . The attribution message that Chat displays when the `spaces.create()` method is used to create a space on behalf of a user.\n\nTo interact with Chat apps, users can also see or use this\ninformation in the following ways:\n\n- Invoke the Chat app by @mentioning its name.\n- Find and start a direct message with the Chat app. In the **Apps** menu, direct messages display the Chat app's name and avatar.\n- From the compose bar, users can browse Chat apps and see their name, avatar, and description.\n\nConfigure your Chat app in the Google Cloud console\n---------------------------------------------------\n\nWhen you have your Chat app details, open your\nCloud project and configure the Chat API:\n\n1. In the Google Cloud console, go to the Chat API page and click the\n **Configuration** page:\n\n [Go to Chat API Configuration page](https://console.cloud.google.com/apis/api/chat.googleapis.com/hangouts-chat)\n2. Under **Application info** , fill out the **App name** , **Avatar URL** ,\n and **Description** fields.\n\n3. Under Interactive features, click the **Enable interactive features** toggle\n to the off position to disable interactive features for the\n Chat app. You can set this up later. To learn about\n configuring and building interactive features, see\n [Receive and respond to user interactions](/workspace/chat/receive-respond-interactions).\n\n4. Optional: Under **Logs** , select the **Log errors to Logging** checkbox to\n use Google Cloud Logging. For more information, see\n [Query error logs for Chat apps](/workspace/chat/query-logs).\n\n5. Click **Save**.\n\nGrant other people permission to configure the Chat API\n-------------------------------------------------------\n\nYou can\n[give specific users access](https://cloud.google.com/iam/docs/granting-changing-revoking-access#single-role)\nto the Chat app configuration page by granting them\nthe **Chat apps Owner** or **Chat apps Viewer**\n[Google Cloud Identity Access Management (IAM) role](https://cloud.google.com/iam/docs/understanding-roles#chat-roles).\nUsers with these roles can't navigate to the Chat apps\nconfiguration page by using the **APIs \\& Services** dashboard, but can\naccess the configuration page by navigating to the Google Cloud console for the\nChat app's host Cloud project as follows: \n\n```\nhttps://console.developers.google.com/apis/api/chat.googleapis.com/hangouts-chat?project=PROJECT_ID\n```\n\nWhere \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e is the project ID of the\nGoogle Cloud project hosting the Chat app.\n| Users with **Project** roles can also access the app configuration page.\n|\n|\n| Users with custom roles containing the\n| `resourcemanager.projects.(get|update)` permissions cannot access\n| the Chat app configuration. For custom roles, use\n| the `chat.bots.(get|update)` permissions instead.\n\nRelated topics\n--------------\n\n- [Choose a Chat app architecture](/workspace/chat/structure)\n- To configure your Chat app for interactive features, see [Receive and respond to user interactions](/workspace/chat/receive-respond-interactions)"]]