简体   繁体   English

拉出用户的Google+或Gmail联系人列表及其电子邮件地址

[英]Pull a user's Google+ or Gmail list of contacts and their email addresses

I'm building an app in which I'm trying to allow a user to log in through Google+ (currently using the Google API PHP Client Library) and pull their entire contact list in to decide if they want to send an email to their list from my app. 我正在构建一个应用,尝试允许用户通过Google+登录(当前使用Google API PHP客户端库)并拉入他们的整个联系人列表,以确定他们是否要向其列表发送电子邮件从我的应用程序中。 I can easily see how to allow the user to grant access to multiple permissions through different Google APIs through setting scopes. 我可以轻松地了解如何通过设置范围来允许用户通过不同的Google API授予对多个权限的访问权限。

I'm struggling to see either what scope I should be setting when making a request and/or what API should accomplish pulling a logged in user's contact list along with each contact's email address. 我正在努力查看在发出请求时应该设置什么范围和/或什么API应该完成提取登录用户的联系人列表以及每个联系人的电子邮件地址的工作。

Any help would be greatly appreciated. 任何帮助将不胜感激。

I found the answer, you have to pull contacts with an valid OAuth request through the Google Contacts API. 我找到了答案,您必须通过Google Contacts API通过有效的OAuth请求提取联系人。 On the documentation page for the Google Contacts API, Google says: Google在Google Contacts API的文档页面上说:

The Google Contacts API allows client applications to view and update a user's contacts. Google Contacts API允许客户端应用程序查看和更新​​用户的联系人。 Contacts are stored in the user's Google Account; 联系人存储在用户的Google帐户中; most Google services have access to the contact list. 大多数Google服务都可以访问联系人列表。

You can find the documentation here. 您可以在此处找到文档。

https://developers.google.com/google-apps/contacts/v3/ https://developers.google.com/google-apps/contacts/v3/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM