0

As described in the marketing API, I have registered an app got my app key and and id, generated a token with ads permissions, list pages permission as well. The app is not yet submitted for approval.

When I try to get the list of ad accountsz linked to 'me' it returns the array of all ad accounts.

But when I select any of the business accounts (other than my personal Facebook account) and try to retrieve the ads insights API throws exception saying: but when I try to get the insights, using the python SDK, I get the same error, ex: (#273) This Ads API call requires the user to be admin of the ad account. User is not admin on ad account .

What is surprising is when I use the similar sample page from Facebook-Developers to get insights, it is able to retrieve the ads data for the same account, with my own login itself. Why would my app be unable to do so? Is there any such limitation for apps not reviewed?

Update: I seem to have admin access to the ad account as well. Here are some screenshots. (Unless its my dumb day I think something else is going on, but its my fist time with an API like this, so I cant be sure!;) )

Screenshots: GraphAPI Explrer with API call, App Settings, AdAccount Settings

NikhilWanpal
  • 2,960
  • 3
  • 23
  • 40
  • https://developers.facebook.com/docs/marketing-api/access#limits – CBroe Jul 06 '17 at 07:54
  • @CBroe thanks for the comment, i have the development level right now. but insights API says I need access to ads_management and ads_read, not business_management. Or is there something else I am missing in that link? Does the description under basic also mean that these permissions are available only to basic level? – NikhilWanpal Jul 06 '17 at 07:59
  • What part of “API calls from app admins or developers and on behalf of ad account admins or advertisers” is unclear? – CBroe Jul 06 '17 at 08:04
  • I knew in my mind it must be something stupid, but I'll be honest, it was not clear to me. But I understand now what it means. Thank you for pointing it out. – NikhilWanpal Jul 06 '17 at 09:22
  • @CBroe Wow, when I go to the ad-account settings (business settings -> add accounts --> people), turns out I am listed as an 'ad account admin'. Is there anything else causing this then? – NikhilWanpal Jul 06 '17 at 11:07
  • And that is also the ad account you are trying to request data for in your app? – CBroe Jul 06 '17 at 11:30
  • Yes.. Verified again when you asked. Have updated the question with some screenshots showing the accesses. – NikhilWanpal Jul 06 '17 at 11:59
  • Well what it says in red color in your third screenshot in the adaccount settings is probably not just red because they wanted to add a splash of color, hm? _“This ad account is inactive. Please go to your ads manager to reactivate your account.”_ – CBroe Jul 06 '17 at 12:11
  • Thank you for pointing out, I did not bother with it because the facebookmarketingdevelopers sample went through and made the API call anyway. But what you are saying makes sense, that looks like the only thing out of place, let me try fixing it. – NikhilWanpal Jul 06 '17 at 12:21

1 Answers1

0

Based on the discussion on question and experience I now have:

  • API user needs to be an admin of the ad account and of the app if you wish to use the API.
  • The ad account needs to be specifically added to the app, in app settings. In developer access an app can only have access to a maximum of 5 ad accounts.
  • Error messages in Facebook API are misleading more often than not. Fix anything marked in yellow or red anywhere in the portal, to be sure.
  • Do read about limits of every API before you use it, all API have different limits and your application design needs to take those into account.

As for the question, yes the issue was the text in red, as pointed out by @CBroe, although the error message was off by a mile and issue occurred only when using our own app.

NikhilWanpal
  • 2,960
  • 3
  • 23
  • 40