Retrieve email using Graph API

爷,独闯天下 提交于 2020-01-11 06:58:06

问题


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

Can I retrieve email address (primary email not the facebook email) of any user if it is public using Graph API?

Thanks Lakhan


回答1:


Two ways to get users primary email:

  1. For the authenticating user (ie the one who has granted your application access to their profile) and only when you explicitly request that permission.
  2. If the email is explicitly made public by some arbitrary user not authenticating with your app, then that will be available to you also. Any publically visable info you can see via facebook.com is equally accessible via the API.

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 .

When the email is available it can be found in the User payload, see more about the API request and payload here.




回答2:


Check the doc here : http://developers.facebook.com/docs/reference/api/user/

With the email argument, you will be able to get the email.



来源:https://stackoverflow.com/questions/7710282/retrieve-email-using-graph-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!