Method: people.getBatchGet
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 thông tin về danh sách những người cụ thể bằng cách chỉ định danh sách tên tài nguyên được yêu cầu. Sử dụng people/me
để cho biết người dùng đã được xác thực.
Yêu cầu sẽ trả về lỗi 400 nếu bạn không chỉ định "personFields".
Yêu cầu HTTP
GET https://people.googleapis.com/v1/people:batchGet
URL sử dụng cú pháp Chuyển mã gRPC.
Tham số truy vấn
Thông số |
resourceNames[] |
string
Bắt buộc. Tên tài nguyên của những người mà bạn muốn cung cấp thông tin. Có thể lặp lại. Tham số truy vấn URL phải là
resourceNames=<name1>&resourceNames=<name2>&...
- Để nhận thông tin về người dùng đã xác thực, hãy chỉ định
people/me .
- Để nhận thông tin về một tài khoản Google, hãy chỉ định
people/{account_id} .
- Để nhận thông tin về một người liên hệ, hãy chỉ định tên tài nguyên xác định người liên hệ do
people.connections.list trả về.
Có tối đa 200 tên tài nguyên.
|
requestMask (deprecated) |
object (RequestMask )
KHÔNG DÙNG NỮA (Vui lòng sử dụng personFields ) Mặt nạ để hạn chế kết quả ở một số trường người.
|
personFields |
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 dùng dấu phẩy để phân tách các trường. 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
- ngôn ngữ
- 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 (ReadSourceType )
Không bắt buộc. Mặt nạ cho biết các loại nguồn cần trả về. Mặc định là READ_SOURCE_TYPE_CONTACT và READ_SOURCE_TYPE_PROFILE nếu không được đặt.
|
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 lấy danh sách người dùng theo tên tài nguyên.
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 |
{
"responses": [
{
object (PersonResponse )
}
]
} |
Trường |
responses[] |
object (PersonResponse )
Phản hồi cho mỗi tên tài nguyên được yêu cầu.
|
Phạm vi uỷ quyền
Không cần uỷ quyền để truy cập vào dữ liệu công khai. Đối với dữ liệu riêng tư, bạn phải có một trong các phạm vi OAuth sau:
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
Để 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.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2024-11-08 UTC."],[[["Retrieves information about a list of specific people, including the authenticated user, by specifying resource names."],["Requires the `personFields` query parameter to specify desired data fields and returns a 400 error if it's missing."],["Supports various authorization scopes for accessing private data, although public data requires no authorization."],["Returns a JSON response containing an array of `PersonResponse` objects, each corresponding to a requested resource name."],["Uses the `GET` HTTP method and the `https://people.googleapis.com/v1/people:batchGet` endpoint with gRPC Transcoding syntax."]]],["This outlines how to retrieve information about specific people using the `people:batchGet` endpoint via a `GET` HTTP request. You must provide `resourceNames` (up to 200) in the query, identifying each person (e.g., `people/me` or `people/{account_id}`). The `personFields` parameter is required to specify which person attributes to include. The request body is empty. The response returns an array of `PersonResponse` objects, one for each requested resource name, and requires authorization scopes for private data. A 400 error is returned if 'personFields' are not provided.\n"]]