qinking126
qinking126

Reputation: 11875

how to query facebook user's email using graph api?

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

Upvotes: 5

Views: 10738

Answers (3)

nguyên
nguyên

Reputation: 5316

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

Upvotes: 7

neves
neves

Reputation: 39153

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.

Upvotes: 1

Igy
Igy

Reputation: 43816

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

Upvotes: 1

Related Questions