User
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ột người dùng trong Google Chat. Khi được trả về dưới dạng kết quả của một yêu cầu, nếu ứng dụng Chat xác thực với tư cách một người dùng, thì kết quả cho tài nguyên User
chỉ điền sẵn name
và type
của người dùng.
Biểu diễn dưới dạng JSON |
{
"name": string,
"displayName": string,
"domainId": string,
"type": enum (Type ),
"isAnonymous": boolean
} |
Trường |
name |
string
Tên tài nguyên của Google Chat user . Định dạng: users/{user} . Bạn có thể dùng users/app làm biệt hiệu cho người dùng ứng dụng gọi bot . Đối với human users , {user} giống với giá trị nhận dạng người dùng:
id cho Person (Người) trong API Mọi người. Ví dụ: users/123456789 trong API Chat biểu thị cùng một người với Mã hồ sơ cá nhân 123456789 trong API Mọi người.
id dành cho người dùng trong API Thư mục của SDK dành cho quản trị viên.
địa chỉ email của người dùng có thể được dùng làm email đại diện cho {user} trong các yêu cầu API. Ví dụ: nếu Mã hồ sơ cá nhân API Mọi người cho user@example.com là 123456789 , bạn có thể sử dụng users/user@example.com làm bí danh để tham chiếu users/123456789 . Chỉ có tên tài nguyên chính tắc (ví dụ: users/123456789 ) được API trả về.
|
displayName |
string
Chỉ có đầu ra. Tên hiển thị của người dùng.
|
domainId |
string
Giá trị nhận dạng duy nhất của miền Google Workspace của người dùng.
|
type |
enum (Type )
Kiểu người dùng.
|
isAnonymous |
boolean
Chỉ có đầu ra. Khi true , người dùng sẽ bị xoá hoặc hồ sơ của họ không hiển thị.
|
Loại
Enum |
TYPE_UNSPECIFIED |
Giá trị mặc định của enum. KHÔNG SỬ DỤNG. |
HUMAN |
Người dùng. |
BOT |
Người dùng ứng dụng Chat. |
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-25 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-25 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eUser\u003c/code\u003e resource represents a Google Chat user, which can be a human or a Chat app.\u003c/p\u003e\n"],["\u003cp\u003eA user's resource name is formatted as \u003ccode\u003eusers/{user}\u003c/code\u003e, with various identifiers like email or People API ID usable for \u003ccode\u003e{user}\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eWhen a Chat app authenticates as a user, the API response for the \u003ccode\u003eUser\u003c/code\u003e resource only includes the \u003ccode\u003ename\u003c/code\u003e and \u003ccode\u003etype\u003c/code\u003e fields.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003etype\u003c/code\u003e field indicates whether the user is \u003ccode\u003eHUMAN\u003c/code\u003e or \u003ccode\u003eBOT\u003c/code\u003e, while \u003ccode\u003eisAnonymous\u003c/code\u003e signifies a deleted or invisible profile.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003edisplayName\u003c/code\u003e and \u003ccode\u003edomainId\u003c/code\u003e provide additional user information but might not be populated in all contexts.\u003c/p\u003e\n"]]],["The JSON representation defines a user with fields including `name` (resource identifier), `displayName` (user's name), `domainId` (Google Workspace domain), `type` (user or bot), and `isAnonymous` (deleted/hidden profile status). The `name` field uses aliases like email or People API ID. User types include `HUMAN` and `BOT`. Authenticated Chat app users only show `name` and `type` in request outputs. `type` is an enum with possible values like `HUMAN` and `BOT`.\n"],null,["# User\n\n- [JSON representation](#SCHEMA_REPRESENTATION)\n- [Type](#Type)\n\nA user in Google Chat. When returned as an output from a request, if your Chat app [authenticates as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), the output for a `User` resource only populates the user's `name` and `type`.\n\n| JSON representation |\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"name\": string, \"displayName\": string, \"domainId\": string, \"type\": enum (/workspace/chat/api/reference/rest/v1/User#Type), \"isAnonymous\": boolean } ``` |\n\n| Fields ||\n|---------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `name` | `string` Resource name for a Google Chat [user](/workspace/chat/api/reference/rest/v1/User). Format: `users/{user}`. `users/app` can be used as an alias for the calling app [bot](/workspace/chat/api/reference/rest/v1/User#Type.ENUM_VALUES.BOT) user. For [human users](/workspace/chat/api/reference/rest/v1/User#Type.ENUM_VALUES.HUMAN), `{user}` is the same user identifier as: - the `id` for the [Person](https://developers.google.com/people/api/rest/v1/people) in the People API. For example, `users/123456789` in Chat API represents the same person as the `123456789` Person profile ID in People API. - the `id` for a [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users) in the Admin SDK Directory API. - the user's email address can be used as an alias for `{user}` in API requests. For example, if the People API Person profile ID for `user@example.com` is `123456789`, you can use `users/user@example.com` as an alias to reference `users/123456789`. Only the canonical resource name (for example `users/123456789`) will be returned from the API. |\n| `displayName` | `string` Output only. The user's display name. |\n| `domainId` | `string` Unique identifier of the user's Google Workspace domain. |\n| `type` | `enum (`[Type](/workspace/chat/api/reference/rest/v1/User#Type)`)` User type. |\n| `isAnonymous` | `boolean` Output only. When `true`, the user is deleted or their profile is not visible. |\n\nType\n----\n\n| Enums ||\n|--------------------|-----------------------------------------|\n| `TYPE_UNSPECIFIED` | Default value for the enum. DO NOT USE. |\n| `HUMAN` | Human user. |\n| `BOT` | Chat app user. |"]]