cwollett
cwollett

Reputation: 66

Facebook App/Business settings needed to access API

I am having trouble getting ads information to return from the Facebook Ads API.

What I have done:

I am trying to use the Facebook Python Business SDK to get information about our campaign performance back from the API. When I go through the linked GitHub documentation, I hit a wall at the business side of things.

Authenticating - I can get my app id/secret and an access token. When I pass the following code in a python notebook:

from facebook_business.api import FacebookAdsApi
from facebook_business.adobjects.user import User

me = User(fbid='me')
list(me.get_ad_accounts())

I get an account_id/id pair that corresponds to the sandbox ad account created with the app.

If I try to look at the business via:

from facebook_business.api import FacebookAdsApi
from facebook_business.adobjects.business import Business

business = Business(<business_id>)
info_fields = ['name']
business.api_get(fields=info_fields)

This gives me he business name and id that I would expect.

If I go a step further and try to get an ad account ID via business.get_owned_ad_accounts() or even business.get_client_ad_accounts() I get an empty list as the return.

At this point I am stuck and not sure how to proceed. I am sure I have missing something in the settings that needs to be set up. Does anyone know the full set of steps to be able to use an App to look at Marketing API insights on a Business?

Upvotes: 0

Views: 109

Answers (0)

Related Questions