Reputation: 3766
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?
Upvotes: 5
Views: 6169
Reputation: 43816
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/
Upvotes: 6
Reputation: 384
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 .
Upvotes: 5