Method: people.listDirectoryPeople
Stay organized with collections
Save and categorize content based on your preferences.
Provides a list of domain profiles and domain contacts in the authenticated user's domain directory.
When the syncToken
is specified, resources deleted since the last sync will be returned as a person with PersonMetadata.deleted
set to true.
When the pageToken
or syncToken
is specified, all other request parameters must match the first call.
Writes may have a propagation delay of several minutes for sync requests. Incremental syncs are not intended for read-after-write use cases.
See example usage at List the directory people that have changed
.
HTTP request
GET https://people.googleapis.com/v1/people:listDirectoryPeople
The URL uses gRPC Transcoding
syntax.
Query parameters
readMask
string ( FieldMask
format)
Required. A field mask to restrict which fields on each person are returned. Multiple fields can be specified by separating them with commas. Valid values are:
- addresses
- ageRanges
- biographies
- birthdays
- calendarUrls
- clientData
- coverPhotos
- emailAddresses
- events
- externalIds
- genders
- imClients
- interests
- locales
- locations
- memberships
- metadata
- miscKeywords
- names
- nicknames
- occupations
- organizations
- phoneNumbers
- photos
- relations
- sipAddresses
- skills
- urls
- userDefined
mergeSources[]
enum ( DirectoryMergeSourceType
)
Optional. Additional data to merge into the directory sources if they are connected through verified join keys such as email addresses or phone numbers.
pageSize
integer
Optional. The number of people to include in the response. Valid values are between 1 and 1000, inclusive. Defaults to 100 if not set or set to 0.
pageToken
string
Optional. A page token, received from a previous response nextPageToken
. Provide this to retrieve the subsequent page.
When paginating, all other parameters provided to people.listDirectoryPeople
must match the first call that provided the page token.
syncToken
string
Optional. A sync token, received from a previous response nextSyncToken
Provide this to retrieve only the resources changed since the last request.
When syncing, all other parameters provided to people.listDirectoryPeople
must match the first call that provided the sync token.
More details about sync behavior at people.listDirectoryPeople
.
Request body
The request body must be empty.
Response body
The response to a request for the authenticated user's domain directory.
If successful, the response body contains data with the following structure:
Fields |
people[]
|
object ( Person
)
The list of people in the domain directory.
|
nextPageToken
|
string
A token, which can be sent as pageToken
to retrieve the next page. If this field is omitted, there are no subsequent pages.
|
nextSyncToken
|
string
A token, which can be sent as syncToken
to retrieve changes since the last request. Request must set requestSyncToken
to return the sync token.
|
Authorization scopes
Requires the following OAuth scope:
-
https://www.googleapis.com/auth/directory.readonly
For more information, see the Authorization guide
.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License
, and code samples are licensed under the Apache 2.0 License
. For details, see the Google Developers Site Policies
. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-08-06 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-08-06 UTC."],[[["\u003cp\u003eLists domain profiles and contacts within the authenticated user's domain directory.\u003c/p\u003e\n"],["\u003cp\u003eAllows for filtering and pagination of results using query parameters like \u003ccode\u003ereadMask\u003c/code\u003e, \u003ccode\u003esources\u003c/code\u003e, \u003ccode\u003epageSize\u003c/code\u003e, \u003ccode\u003epageToken\u003c/code\u003e, and \u003ccode\u003esyncToken\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eSupports incremental synchronization to retrieve changes since the last request using the \u003ccode\u003esyncToken\u003c/code\u003e and \u003ccode\u003erequestSyncToken\u003c/code\u003e parameters.\u003c/p\u003e\n"],["\u003cp\u003eReturns a list of \u003ccode\u003ePerson\u003c/code\u003e objects containing directory information, along with pagination and synchronization tokens.\u003c/p\u003e\n"],["\u003cp\u003eRequires the \u003ccode\u003ehttps://www.googleapis.com/auth/directory.readonly\u003c/code\u003e OAuth scope for authorization.\u003c/p\u003e\n"]]],["This outlines how to list domain profiles and contacts via a `GET` request to `https://people.googleapis.com/v1/people:listDirectoryPeople`. Key actions include specifying `readMask`, `sources`, `mergeSources`, `pageSize`, `pageToken`, `requestSyncToken`, and `syncToken` as query parameters. An empty request body is required. The response, containing an array of `people`, `nextPageToken`, and `nextSyncToken` fields, allows for pagination and synchronization of changes. The `https://www.googleapis.com/auth/directory.readonly` authorization scope is required.\n"],null,["# Method: people.listDirectoryPeople\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n - [JSON representation](#body.ListDirectoryPeopleResponse.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nProvides a list of domain profiles and domain contacts in the authenticated user's domain directory.\n\nWhen the [`syncToken`](/people/api/rest/v1/people/listDirectoryPeople#body.QUERY_PARAMETERS.sync_token) is specified, resources deleted since the last sync will be returned as a person with [`PersonMetadata.deleted`](/people/api/rest/v1/people#Person.PersonMetadata.FIELDS.deleted) set to true.\n\nWhen the [`pageToken`](/people/api/rest/v1/people/listDirectoryPeople#body.QUERY_PARAMETERS.page_token) or [`syncToken`](/people/api/rest/v1/people/listDirectoryPeople#body.QUERY_PARAMETERS.sync_token) is specified, all other request parameters must match the first call.\n\nWrites may have a propagation delay of several minutes for sync requests. Incremental syncs are not intended for read-after-write use cases.\n\nSee example usage at [List the directory people that have changed](/people/v1/directory#list_the_directory_people_that_have_changed).\n\n### HTTP request\n\n`GET https://people.googleapis.com/v1/people:listDirectoryPeople`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Query parameters\n\n| Parameters ||\n|--------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `readMask` | `string (`[FieldMask](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask)` format)` Required. A field mask to restrict which fields on each person are returned. Multiple fields can be specified by separating them with commas. Valid values are: - addresses - ageRanges - biographies - birthdays - calendarUrls - clientData - coverPhotos - emailAddresses - events - externalIds - genders - imClients - interests - locales - locations - memberships - metadata - miscKeywords - names - nicknames - occupations - organizations - phoneNumbers - photos - relations - sipAddresses - skills - urls - userDefined |\n| `sources[]` | `enum (`[DirectorySourceType](/people/api/rest/v1/DirectorySourceType)`)` Required. Directory sources to return. |\n| `mergeSources[]` | `enum (`[DirectoryMergeSourceType](/people/api/rest/v1/DirectoryMergeSourceType)`)` Optional. Additional data to merge into the directory sources if they are connected through verified join keys such as email addresses or phone numbers. |\n| `pageSize` | `integer` Optional. The number of people to include in the response. Valid values are between 1 and 1000, inclusive. Defaults to 100 if not set or set to 0. |\n| `pageToken` | `string` Optional. A page token, received from a previous response [`nextPageToken`](/people/api/rest/v1/people/listDirectoryPeople#body.ListDirectoryPeopleResponse.FIELDS.next_page_token). Provide this to retrieve the subsequent page. When paginating, all other parameters provided to [`people.listDirectoryPeople`](/people/api/rest/v1/people/listDirectoryPeople#google.people.v1.PeopleService.ListDirectoryPeople) must match the first call that provided the page token. |\n| `requestSyncToken` | `boolean` Optional. Whether the response should return [`nextSyncToken`](/people/api/rest/v1/people/listDirectoryPeople#body.ListDirectoryPeopleResponse.FIELDS.next_sync_token). It can be used to get incremental changes since the last request by setting it on the request [`syncToken`](/people/api/rest/v1/people/listDirectoryPeople#body.QUERY_PARAMETERS.sync_token). More details about sync behavior at [`people.listDirectoryPeople`](/people/api/rest/v1/people/listDirectoryPeople#google.people.v1.PeopleService.ListDirectoryPeople). |\n| `syncToken` | `string` Optional. A sync token, received from a previous response [`nextSyncToken`](/people/api/rest/v1/people/listDirectoryPeople#body.ListDirectoryPeopleResponse.FIELDS.next_sync_token) Provide this to retrieve only the resources changed since the last request. When syncing, all other parameters provided to [`people.listDirectoryPeople`](/people/api/rest/v1/people/listDirectoryPeople#google.people.v1.PeopleService.ListDirectoryPeople) must match the first call that provided the sync token. More details about sync behavior at [`people.listDirectoryPeople`](/people/api/rest/v1/people/listDirectoryPeople#google.people.v1.PeopleService.ListDirectoryPeople). |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nThe response to a request for the authenticated user's domain directory.\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|----------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"people\": [ { object (/people/api/rest/v1/people#Person) } ], \"nextPageToken\": string, \"nextSyncToken\": string } ``` |\n\n| Fields ||\n|-----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `people[]` | `object (`[Person](/people/api/rest/v1/people#Person)`)` The list of people in the domain directory. |\n| `nextPageToken` | `string` A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted, there are no subsequent pages. |\n| `nextSyncToken` | `string` A token, which can be sent as `syncToken` to retrieve changes since the last request. Request must set `requestSyncToken` to return the sync token. |\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/directory.readonly`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent)."]]