facebook error Metric requires app admin privileges - facebook

I'm trying to access Facebook insights payments_daily_spend with the API with this url:
https://graph.facebook.com/v2.1/APPID/app_insights/payments_daily_spend?since=1403506800&until=1412146800&summary=true&date_format=U&access_token=ACCESSTOKEN
but all I'm getting back is
{
"error": {
"message": "(#3003) Metric requires app admin privileges",
"type": "OAuthException",
"code": 3003
}
}
The app access token I'm using was gotten with an account that has admin privileges for the app, and I can't seem to find any reference to this error anywhere. Has anyone seen this before or know what's wrong?

I finally got an answer by submitting a ticket to Facebook. You need an access token with the read_insights extended permission. You can get it from the Graph API Explorer, but there's probably an API call for getting such a token.

Related

Unable to access Instagram messages from Facebook Graph API Explorer

I am trying to access Instagram messages from the Facebook Graph API Explorer.
With v14.0 I make the GET call me/conversations?platform=instagram. I get the following error:
"error": {
"message": "(#298) Reading mailbox messages requires the extended permission read_mailbox",
"type": "OAuthException",
"code": 298,
"fbtrace_id": "Ad8l_IyomTnyotlNMG_HiS8"
}
}
However, there is no read_mailbox permission in the Graph API Explorer Permissions. I checked under App Review > Permissions and Features, and couldn't find the read_mailbox permission there either.
Note that this API call works in the video https://www.youtube.com/watch?v=Pi2KxYeGMXo&t=18s, where they are using API v12.0, and the read_mailbox permission isn't required for that.
How do I get the read_mailbox permission or work around it?
"message": "(#298) Reading mailbox messages requires the extended permission read_mailbox",
That permission existed in the early days of the API, when it was still possible to read the mailbox of a user account.
Since you are getting that message here, this indicates that you tried to use a user access token, instead of a page token. (What the alias me resolves to, depends on the access token.)

Why does facebook’s graph API return a permissions error when I try to get the “owner” of any facebook event that I am personally invited to?

I am using facebook's graph api. The access token I am using is the User's access token, (my personal access token). I am invited to these events personally. These events are public.
When I type /{eventid}/?fields=owner, I get
{
"error": {
"message": "(#200) Permissions error",
"type": "OAuthException",
"code": 200,
"fbtrace_id": "DcJaHySwF7S"
}
}
When I do /{eventid}/?fields=cover or most other fields it works just fine.
I am using the online graph tool v3.3 and tried it on v3.2 as well.
I have also tried this on curl on my personal terminal.
Below is the oath permissions I have set using the Graph API explorer.
Permission's Image
Since you cannot even get the list of Page Events right now (even if you own the Page), I assume it´s not possible: https://developers.facebook.com/docs/graph-api/reference/page/events/
This is a restricted edge. You cannot request access at this time.

Accessing an application page with facebook graph api

I'm trying to access a facebook page's conversations using the graph api.
Accessing the page itself (with /{page_id}) is fine, but I get on oauth exception for the conversations.
My request in the graph explorer is this one :
/{page_id}/conversations where {page_id} is, well, the page id :)
and the error is
{
"error": {
"message": "(#10) Application does not have permission for this action",
"type": "OAuthException",
"code": 10
}
}
According to the documentation, the required authorization is read_page_mailboxes, which I granted. Here are the rights of my token as shown in the oauth debugger :
public_profile, basic_info, read_page_mailboxes, manage_pages, user_friends
Are there other permissions I'm supposed to require ?
In fact, just asking for the permission itself is not the right way to access to this page informations.
You have to recover the page access token located at /{page_id}?fields=access_token and use this token in order to access the conversations.

Adding admin to fanpage

I have an app with advanced permission for fanpages.
I was wondering, is there any way possible to add an admin to a fanpage through any API?
It's not possible with regular apps, the app must be whitelisted.
{
"error":
{
"message": "(#100) App must be on whitelist",
"type": "OAuthException",
"code": 100
}
}
Graph api for page
only gives the documentation about fetching admins but there's nothing about adding new admins.
But this should work (though, it gives me "app should be on whitelist" error)
POST admin_id field with valid facebook id to
https://graph.facebook.com/<page_id>/admins,
with a valid page access token (not user access_token)

error OAuthException "message": "mailbox requires the read_mailbox extended permission."

I am getting this error while trying to access Facebook Graph api mailbox
https://graph.facebook.com/me/inbox?access_token=<access_token>
"error": {
"type": "OAuthException",
"message": "mailbox requires the read_mailbox extended permission."
The access token is valid.. But any hints on the permissions and where I am going wrong..
First, on logging in to Fb, it gives me a code and then access_token
Thanks for your help.
This is outdated, with the latest release(current version 2.6), you can't access private messages.
You need to grant your application the read_mailbox permission.
https://developers.facebook.com/docs/authentication/permissions/
Information on how you do that can be found here:
https://developers.facebook.com/docs/authentication/
At this time it is not possible to use the instagram API without an application authorization. The tutorials that teach how to use it through a token generated by the graph api do not work. For the application, you will first need to send some documents from your company, wait for validation, and then send advanced resource requests