Method: people.searchDirectoryPeople
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
提供已驗證使用者網域目錄中符合搜尋查詢的網域設定檔及網域聯絡人清單。
HTTP 要求
GET https://people.googleapis.com/v1/people:searchDirectoryPeople
這個網址使用 gRPC 轉碼語法。
查詢參數
參數 |
query |
string
必要欄位。比對人員中欄位的前置查詢。不會使用 readMask 來決定要比對哪些欄位。
|
readMask |
string (FieldMask format)
必要欄位。欄位遮罩可限制系統傳回每個人的哪些欄位。如要指定多個欄位,請以半形逗號分隔。有效值如下:
- addresses
- ageRanges
- 傳記
- 生日
- calendarUrls
- clientData
- coverPhotos
- emailAddresses
- 活動
- externalIds
- 性別
- imClients
- 興趣
- locales
- 位置
- 會籍
- 中繼資料
- miscKeywords
- 名稱
- 暱稱
- 職業
- 機構組織
- phoneNumbers
- 相片
- 關係
- sipAddresses
- skills
- 網址
- userDefined
|
sources[] |
enum (DirectorySourceType )
必要欄位。要傳回的目錄來源。
|
mergeSources[] |
enum (DirectoryMergeSourceType )
選用設定。如透過已驗證的彙整鍵 (例如電子郵件地址或電話號碼) 連結,則可將其他資料合併至目錄來源。
|
pageSize |
integer
選用設定。要加入回應的人數。有效值介於 1 到 500 (含首尾) 之間。如果未設定或已設定為 0,預設值為 100。
|
pageToken |
string
選用設定。從先前回應 nextPageToken 收到的網頁權杖。提供此項目即可擷取後續網頁。 進行分頁時,提供給 [people.searchDirectoryPeople ][google.people.v1.SearchDirectoryPeople] 的所有其他參數都必須與提供網頁權杖的第一個呼叫相符。
|
回應主體
針對已驗證使用者網域目錄中,符合指定查詢的使用者要求提供的回應。
如果成功,回應主體會含有以下結構的資料:
JSON 表示法 |
{
"people": [
{
object (Person )
}
],
"nextPageToken": string,
"totalSize": integer
} |
欄位 |
people[] |
object (Person )
網域目錄中符合查詢的使用者清單。
|
nextPageToken |
string
可做為 pageToken 傳送的權杖,用於擷取後續網頁。如果省略這個欄位,就不會有後續頁面。
|
totalSize |
integer
清單中不含分頁的項目總數。
|
授權範圍
需要下列 OAuth 範圍:
https://www.googleapis.com/auth/directory.readonly
詳情請參閱授權指南。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-11-08 (世界標準時間)。
[null,null,["上次更新時間:2024-11-08 (世界標準時間)。"],[[["\u003cp\u003eSearch for people in your domain directory using a prefix query that matches various person fields.\u003c/p\u003e\n"],["\u003cp\u003eCustomize the search by specifying fields to return, directory sources, and optional data merging.\u003c/p\u003e\n"],["\u003cp\u003eResults are paginated with controls for page size and retrieval of subsequent pages.\u003c/p\u003e\n"],["\u003cp\u003eRequires authorization with the \u003ccode\u003ehttps://www.googleapis.com/auth/directory.readonly\u003c/code\u003e scope for read access to the directory.\u003c/p\u003e\n"]]],["This describes how to search for people in a domain directory. Use a `GET` request to `https://people.googleapis.com/v1/people:searchDirectoryPeople`. Required query parameters include `query`, `readMask`, and `sources`. Optional parameters are `mergeSources`, `pageSize`, and `pageToken`. The request body is empty. The response contains a list of matching `people`, `nextPageToken` for pagination, and `totalSize`. Requires `directory.readonly` authorization scope.\n"],null,["# Method: people.searchDirectoryPeople\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.SearchDirectoryPeopleResponse.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 that match the search query.\n\n### HTTP request\n\n`GET https://people.googleapis.com/v1/people:searchDirectoryPeople`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Query parameters\n\n| Parameters ||\n|------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `query` | `string` Required. Prefix query that matches fields in the person. Does NOT use the readMask for determining what fields to match. |\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 500, 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/searchDirectoryPeople#body.SearchDirectoryPeopleResponse.FIELDS.next_page_token). Provide this to retrieve the subsequent page. When paginating, all other parameters provided to \\[`people.searchDirectoryPeople`\\]\\[google.people.v1.SearchDirectoryPeople\\] must match the first call that provided the page token. |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nThe response to a request for people in the authenticated user's domain directory that match the specified query.\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, \"totalSize\": integer } ``` |\n\n| Fields ||\n|-----------------|----------------------------------------------------------------------------------------------------------------------------------------|\n| `people[]` | `object (`[Person](/people/api/rest/v1/people#Person)`)` The list of people in the domain directory that match the query. |\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| `totalSize` | `integer` The total number of items in the list without pagination. |\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)."]]