问题
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:
- For the authenticating user (ie the one who has granted your application access to their profile) and only when you explicitly request that permission.
- 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