Facebook Ads API via Javascript SDK - How to get ad accounts &campaigns for business manager account

Digital Marketing Facebook Marketing API 2 years ago

0 1 0 0 0 tuteeHUB earn credit +10 pts

5 Star Rating 1 Rating
_x000D_ _x000D_ I have an Angular 5 app where I need to grab some data from my ad accounts via a Business Manager account that I have been made an admin of. I'm having trouble figuring out which API documentation I need to follow and which endpoints to call. I'm just trying to figure out how to get data from the Graph API Explorer that Facebook provides and when I try something like this: /v2.12//adaccounts I get an error: { "error": { "message": "(#12) adaccounts field is deprecated for versions v2.11 and higher", "type": "OAuthException", "code": 12, "fbtrace_id": "AV2JHORP+bN" } } I have all the correct permissions set with my access token, though I'm not sure what to call to get that data. There are a lot of different API docs and I'm not sure which ones to follow. Has anyone run into this as well?

Posted on 16 Aug 2022, this text provides information on Facebook Marketing API related to Digital Marketing. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Answers (1)

Post Answer
profilepic.png
manpreet Tuteehub forum best answer Best Answer 2 years ago
_x000D_ I recently wrote a blog post explaining in-depth how to do this, and here is a brief overview: Ad Accounts Owned by Your Business To get the list of ad accounts that your Business account owns, you can make a call to the following URL: ///owned_ad_accounts Read more at: https://developers.facebook.com/docs/marketing-api/businessmanager/assets Ad Accounts Shared to Your Business If you need to see the ad accounts that other Businesses have shared to your Business (i.e. you don't own them), it's a bit more difficult. The only way I've discovered so far is to add the ad accounts to a Project (documentation), then you can make the following call to get all Projects in your Business: ///businessprojects?fields=id,name Then for each Project, make this call to get all ad accounts in that Project: ///adaccounts?fields=id,name

No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.