6

I am trying to pull Facebook Ads metrics through the Facebook Marketing API. The flow is basically that I wish to pull all the account ids of my company, and then loop over them, retrieving the insights for them individually.

However I have an error which I am not able to solve/comprehend.

When I attempt to make the API call (both in the Graph Explorer and my Alteryx workflow):

GET-> /v2.8/act_<Account_ID>/insights

I get the following error:

 "error": {
"message": "(#3) Application does not have the capability to make this API call.",
"type": "OAuthException",
"code": 3,
"fbtrace_id": "BNevVWUExDg"
}

I must admit that I am quite at a loss what is causing this error...and actually also exactly what the issue is...am I lacking the right scope/permissions for my token?

With the same token I am able to correctly call the API to get a list of all adaccounts (GET-> /v2.8/me/adaccounts ).

Anyone have an idea what my issue might be?

ekad
  • 14,436
  • 26
  • 44
  • 46
caz777
  • 101
  • 1
  • 1
  • 6
  • I get this when I login on localhost with Facebook Login JS SDK with my test app, then get a token and try to read my own ad accounts. They my ad accounts, but I get this error nonetheless. I don't get this error when trying with my production app. – Alex Dec 28 '18 at 19:31

3 Answers3

7

You have to make sure that your particular access token has the permissions ads_management or ads_read.

This is from the Marketing API quickstart. https://developers.facebook.com/docs/marketing-apis

There are also rate limits on those API's, but I would expect a different error if that was the case.

Ben Gomez
  • 166
  • 2
  • I do have both those permissions on the tokens. I ran a POST instead of GET on the same endpoints, which gives me another error about not being admin on the account. – caz777 Oct 20 '16 at 16:04
  • It appears that the user associated with the token (which is a long lived one) was only having analyst access to the account in Business Manager. After I changed it to advertiser it seems I can do the GET call – caz777 Oct 20 '16 at 16:05
  • 3
    So where do you set these permissions? – bart Jun 01 '17 at 01:04
2

I ran a POST instead of GET on the same endpoints, which gives me another error about not being admin on the account.

It appears that the user associated with the token (which is a long lived one) was only having analyst access to the account in Business Manager. After I changed it to advertiser it seems I can do the GET call.

caz777
  • 101
  • 1
  • 1
  • 6
2

In my case, I added a new development user in the roles page. Then I was trying to do OAuth. I got the error message "Application does not have the capability to make this API call."

Here's the way that I solve the problem while your application still in the development mode.

Go to Marketing API > Tools Then select what token permissions you want. Press "Get Token" button. Now, you can try to do OAuth again.