Method: people.get
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
通过指定资源名称提供有关用户的信息。使用 people/me
指示经过身份验证的用户。
如果未指定“personFields”,请求会返回 400 错误。
HTTP 请求
GET https://people.googleapis.com/v1/{resourceName=people/*}
网址采用 gRPC 转码语法。
路径参数
参数 |
resourceName |
string
必需。提供相关信息的人员的资源名称。
- 如需获取有关经过身份验证的用户的信息,请指定
people/me 。
- 要获取关于 Google 帐号的信息,请指定
people/{account_id} 。
- 如需获取联系人的相关信息,请指定
people.connections.list 返回的用于标识联系人的资源名称。
|
查询参数
参数 |
requestMask (deprecated) |
object (RequestMask )
已弃用(请改用 personFields ) 用于将结果限制为部分人员字段的掩码。
|
personFields |
string (FieldMask format)
必需。字段掩码,用于限制返回人员上的哪些字段。可以指定多个字段,用英文逗号分隔各个字段。有效值包括:
- addresses
- ageRanges
- 传记
- 生日
- calendarUrls
- clientData
- coverPhotos
- emailAddresses
- events
- externalIds
- 性别
- imClients
- 兴趣
- locales
- 位置
- memberships
- 元数据
- miscKeywords
- names
- 昵称
- 职业
- organizations
- phoneNumbers
- 照片
- 关系
- sipAddresses
- skills
- 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 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-08-06。
[[["易于理解","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-08-06。"],[[["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."]]],[]]