Method: users.get
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
HTTP リクエスト
GET https://admin.googleapis.com/admin/directory/v1/users/{userKey}
この URL は gRPC Transcoding 構文を使用します。
パスパラメータ
パラメータ |
userKey |
string
API リクエストでユーザーを識別します。この値は、ユーザーのメインのメールアドレス、エイリアス メールアドレス、一意のユーザー ID のいずれかです。
|
クエリ パラメータ
パラメータ |
customFieldMask |
string
スキーマ名のカンマ区切りのリスト。これらのスキーマのすべてのフィールドがフェッチされます。projection=custom の場合にのみ設定する必要があります。
|
projection |
enum (Projection )
このユーザーに対して取得するフィールドのサブセット。
|
viewType |
enum (ViewType )
ユーザーの管理者専用ビューとドメイン全体の公開ビューのどちらを取得するか。詳細については、管理者以外のユーザーを取得するをご覧ください。
|
リクエストの本文
リクエストの本文は空にする必要があります。
レスポンスの本文
成功した場合、レスポンスの本文には User
のインスタンスが含まれます。
認可スコープ
以下のいずれかの OAuth スコープが必要です。
https://www.googleapis.com/auth/admin.directory.user
https://www.googleapis.com/auth/admin.directory.user.readonly
詳しくは、認可ガイドをご覧ください。
予測
列挙型 |
BASIC |
ユーザーのカスタム フィールドは含めないでください。 |
CUSTOM |
customFieldMask でリクエストされたスキーマのカスタム フィールドを含めます。 |
FULL |
このユーザーに関連付けられているすべてのフィールドを含めます。 |
ViewType
列挙型 |
admin_view |
結果には、ユーザーの管理者専用フィールドとドメイン公開フィールドの両方が含まれます。 |
domain_public |
結果には、ドメイン内の他のユーザーに公開されているユーザーのフィールドのみが含まれます。 |
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-25 UTC。
[null,null,["最終更新日 2025-07-25 UTC。"],[],[],null,["Retrieves a user.\n\nHTTP request\n\n`GET https://admin.googleapis.com/admin/directory/v1/users/{userKey}`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\nPath parameters\n\n| Parameters ||\n|-----------|---------------------------------------------------------------------------------------------------------------------------------------------|\n| `userKey` | `string` Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID. |\n\nQuery parameters\n\n| Parameters ||\n|-------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `customFieldMask` | `string` A comma-separated list of schema names. All fields from these schemas are fetched. This should only be set when `projection=custom`. |\n| `projection` | `enum (`[Projection](/workspace/admin/directory/reference/rest/v1/users/get#Projection)`)` What subset of fields to fetch for this user. |\n| `viewType` | `enum (`[ViewType](/workspace/admin/directory/reference/rest/v1/users/get#ViewType)`)` Whether to fetch the administrator-only or domain-wide public view of the user. For more information, see [Retrieve a user as a non-administrator](https://developers.google.com/workspace/admin/directory/v1/guides/manage-users#retrieve_users_non_admin). |\n\nRequest body\n\nThe request body must be empty.\n\nResponse body\n\nIf successful, the response body contains an instance of [User](/workspace/admin/directory/reference/rest/v1/users#User).\n\nAuthorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/admin.directory.user`\n- `\n https://www.googleapis.com/auth/admin.directory.user.readonly`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent).\n\nProjection\n\n| Enums ||\n|----------|--------------------------------------------------------------------|\n| `BASIC` | Do not include any custom fields for the user. |\n| `CUSTOM` | Include custom fields from schemas requested in `customFieldMask`. |\n| `FULL` | Include all fields associated with this user. |\n\nViewType\n\n| Enums ||\n|-----------------|--------------------------------------------------------------------------------------------------|\n| `admin_view` | Results include both administrator-only and domain-public fields for the user. |\n| `domain_public` | Results only include fields for the user that are publicly visible to other users in the domain. |"]]