如何在节点js下使用googleapis获取完整的个人资料信息?

时间:2018-06-19 04:22:36

标签: node.js rest google-api gmail-api

我尝试使用googleapi @ 27获取个人资料信息,但它只给了我以下字段。

{ 
  emailAddress: 'jainshravan321@gmail.com',
  messagesTotal: 2122,
  threadsTotal: 2111,
  historyId: '116715' 
} 

我在上面尝试了这个(https://developers.google.com/gmail/api/quickstart/nodejs?authuser=1)示例。我需要像firstname, lastname, email address, contact number & all of the fields available in user's profile这样的所有字段。那么你知道我将使用节点js下的googleapi获取用户配置文件的所有字段。

1 个答案:

答案 0 :(得分:1)

Users: getProfile

  

获取当前用户的Gmail个人资料。

用户gmail个人资料由

组成
{
  "emailAddress": string,
  "messagesTotal": integer,
  "threadsTotal": integer,
  "historyId": unsigned long
}

您正在寻找的信息不属于Gmail API。 gmail api是一个邮件系统,它不是用户配置文件系统。您应该尝试查看People api或google + api。

People api基本上与谷歌联系人相关联,因此如果用户未填写此信息,您将无法收回。 Google+ api与google plus社交媒体网站相关联。如果用户没有公开信息,例如电话号码,您将无法看到它。

没有真正好的方式来获取这些信息。

更新:经过大量谷歌搜索后,看起来人们和谷歌+的呼叫现在是相同的端点。但数据来自Google+和联系人。

相关问题