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

โปรดดูข้อมูลเพิ่มเติมที่คู่มือการให้สิทธิ์