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
- 地理位置
- memberships
- 元数据
- miscKeywords
- names
- 昵称
- 职业
- 组织
- phoneNumbers
- 照片
- 关系
- sipAddresses
- skills
- 网址
- userDefined
|
sources[] |
enum (DirectorySourceType )
必需。要返回的目录来源。
|
mergeSources[] |
enum (DirectoryMergeSourceType )
可选。如果目录来源通过经过验证的联接键(例如电子邮件地址或电话号码)连接,则要合并到这些目录来源中的其他数据。
|
pageSize |
integer
可选。回复中要包含的人数。有效值介于 1 和 500 之间(含 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
如需了解详情,请参阅授权指南。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-11-08。
[null,null,["最后更新时间 (UTC):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)."]]