5

i need help to get facebook user's email. here's what I did.

https://graph.facebook.com/me?scope=email&access_token=xxxxxxxxxxxxxxxx

the result I got back has no email in it.

            {
               "id": "7027110",
               "name": "John Mike",
               "first_name": "John",
               "last_name": "Mike",
               "link": "http://www.facebook.com/john.mike",
               "username": "john.mike",
               "location": {
                  "id": "11241875545",
                  "name": "Oakland, New Jersey"
               },
               "gender": "male",
               "timezone": -5,
               "locale": "en_US",
               "verified": true,
               "updated_time": "2011-12-07T16:53:47+0000"
            }

also tried to change scope=email to fields=email, still does not work. whats missing, please help me out

qinking126
  • 11,385
  • 25
  • 74
  • 124
  • I don't think you're meant to be able to get that information. It's not available to normal users. It'd also lead to severe spam issues. – Polynomial Dec 08 '11 at 16:43
  • It could be that they just don't have a public email :( here try this: `https://graph.facebook.com/me/fql?access_token=&q=select%20name,email%20from%20user%20where%20uid=me()` or `https://graph.facebook.com/me/fql?access_token=&q=select%20name,email%20from%20user%20where%20uid%20in%20(select%20uid2%20from%20friend%20where%20uid1%20=me())` – Brian Colvin Dec 08 '11 at 16:49
  • whatever I did is correct. however, I didnt have permission to query user's email. In order to do that. the first time user login, i need to ask htem to give me permission. – qinking126 Dec 08 '11 at 18:01

3 Answers3

7

You can get user email like this: https://graph.facebook.com/v2.5/me?fields=id,name,email more detail go here

nguyên
  • 5,156
  • 5
  • 43
  • 45
1

The user has to authorize you to get this information first. If it were possible, we would be receiving 100 times more spam than we already receive.

This Facebook tool can help you.

neves
  • 33,186
  • 27
  • 159
  • 192
1

Did you obtain the email extended permission from the user? You can check which permissions your access token has been granted with a call to /me/permissions

Igy
  • 43,710
  • 8
  • 89
  • 115