Reputation: 53
I am having issues figuring out how to get data from the graph api insights, I dont have sufficient rights to get any data returned. In the Graph API explorer I generated a new access token with the right to read insights but I dont know how to take it into use in php. I am currently trying to get the data as follows:
FacebookSession::setDefaultApplication('app_id', 'app_secret');
$session = FacebookSession::newAppSession();
$engagement = (new FacebookRequest(
$session, 'GET', '/page_id/insights/page_engaged_users'
))->execute()->getGraphObject();
Upvotes: 5
Views: 985
Reputation: 755
Hope this helps others too.... regarding Facebook access token and also in query How to handle access tokens with Facebook SDK v4.0 by Sammy Kaye Powers
Upvotes: 1