Balajee Venkatesh
Balajee Venkatesh

Reputation: 1099

Pulling Facebook Page Insights using App Access Token (RestFB API)

It seems there is a problem in pulling the Page insights data I'm admin of using my App access token. I have been able to fetch my user and post related data but I'm geeting an 'OAuth Exception' (Invalid query) when I try to find my page insights. The same query works wonderfully when I try accessing insights using the 'User Access Token' generated by Graph API. As I want to generate an extended token and then pullung page-insights, that's why I'm try accessing data using App Access token. Please let me know what's wrong.

Upvotes: 0

Views: 466

Answers (1)

C3roe
C3roe

Reputation: 96306

Page insights simply aren't supposed to work with the app access token; you need to use a page access token, or a user access token from a page admin that has granted permission.

Go get yourself an extended page access token, as described here: https://developers.facebook.com/docs/facebook-login/access-tokens/expiration-and-extension

Those do not have a default expiry. (Although they may become invalid for other reasons, f.e. if the password of the user account that was used to request it gets changed.)

Upvotes: 1

Related Questions