我想通过电子邮件地址接收此人的名字和姓氏。我该怎么做?我以为可以使用Google Plus的API,但是Google正在关闭它。还有什么其他选择?
答案 0 :(得分:0)
您可以尝试使用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
}