Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 601
qinking126 Avatar asked Dec 08 '11 16:12

qinking126


2 Answers

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

like image 163
nguyên Avatar answered Sep 21 '22 07:09

nguyên


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

like image 23
Igy Avatar answered Sep 22 '22 07:09

Igy