Method: people.get
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Memberikan informasi tentang seseorang dengan menentukan nama sumber daya. Gunakan people/me
untuk menunjukkan pengguna yang diautentikasi.
Permintaan menampilkan error 400 jika 'personFields' tidak ditentukan.
Permintaan HTTP
GET https://people.googleapis.com/v1/{resourceName=people/*}
URL menggunakan sintaksis gRPC Transcoding.
Parameter jalur
Parameter |
resourceName |
string
Wajib. Nama resource orang yang akan diberi informasi.
- Untuk mendapatkan informasi tentang pengguna yang diautentikasi, tetapkan
people/me .
- Untuk mendapatkan informasi tentang Akun Google, tentukan
people/{account_id} .
- Untuk mendapatkan informasi tentang kontak, tentukan nama resource yang mengidentifikasi kontak seperti yang ditampilkan oleh
people.connections.list .
|
Parameter kueri
Parameter |
requestMask (deprecated) |
object (RequestMask )
TIDAK DIGUNAKAN LAGI (Sebagai gantinya, gunakan personFields ) Mask untuk membatasi hasil ke sebagian kolom orang.
|
personFields |
string (FieldMask format)
Wajib. Mask kolom untuk membatasi kolom pada orang yang ditampilkan. Beberapa kolom dapat ditentukan dengan memisahkannya menggunakan koma. Nilai yang valid adalah:
- addresses
- ageRanges
- biografi
- ulang tahun
- calendarUrls
- clientData
- coverPhotos
- emailAddresses
- acara
- externalIds
- gender
- imClients
- minat
- locales
- lokasi
- channel
- metadata
- miscKeywords
- names
- nama panggilan
- pekerjaan
- organizations
- phoneNumbers
- foto
- relasi
- sipAddresses
- keterampilan
- urls
- userDefined
|
sources[] |
enum (ReadSourceType )
Opsional. Mask untuk jenis sumber yang akan ditampilkan. Jika tidak ditetapkan, setelan defaultnya adalah READ_SOURCE_TYPE_PROFILE dan READ_SOURCE_TYPE_CONTACT .
|
Isi permintaan
Isi permintaan harus kosong.
Isi respons
Jika berhasil, isi respons akan berisi instance Person
.
Cakupan otorisasi
Tidak diperlukan otorisasi untuk mengakses data publik. Untuk data pribadi, salah satu cakupan OAuth berikut diperlukan:
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
Untuk informasi selengkapnya, lihat Panduan otorisasi.
Kecuali dinyatakan lain, konten di halaman ini dilisensikan berdasarkan Lisensi Creative Commons Attribution 4.0, sedangkan contoh kode dilisensikan berdasarkan Lisensi Apache 2.0. Untuk mengetahui informasi selengkapnya, lihat Kebijakan Situs Google Developers. Java adalah merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2024-08-06 UTC.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Informasi yang saya butuhkan tidak ada","missingTheInformationINeed","thumb-down"],["Terlalu rumit/langkahnya terlalu banyak","tooComplicatedTooManySteps","thumb-down"],["Sudah usang","outOfDate","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Masalah kode / contoh","samplesCodeIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 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"]]