Possible Duplicate:
Facebook Graph API, how to get users email?
I am playing with Facebook API and trying to get available information from it.
$facebook = new Facebook(array('appId' => 'id', 'secret' => 'key'));
print_r($facebook->api('/my_username_or_id'));
which prints out:
Array ( [id] => my_id [name] => whole_name [first_name] => first_name [last_name] => last_name [link] => url_to_profile [username] => username [gender] => gener [locale] => es_LA )
But not email. When I go to Facebook developer test site and set up my username or ID, I get something like this:
{
"id": "id",
"name": "name",
"first_name": "first_name",
"last_name": "last_name",
"link": "link",
"username": "username",
"gender": "male",
"timezone": 2,
"locale": "en_US",
"verified": true,
"updated_time": "2012-07-16T13:00:04+0000"
}
Pretty similar information like in the first case.
But again - I cannot get the email address. I've tried also
print_r($facebook->api('/my_username_or_id?fields=email'));
and the same also on FB developer site, but again without success...
Is there any way to get email address from ID/username?