Users: watch

Requires authorization

Watch for changes in users list

Request

HTTP request

POST https://www.googleapis.com/admin/directory/v1/users/watch

Parameters

Parameter name Value Description
Optional query parameters
customFieldMask string Comma-separated list of schema names. All fields from these schemas are fetched. This should only be set when projection=custom.
customer string Immutable ID of the G Suite account. In case of multi-domain, to fetch all users for a customer, fill this field instead of domain.
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.
event string Events to watch for.

Acceptable values are:
  • "add": User Created Event
  • "delete": User Deleted Event
  • "makeAdmin": User Admin Status Change Event
  • "undelete": User Undeleted Event
  • "update": User Updated Event
orderBy string Column to use for sorting results

Acceptable values are:
  • "email": Primary email of the user.
  • "familyName": User's family name.
  • "givenName": User's given name.
projection string What subset of fields to fetch for this user.

Acceptable values are:
  • "basic": Do not include any custom fields for the user. (default)
  • "custom": Include custom fields from schemas mentioned in customFieldMask.
  • "full": Include all fields associated with this user.
query string Query string search. Should be of the form "". Complete documentation is at https://developers.google.com/admin-sdk/directory/v1/guides/search-users
showDeleted string If set to true, retrieves the list of deleted users. (Default: false)
sortOrder string Whether to return results in ascending or descending order.

Acceptable values are:
  • "ASCENDING": Ascending order.
  • "DESCENDING": Descending order.
viewType string 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.

Acceptable values are:
  • "admin_view": Results include both administrator-only and domain-public fields. (default)
  • "domain_public": Results only include fields for the user that are publicly visible to other users in the domain.

Authorization

This request requires authorization with at least one of the following scopes (read more about authentication and authorization).

Scope
https://www.googleapis.com/auth/admin.directory.user.readonly
https://www.googleapis.com/auth/admin.directory.user

Request body

In the request body, supply data with the following structure:

{
  "id": string,
  "token": string,
  "expiration": long,
  "type": string,
  "address": string,
  "payload": boolean,
  "params": {
    ttl: string
  }
}
Property name Value Description Notes
id string A UUID or similar unique string that identifies this channel.
token string An arbitrary string delivered to the target address with each notification delivered over this channel. Optional.
expiration long Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.
type string The type of delivery mechanism used for this channel.
address string The address where notifications are delivered for this channel.
payload boolean A Boolean value to indicate whether payload is wanted. Optional.
params object Additional parameters controlling delivery channel behavior. Optional.
params.ttl string Specifies the time-to-live in seconds for the notification channel. Optional.

Response

If successful, this method returns a response body with the following structure:

{
  "kind": "api#channel",
  "id": string,
  "resourceId": string,
  "resourceUri": string,
  "token": string,
  "expiration": long
}
Property name Value Description Notes
kind string Identifies this as a notification channel used to watch for changes to a resource, which is "api#channel".
id string A UUID or similar unique string that identifies this channel.
resourceId string An opaque ID that identifies the resource being watched on this channel. Stable across different API versions.
resourceUri string A version-specific identifier for the watched resource.
token string An arbitrary string delivered to the target address with each notification delivered over this channel. Optional.
expiration long Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.

Enviar comentarios sobre…

¿Necesitas ayuda? Visita nuestra página de asistencia.