In my app I want to create Facebook ads on behalf of a user. How do I discover via API if he has a FB Ads account and what's his Ads account id?
Provided your app has access to the Ads API and you have the ads_management
Permission you can retrieve the list of Advertising Accounts with a call to /<USER ID>/adaccounts
The response is an array of adaccount
objects, documented here: https://developers.facebook.com/docs/reference/ads-api/adaccount/
You can use the facebook graph explorer to discorever this informations. you must specify the fields to pass to the facebook graph explorer. Example :
https://graph.facebook.com/{user_id}?fields=id,name,adaccounts
Also you can find using this http://rubygems.org/gems/zuck to retrieve all adaccounts/ads/account_id that specific user, just remember that you must have sufficient permissions to read this information and also need a token that has not expired .
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With