Tobias van Elferen Tobias van Elferen - 1 year ago 74
R Question

Admin role is not recognized in Facebook app in R with the Rfacebook package

I have created my first Facebook app in R. Its purpose is solely to retrieve marketing data from my Facebook pages. So far I have created this (no authentication problems):



## Start retrieving insight from VivaraDE
rawinsightsDE<-getInsights(object_id= "my_id", token = fb_oauth,
metric="page_impressions", period = "days_28", version="2.6")

When running this, R does return:

Error in FUN(X[[1L]], ...) :
No data available. Are you the owner of this page? See ?getInsights.

I have an administrator role in my app (obviously) and an admin role on the page desginated by

I suspect I will have to alter some config somewhere. What am I missing?

Answer Source

You need read_insights permission from the page admin (you in this case), before you can access these metrics.

Any more common permissions I need to include, so I won't stumble upon some more rejections?

Nah, don’t ask for permissions “just to be on the safe side” – that will only give problems in review (if the app is supposed to be used by the general public at one point?), if they see you asking for permissions without actually using them.

I’d rather suggest you use Graph API Explorer first to test out the request you want to make; its debug feature usually displays a message in such cases as to what permission is missing to get the requested data.