Method: people.searchDirectoryPeople
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ระบุรายการโปรไฟล์ของโดเมนและรายชื่อติดต่อของโดเมนในไดเรกทอรีโดเมนของผู้ใช้ที่ผ่านการตรวจสอบสิทธิ์ซึ่งตรงกับคำค้นหา
คำขอ HTTP
GET https://people.googleapis.com/v1/people:searchDirectoryPeople
URL ใช้ไวยากรณ์การแปลง gRPC
พารามิเตอร์การค้นหา
พารามิเตอร์ |
query |
string
ต้องระบุ คำค้นหาคำนำหน้าซึ่งตรงกับช่องในบุคคล ไม่ได้ใช้ ReadMask ในการระบุช่องที่จะจับคู่
|
readMask |
string (FieldMask format)
ต้องระบุ มาสก์ฟิลด์เพื่อจํากัดฟิลด์ของบุคคลแต่ละคนที่จะแสดงผล คุณสามารถระบุหลายช่องโดยคั่นด้วยคอมมา ค่าที่ใช้ได้มีดังนี้
- ที่อยู่
- ageRanges
- ชีวประวัติ
- วันเกิด
- calendarUrls
- clientData
- coverPhotos
- emailAddresses
- กิจกรรม
- externalIds
- เพศ
- imClients
- ความสนใจ
- ภาษา
- สถานที่ตั้ง
- ของช่อง
- ข้อมูลเมตา
- miscKeywords
- ชื่อ
- ชื่อเล่น
- อาชีพ
- องค์กร
- phoneNumbers
- รูปภาพ
- ความสัมพันธ์
- sipAddresses
- ทักษะ
- URL
- userDefined
|
sources[] |
enum (DirectorySourceType )
ต้องระบุ แหล่งที่มาของไดเรกทอรีที่จะแสดง
|
mergeSources[] |
enum (DirectoryMergeSourceType )
ไม่บังคับ ข้อมูลเพิ่มเติมที่จะผสานรวมกับแหล่งข้อมูลไดเรกทอรีหากเชื่อมต่อผ่านคีย์การเข้าร่วมที่ยืนยันแล้ว เช่น อีเมลหรือหมายเลขโทรศัพท์
|
pageSize |
integer
ไม่บังคับ จำนวนคนที่จะรวมไว้ในคำตอบ ค่าที่ใช้ได้คือตั้งแต่ 1 ถึง 500 ค่าเริ่มต้นจะเป็น 100 หากไม่ได้ตั้งค่าไว้หรือตั้งค่าเป็น 0
|
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 Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2024-11-08 UTC
[null,null,["อัปเดตล่าสุด 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)."]]