Method: people.searchDirectoryPeople
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Cung cấp danh sách hồ sơ miền và địa chỉ liên hệ trên miền trong thư mục miền của người dùng đã xác thực khớp với cụm từ tìm kiếm.
Yêu cầu HTTP
GET https://people.googleapis.com/v1/people:searchDirectoryPeople
URL sử dụng cú pháp Chuyển mã gRPC.
Tham số truy vấn
Thông số |
query |
string
Bắt buộc. Truy vấn tạo tiền tố khớp với các trường trong người. KHÔNG sử dụng readMask để xác định những trường cần so khớp.
|
readMask |
string (FieldMask format)
Bắt buộc. Mặt nạ trường để hạn chế những trường nào trên mỗi người được trả về. Bạn có thể chỉ định nhiều trường bằng cách phân tách các trường đó bằng dấu phẩy. Các giá trị hợp lệ là:
- địa chỉ
- độ tuổi
- tiểu sử
- ngày sinh
- calendarUrls
- clientData
- coverPhotos
- emailAddresses
- sự kiện
- externalIds
- giới tính
- imClients
- sở thích
- locales
- vị trí
- của kênh
- siêu dữ liệu
- miscKeywords
- tên
- biệt hiệu
- nghề nghiệp
- tổ chức
- phoneNumbers
- ảnh
- quan hệ
- sipAddresses
- kỹ năng
- url
- userDefined
|
sources[] |
enum (DirectorySourceType )
Bắt buộc. Nguồn thư mục cần trả về.
|
mergeSources[] |
enum (DirectoryMergeSourceType )
Không bắt buộc. Dữ liệu bổ sung cần hợp nhất vào các nguồn thư mục nếu chúng được kết nối thông qua các khoá kết hợp đã xác minh, chẳng hạn như địa chỉ email hoặc số điện thoại.
|
pageSize |
integer
Không bắt buộc. Số người cần đưa vào câu trả lời. Giá trị hợp lệ nằm trong khoảng từ 1 đến 500. Mặc định là 100 nếu không được đặt hoặc được đặt thành 0.
|
pageToken |
string
Không bắt buộc. Mã thông báo trang, nhận được từ một phản hồi nextPageToken trước đó. Cung cấp giá trị này để truy xuất trang tiếp theo. Khi phân trang, tất cả các tham số khác được cung cấp cho [people.searchDirectoryPeople ][google.people.v1.SearchDirectoryPeople] phải khớp với lệnh gọi đầu tiên đã cung cấp mã thông báo trang.
|
Nội dung yêu cầu
Nội dung yêu cầu phải trống.
Nội dung phản hồi
Phản hồi cho yêu cầu về người trong thư mục miền của người dùng đã xác thực khớp với truy vấn được chỉ định.
Nếu thành công, phần nội dung phản hồi sẽ chứa dữ liệu có cấu trúc sau:
Biểu diễn dưới dạng JSON |
{
"people": [
{
object (Person )
}
],
"nextPageToken": string,
"totalSize": integer
} |
Trường |
people[] |
object (Person )
Danh sách những người trong thư mục miền khớp với truy vấn.
|
nextPageToken |
string
Mã thông báo có thể được gửi dưới dạng pageToken để truy xuất trang tiếp theo. Nếu bạn bỏ qua trường này, thì sẽ không có trang tiếp theo.
|
totalSize |
integer
Tổng số mục trong danh sách mà không phân trang.
|
Phạm vi uỷ quyền
Yêu cầu phạm vi OAuth sau:
https://www.googleapis.com/auth/directory.readonly
Để biết thêm thông tin, hãy xem Hướng dẫn uỷ quyền.
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2024-11-08 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2024-11-08 UTC."],[[["\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)."]]