I would like to use graph API to get page and app insights without Facebook JS SDK. I tried the following:
- I created an app with user A
- I log in to that app using the following url with user B (user B is admin of pages and apps)
https://m.facebook.com/dialog/oauth?client_id=[appID]&redirect_uri=[uri]&scope=read_insights,manage_pages&response_type=token
- Using the above url, login was ok, I got the access token
- Using https://graph.facebook.com/me/accounts I got the list of apps and pages
- Finally I try to query insights values with the following url https://graph.facebook.com/[page id]/insights&access_token=[login_response_access_token] but I got the following empty result:
{ "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
- Open above url
- Get access token (read_insights, manage_pages)
- https://graph.facebook.com/[page_id]/insights returns same empty JSON