Method: people.get
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ให้ข้อมูลเกี่ยวกับบุคคลโดยระบุชื่อทรัพยากร ใช้ people/me
เพื่อระบุผู้ใช้ที่ตรวจสอบสิทธิ์แล้ว
คำขอแสดงข้อผิดพลาด 400 หากไม่ได้ระบุ "personFields"
คำขอ HTTP
GET https://people.googleapis.com/v1/{resourceName=people/*}
URL ใช้ไวยากรณ์การแปลง gRPC
พารามิเตอร์เส้นทาง
พารามิเตอร์ |
resourceName |
string
ต้องระบุ ชื่อทรัพยากรของบุคคลที่จะให้ข้อมูล
- หากต้องการดูข้อมูลเกี่ยวกับผู้ใช้ที่ตรวจสอบสิทธิ์แล้ว ให้ระบุ
people/me
- หากต้องการดูข้อมูลเกี่ยวกับบัญชี Google ให้ระบุ
people/{account_id}
- หากต้องการดูข้อมูลเกี่ยวกับรายชื่อติดต่อ ให้ระบุชื่อทรัพยากรที่ระบุว่ารายชื่อติดต่อนั้นส่งคืนโดย
people.connections.list
|
พารามิเตอร์การค้นหา
พารามิเตอร์ |
requestMask (deprecated) |
object (RequestMask )
เลิกใช้งานแล้ว (โปรดใช้ personFields แทน) มาสก์เพื่อจำกัดผลลัพธ์ในช่องบุคคลบางส่วน
|
personFields |
string (FieldMask format)
ต้องระบุ ฟิลด์มาสก์เพื่อจำกัดฟิลด์ที่ผู้ใช้ส่งคืน คุณระบุได้หลายช่องโดยคั่นด้วยเครื่องหมายคอมมา ค่าที่ใช้ได้มีดังนี้
- ที่อยู่
- ageRanges
- ชีวประวัติ
- วันเกิด
- calendarUrls
- clientData
- coverPhotos
- emailAddresses
- กิจกรรม
- externalIds
- เพศ
- imClients
- ความสนใจ
- locales
- สถานที่ตั้ง
- ของช่อง
- ข้อมูลเมตา
- miscKeywords
- names
- ชื่อเล่น
- อาชีพ
- organizations
- phoneNumbers
- ภาพถ่าย
- ความสัมพันธ์
- sipAddresses
- ทักษะ
- urls
- userDefined
|
sources[] |
enum (ReadSourceType )
ไม่บังคับ มาสก์ของประเภทแหล่งที่มาที่จะแสดงผล ค่าเริ่มต้นจะเป็น READ_SOURCE_TYPE_PROFILE และ READ_SOURCE_TYPE_CONTACT หากไม่ได้ตั้งค่าไว้
|
เนื้อหาของคำขอ
เนื้อหาของคำขอต้องว่างเปล่า
เนื้อหาการตอบกลับ
หากทำสำเร็จ เนื้อหาการตอบกลับจะมีอินสแตนซ์ Person
ขอบเขตการให้สิทธิ์
ไม่จำเป็นต้องมีการให้สิทธิ์ในการเข้าถึงข้อมูลสาธารณะ สำหรับข้อมูลส่วนตัว ต้องมีขอบเขต OAuth รายการใดรายการหนึ่งต่อไปนี้
https://www.googleapis.com/auth/contacts
https://www.googleapis.com/auth/contacts.readonly
https://www.googleapis.com/auth/contacts.other.readonly
https://www.googleapis.com/auth/directory.readonly
https://www.googleapis.com/auth/profile.agerange.read
https://www.googleapis.com/auth/profile.emails.read
https://www.googleapis.com/auth/profile.language.read
https://www.googleapis.com/auth/user.addresses.read
https://www.googleapis.com/auth/user.birthday.read
https://www.googleapis.com/auth/user.emails.read
https://www.googleapis.com/auth/user.gender.read
https://www.googleapis.com/auth/user.organization.read
https://www.googleapis.com/auth/user.phonenumbers.read
https://www.googleapis.com/auth/userinfo.email
https://www.googleapis.com/auth/userinfo.profile
https://www.googleapis.com/auth/profile.language.read
โปรดดูข้อมูลเพิ่มเติมที่คู่มือการให้สิทธิ์
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2024-08-06 UTC
[[["เข้าใจง่าย","easyToUnderstand","thumb-up"],["แก้ปัญหาของฉันได้","solvedMyProblem","thumb-up"],["อื่นๆ","otherUp","thumb-up"]],[["ไม่มีข้อมูลที่ฉันต้องการ","missingTheInformationINeed","thumb-down"],["ซับซ้อนเกินไป/มีหลายขั้นตอนมากเกินไป","tooComplicatedTooManySteps","thumb-down"],["ล้าสมัย","outOfDate","thumb-down"],["ปัญหาเกี่ยวกับการแปล","translationIssue","thumb-down"],["ตัวอย่าง/ปัญหาเกี่ยวกับโค้ด","samplesCodeIssue","thumb-down"],["อื่นๆ","otherDown","thumb-down"]],["อัปเดตล่าสุด 2024-08-06 UTC"],[[["Retrieves information about a person, including the authenticated user using `people/me` or by specifying a resource name."],["Requires the `personFields` query parameter to specify which fields to include in the response, otherwise, it returns a 400 error."],["Allows filtering the source of the data using the `sources[]` parameter and supports various authorization scopes for accessing private data."],["Uses a `GET` request to the `https://people.googleapis.com/v1/{resourceName=people/*}` endpoint with optional query parameters."],["Response includes a [Person](/people/api/rest/v1/people#Person) object containing the requested information if successful."]]],["This outlines how to retrieve person information via a `GET` request to `https://people.googleapis.com/v1/{resourceName=people/*}`. The `resourceName` path parameter specifies the person (e.g., `people/me` for the authenticated user). The `personFields` query parameter is mandatory and dictates the data returned. The request body must be empty. A successful request returns a `Person` resource. Authorization is needed for private data. A `400` error is returned if `personFields` is not specified.\n"]]