I'm trying to automate Ad and Creative creation across a number of accounts. Some of these accounts will be empty, with no existing Campaigns/AdSets/Ads/Creatives.
With a given ad_account_id
, is there any way pull all associated page_ids
?
If not, is there any way to pull all page_ids
associated with my user?
In the UI I have 79 page options when I create an ad, but when I try to get_pages()
, nothing is returned:
In [11]: me = objects.AdUser(fbid='me')
In [12]: pages = me.get_pages()
In [13]: len(pages)
Out[13]: 0
Both Ad Accounts and Pages are associated with a person (or a System User). You can create ads for any Page in any of your Ad Accounts.
To list all the Pages associated with your user_id, you need manage_pages
permission in your token. That's probably what you're missing. You can try it on Graph Explorer: me?fields=accounts
For more info, check: https://developers.facebook.com/docs/graph-api/reference/user/accounts/
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.