使用Graph API检索电子邮件 [英] Retrieve email using Graph API
问题描述
我正在使用通过以下API检索的应用程序登录访问令牌 -
I am using app login access token retrieved through following API -
https://graph.facebook.com/oauth/access_token?client_id= & client_secret =& grant_type = client_credentials
https://graph.facebook.com/oauth/access_token?client_id=&client_secret=&grant_type=client_credentials
如果公开使用Graph API,我可以检索任何用户的电子邮件地址(主要电子邮件,而不是Facebook电子邮件)?
Can I retrieve email address (primary email not the facebook email) of any user if it is public using Graph API?
谢谢
Lakhan
Thanks Lakhan
推荐答案
获取用户主要电子邮件的两种方式:
Two ways to get users primary email:
- 对于认证用户(即授予您的应用程序访问他们的个人资料的用户),并且只有当您明确请求该权限时,才能使用。
- 如果电子邮件明确地由某个任意用户无法通过您的应用进行身份验证,那么您也可以使用它。任何公开的可见信息,您可以通过Facebook.com看到,可以通过API平等访问。
要获得验证用户的电子邮件,当你首先请求oAuth对话框,您需要通过范围
与电子邮件
权限(以及您需要的任何其他权限) )。有关权限的更多信息,请参阅此处以及有关使用范围的更多信息这里。
For getting the authenticating users email, when you first request the oAuth dialog you need to pass a scope
with the email
permission (as well as whatever other permissions you require). See more about permissions here and more about using scope here .
当电子邮件可用时,可以找到在用户
有效载荷中,详细了解API请求和有效载荷 here 。
When the email is available it can be found in the User
payload, see more about the API request and payload here.
这篇关于使用Graph API检索电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!