0

Using the PHP SDK, i'm trying to get post_impressions for specific posts. I've set a valid default access token using setDefaultAccessToken(), and then im trying:

$request = $fb>get("/$post_id/insights/post_impressions");
$graphEdge = $request->getGraphEdge();
var_dump($graphEdge);

I've also tried to prepend $page_id followed by underscore to the $post_id in the request, as explained here, but no luck.

The response i get from the request above is an object with protected properties with my app_id, secret_id, my request method.

No data about the post though.

Any ideas on what im missing out here?

Community
  • 1
  • 1
SuperHans
  • 1
  • 1
  • 2
  • 1
    First of all, you should use Graph API Explorer to see if that request returns any data at all. (Select your own app in GAE, and use the same access token that gets used in your script.) – CBroe Oct 21 '15 at 10:17
  • @CBroe That gives me an object consisting of an empty data array and a 'paging'-object with previous and next url:s. – SuperHans Oct 21 '15 at 10:33
  • Any debug messages in GAE? Does your access token include the necessary permissions to read insights? – CBroe Oct 21 '15 at 10:45
  • I just tried with another post_id in GAE and that one returned the value. Not sure why the 2 id's i previously had tried just returned an empty array! But anyway, seems to be working when using those id's from my SDK aswell. Thanks for your help! – SuperHans Oct 21 '15 at 11:28

0 Answers0