Reputation: 1193
I would like to use graph API to get page and app insights without Facebook JS SDK. I tried the following:
https://m.facebook.com/dialog/oauth?client_id=[appID]&redirect_uri=[uri]&scope=read_insights,manage_pages&response_type=token
{ "data": [ ], "paging": { "previous": "https://graph.facebook.com/[page_id]/insights?format=json&since=1329064393&until=1329323593", "next": "https://graph.facebook.com/[page_id]/insights?format=json&since=1329582793&until=1329841993" } }
What wrong with my steps? I tried to use Graph API Explorer and I cannot get insights values from the following url:
https://developers.facebook.com/tools/explorer
Upvotes: 5
Views: 2172
Reputation: 72
your first and second steps are true but the third one is wrong because in the url https://graph.facebook.com/[page_id]/insight there is no insight field on the node of your page_id like everyone I think. You can see the fields you are able to use on the right side of the Graph explorer.
May be the reason of the emptiness of insights could be FB.api returns empty datas for some days nowadays. you can test it by clicking show old insights in the page of your app. you will see.
Upvotes: 0
Reputation: 307
I'm presuming you have the correct access_token (which is probably the case given you ability to query the objectids). Does the objectid in question have data in the last month? Also, I would recommend supplying a date range (with the since and until parameters), this has caused me issues in the past.
Upvotes: 0