facebookarchive / php-graph-sdk

The Facebook SDK for PHP provides a native interface to the Graph API and Facebook Login. https://developers.facebook.com/docs/php
Other
3.18k stars 1.96k forks source link

No email returned #1068

Open ndvbd opened 6 years ago

ndvbd commented 6 years ago

When I do this:

https://graph.facebook.com/USER_ID/permissions?access_token=THE_TOKEN

I get:

{
   "data": [
      {
         "permission": "email",
         "status": "granted"
      },
      {
         "permission": "public_profile",
         "status": "granted"
      }
   ]
}

However when I do:

https://graph.facebook.com/USER_ID?fields=email&access_token=THE_TOKEN

I don't get the email. How facebook did such a simple thing so complicated?

Why?

tolbon commented 6 years ago

Why is so complicated ... cause spammer ?

ndvbd commented 6 years ago

Yes, of course its not me, it's for a user that is using an application, and its access token is valid and has the "email" permission. It's an API called from a server, to facebook's servers. So I want to supply a user id and an access token.

yguedidi commented 5 years ago

@nadavb maybe try the debug mode and log the response?