我想通过电子邮件地址接收此人的名字和姓氏。我该怎么做呢?我想使用 Google Plus 的 API,但 Google 正在关闭它。还有什么其他选择?
您可以尝试使用People API。该 API 有一个
people.get
方法,该方法返回 Resource: Person。
{
"resourceName": string,
"etag": string,
"metadata": {
object(PersonMetadata)
},
"locales": [
{
object(Locale)
}
],
"names": [
{
object(Name)
}
],
...
"emailAddresses": [
{
object(EmailAddress)
}
],
...
}
字段
names
将返回对象 Name
,其中包含以下字段:
{
"metadata": {
object(FieldMetadata)
},
"displayName": string,
"displayNameLastFirst": string,
"familyName": string,
"givenName": string,
"middleName": string,
"honorificPrefix": string,
"honorificSuffix": string,
"phoneticFullName": string,
"phoneticFamilyName": string,
"phoneticGivenName": string,
"phoneticMiddleName": string,
"phoneticHonorificPrefix": string,
"phoneticHonorificSuffix": string
}