Search code examples
facebookfacebook-graph-apifacebook-ads-api

How to retrieve facebook user's ads account id?


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?


Solution

  • 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/