-1

I'm very new in FB Graph and I want to get the attendings list of an event with, if possible, the email of each one. Now, after some work:

In the login script:

I set the "email" permission

$permissions = ['email']; // optional
$loginUrl = $helper->getLoginUrl('http://xxxx', $permissions);

In the callback:

I get attending list (but Name and Id only)

For each attending I call

$request = $fb->request('GET', '/'. $attending['id'].'?fields=id,name,email');
$response = $fb->getClient()->sendRequest($request);
$graphObject = $response->getGraphObject();
$email = $graphObject->getProperty('email');  // This is not getting any thing

But cannot get the email addresses.

Doing some tests I replaced the $attending['id'] withe 'me'_

$request = $fb->request('GET', '/me?fields=id,name,email');

and I got my email address.

Where I'm wrong?

Thanks for your answer.

Marcello

1 Answer 1

0

You can only get the email of a user who authorized your App with the email permission. There is no way to get the attendees including their emails - for obvious reasons, you would not be allowed to store or use their emails in any way without their explicit permission to do so.

2
  • Thanks, so I suppose is the same thing with addresses or any other personal attendees information.
    – Zeno
    Feb 18, 2016 at 15:46
  • of course, you need specific permissions for additional data. you can´t just grab those things even if they are public on facebook.com, you need permission from each user.
    – andyrandy
    Feb 18, 2016 at 15:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.