Method: users.watch
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
HTTP リクエスト
POST https://admin.googleapis.com/admin/directory/v1/users/watch
この URL は gRPC Transcoding 構文を使用します。
クエリ パラメータ
パラメータ |
domain |
string
ドメインの名前。このフィールドに入力すると、このドメインのユーザーのみを取得できます。代わりに、マルチドメインの [顧客] フィールドにすべてのユーザーを返すようにします。」
|
customer |
string
Google Workspace アカウントの不変 ID。複数ドメインの場合、お客様のすべてのユーザーを取得するには、ドメインではなくこのフィールドに入力します。
|
event |
enum (EventType )
注意すべきイベント。
|
customFieldMask |
string
スキーマ名のカンマ区切りのリスト。これらのスキーマのすべてのフィールドがフェッチされます。これは、projection=custom の場合にのみ設定する必要があります。
|
maxResults |
integer
返される結果の最大数。
|
orderBy |
enum (OrderBy )
結果の並べ替えに使用する列
|
pageToken |
string
リストの次のページを指定するトークン
|
projection |
enum (Projection )
このユーザーに対して取得するフィールドのサブセット。
|
query |
string
クエリ文字列検索。「」の形式にする必要があります。詳細なドキュメントは、https: //developers.google.com/workspace/admin/directory/v1/guides/search-users をご覧ください。
|
showDeleted |
string
true に設定すると、削除されたユーザーのリストが取得されます。(デフォルト: false)
|
sortOrder |
enum (SortOrder )
結果を昇順または降順のどちらで返すかを指定します。
|
viewType |
enum (ViewType )
ユーザーの管理者専用ビューとドメイン全体の公開ビューのどちらを取得するか。詳細については、管理者以外のユーザーを取得するをご覧ください。
|
リクエストの本文
リクエストの本文には SubscriptionChannel
のインスタンスが含まれます。
レスポンスの本文
成功した場合、レスポンスの本文には SubscriptionChannel
のインスタンスが含まれます。
認可スコープ
以下のいずれかの OAuth スコープが必要です。
https://www.googleapis.com/auth/admin.directory.user
https://www.googleapis.com/auth/admin.directory.user.readonly
https://www.googleapis.com/auth/cloud-platform
詳しくは、認可ガイドをご覧ください。
EventType
列挙型 |
ADD |
ユーザー作成イベント |
DELETE |
ユーザーが削除したイベント |
MAKE_ADMIN |
ユーザー管理ステータス変更イベント |
UNDELETE |
ユーザーの削除の取り消しイベント |
UPDATE |
ユーザーが更新したイベント |
OrderBy
列挙型 |
EMAIL |
ユーザーのメインのメールアドレス。 |
FAMILY_NAME |
ユーザーの姓。 |
GIVEN_NAME |
ユーザーの名。 |
予測
列挙型 |
BASIC |
ユーザーのカスタム フィールドは含めないでください。 |
CUSTOM |
customFieldMask に記載されているスキーマのカスタム フィールドを含めます。 |
FULL |
このユーザーに関連付けられているすべてのフィールドを含めます。 |
SortOrder
列挙型 |
ASCENDING |
昇順。 |
DESCENDING |
降順。 |
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,["# Method: users.watch\n\nWatches for changes in users list.\n\n### HTTP request\n\n`POST https://admin.googleapis.com/admin/directory/v1/users/watch`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Query parameters\n\n| Parameters ||\n|-------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `domain` | `string` Name of the domain. Fill this field to get users from only this domain. To return all users in a multi-domain fill customer field instead.\" |\n| `customer` | `string` Immutable ID of the Google Workspace account. In case of multi-domain, to fetch all users for a customer, fill this field instead of domain. |\n| `event` | `enum (`[EventType](/workspace/admin/directory/reference/rest/v1/users/watch#EventType)`)` Events to watch for. |\n| `customFieldMask` | `string` Comma-separated list of schema names. All fields from these schemas are fetched. This should only be set when projection=custom. |\n| `maxResults` | `integer` Maximum number of results to return. |\n| `orderBy` | `enum (`[OrderBy](/workspace/admin/directory/reference/rest/v1/users/watch#OrderBy)`)` Column to use for sorting results |\n| `pageToken` | `string` Token to specify next page in the list |\n| `projection` | `enum (`[Projection](/workspace/admin/directory/reference/rest/v1/users/watch#Projection)`)` What subset of fields to fetch for this user. |\n| `query` | `string` Query string search. Should be of the form \"\". Complete documentation is at https: //developers.google.com/workspace/admin/directory/v1/guides/search-users |\n| `showDeleted` | `string` If set to true, retrieves the list of deleted users. (Default: false) |\n| `sortOrder` | `enum (`[SortOrder](/workspace/admin/directory/reference/rest/v1/users/watch#SortOrder)`)` Whether to return results in ascending or descending order. |\n| `viewType` | `enum (`[ViewType](/workspace/admin/directory/reference/rest/v1/users/watch#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\n### Request body\n\nThe request body contains an instance of [SubscriptionChannel](/workspace/admin/directory/reference/rest/v1/SubscriptionChannel).\n\n### Response body\n\nIf successful, the response body contains an instance of [SubscriptionChannel](/workspace/admin/directory/reference/rest/v1/SubscriptionChannel).\n\n### Authorization 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- `\n https://www.googleapis.com/auth/cloud-platform`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent).\n\nEventType\n---------\n\nType of the Subscription event\n\n| Enums ||\n|--------------|--------------------------------|\n| `ADD` | User Created Event |\n| `DELETE` | User Deleted Event |\n| `MAKE_ADMIN` | User Admin Status Change Event |\n| `UNDELETE` | User Undeleted Event |\n| `UPDATE` | User Updated Event |\n\nOrderBy\n-------\n\n| Enums ||\n|---------------|----------------------------|\n| `EMAIL` | Primary email of the user. |\n| `FAMILY_NAME` | User's family name. |\n| `GIVEN_NAME` | User's given name. |\n\nProjection\n----------\n\n| Enums ||\n|----------|------------------------------------------------------------------|\n| `BASIC` | Do not include any custom fields for the user. |\n| `CUSTOM` | Include custom fields from schemas mentioned in customFieldMask. |\n| `FULL` | Include all fields associated with this user. |\n\nSortOrder\n---------\n\n| Enums ||\n|--------------|-------------------|\n| `ASCENDING` | Ascending order. |\n| `DESCENDING` | Descending order. |\n\nViewType\n--------\n\n| Enums ||\n|-----------------|--------------------------------------------------------------------------------------------------|\n| `admin_view` | Results include both administrator-only and domain-public fields. |\n| `domain_public` | Results only include fields for the user that are publicly visible to other users in the domain. |"]]