I am trying to get a list of the people attending/non attending an event that I have created, and I am struggling with using PHP SDK to do so.
This is the basic tutorial I have followed : https://www.webniraj.com/2014/05/01/facebook-api-php-sdk-updated-to-v4-0-0/ (used this to get the basic setup for setting permissions, creating a valid session and a test request to Graph API to get user data).
After that to access the RSVP List i tried to follow the facebook developer instructions(https://developers.facebook.com/docs/graph-api/reference/v2.0/event#publish) which tell you to do the following:
Any access token can be used to retrieve events with privacy set to OPEN.
A user access token can be used to retrieve any events that are visible to that person.
An app or page token can be used to retrieve any events that were created by that app or page
Here is my code snippet to do so :
$getattending = "/" . $event_id . "/attending?fields=name,id";
$req_events = new FacebookRequest($session, 'GET', $getattending);
$req_response = $req_events->execute();
$data_array = $req_response->getGraphObject()->asArray();
$counter = array_map("count", $data_array);
$count = $counter['data'];
echo "Attending: $count<BR>";
print_r($data_array);
Despite my efforts,I am getting a blank screen on my URL.(I have used heroku and AWS to set up a basic development enivronment.)
May someone please help me understand what am I doing wrong? Or help me debug my code as to see why I am getting a blanks screen each time.