-1

Possible Duplicate:
Facebook Graph API, how to get users email?

Well, in my application, I ask the user to grant permission for me to get his email ... let's say that he does ...

According to the code of API reference, the FB.getLoginStatus function returns a Json Object with the following contents:

{ status: 'connected', authResponse: { accessToken: '...', expiresIn:'...', signedRequest:'...', userID:'...' } }

So, assuming the user has accepted the terms, and granted permission for email to my app, where is the email value? It's in a new child in the FB.getLoginStatus response? Something like:

{ status: 'connected', authResponse: { accessToken: '...', expiresIn:'...', signedRequest:'...', userID:'...' userEmail:'....' } }

In PHP, I use something like that:

json_decode(file_get_contents('http://graph.facebook.com/SOMEIDHERE'))->name; (a resquest to graph.facebook.com, for example)

But it's not what i'm looking for.

Thanks for your attention.

Community
  • 1
  • 1

1 Answers1

1

In order to get the User data, you have to make an API call to:
http://graph.facebook.com/user_id and inside the response you will get the user email (if already approved the email permission).

Philip
  • 5,011
  • 2
  • 30
  • 36
  • It seems little bit confused to me. I need only the user Id? So any app that has the user id can access the information from the User? I need not inform a token, or the key of my application? – Eric Vieira Jan 04 '13 at 14:14
  • By default you can get only the public user data if you have an id. After a user approves the required permissions it's possible to access some private user data. You can test this here: https://developers.facebook.com/tools/explorer – Philip Jan 04 '13 at 20:05