Method: people.getBatchGet
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
通过指定请求的资源名称列表,提供与特定人员列表有关的信息。使用 people/me
指示通过身份验证的用户。
如果未指定“personFields”,请求将返回 400 错误。
HTTP 请求
GET https://people.googleapis.com/v1/people:batchGet
网址采用 gRPC 转码语法。
查询参数
参数 |
resourceNames[] |
string
必需。要提供信息的人员的资源名称。此操作可重复执行。网址查询参数应为
resourceNames=<name1>&resourceNames=<name2>&...
- 如需获取经过身份验证的用户的相关信息,请指定
people/me 。
- 如需获取有关 Google 账号的信息,请指定
people/{account_id} 。
- 如需获取联系人的相关信息,请指定用于标识该联系人的资源名称(由
people.connections.list 返回)。
资源名称的数量不得超过 200 个。
|
requestMask (deprecated) |
object (RequestMask )
已弃用(请改用 personFields ) 用于将结果限制到人物字段子集的掩码。
|
personFields |
string (FieldMask format)
必需。用于限制返回每个人哪些字段的字段掩码。您可以指定多个字段,只需用英文逗号分隔即可。有效值包括:
- addresses
- ageRanges
- 传记
- 生日
- calendarUrls
- clientData
- coverPhotos
- emailAddresses
- 活动
- externalIds
- 性别
- imClients
- 兴趣
- locales
- 地理位置
- memberships
- 元数据
- miscKeywords
- names
- 昵称
- 职业
- 组织
- phoneNumbers
- 照片
- 关系
- sipAddresses
- skills
- 网址
- userDefined
|
sources[] |
enum (ReadSourceType )
可选。用于指定要返回的来源类型的掩码。如果未设置,则默认为 READ_SOURCE_TYPE_CONTACT ,READ_SOURCE_TYPE_PROFILE 。
|
响应正文
对按资源名称获取人员列表的 get 请求的响应。
如果成功,响应正文将包含结构如下的数据:
字段 |
responses[] |
object (PersonResponse )
每个请求的资源名称的响应。
|
授权范围
无需授权即可访问公开数据。对于不公开数据,必须选择以下 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 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-11-08。
[[["易于理解","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"]],["最后更新时间 (UTC):2024-11-08。"],[[["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"]]