Facebook Ads API Error - Not Used To Use

So, I'm trying to create an application that uses the Facebook Ads API to get advertising costs and statistics. I created the application and added the identifiers of my account to the application, but I still get the error message:

"error":{"message":"(#274) The ad account is not enabled for usage in Ads API. Please add it in developer.facebook.com -> application -> settings -> advanced -> advertising accounts -> Ads API. Account XXXXXXXXXXXXX not enabled for application XXXXXXXXXXXXX.","type":"OAuthException","code":274}} 

Any bewilderment, why does it still give me this error? Or how can I go through this step.

+6
source share
3 answers

When using the creatives API in development mode, you need to specify the AdAccounts that you intend to use in the developer console.

See the following guide for more information: https://developers.facebook.com/docs/reference/ads-api/access#standard_accounts

+6
source

Let me give you a workaround that helped me. You need to go to your application, and on the added products tab in the left sidebar, click the Marketing API , click on the tools, on the right side, select the necessary permissions and get a token. Now use this token and pass it with a call to FB.api('POST'.. along with other parameters. You will no longer receive an error, and if you check your ad, you will have a new campaign or Adset, depending on what you are trying to create.

+2
source

I got this error # 274, and it started working after adding the test test desktop account ID ( in the Marketing API> Tools section) to the Ads API Account Configuration ( under Settings> Advanced> Accounts advertising ")). Before adding the test sandbox account ID, I added only my Ad ID account ID, which for some reason did not work.

Also, when I made Graph Graph API calls using the Graph API Explorer, the application selection window appears in the upper right corner of the screen. For some reason, he abandoned the "chart API" instead of the name of my application. Whenever I select the name of my application and generate a new user access token, I could make requests similar to the following:

 //Get the Ad name associated with an AD_ID https://graph.facebook.com/<API_VERSION>/<AD_ID>?fields=adset_id,campaign_id,name,account_id //Get the Adset name associated with an ADSET_ID https://graph.facebook.com/<API_VERSION>/<ADSET_ID>?fields=account_id,name //Get the Campaign name associated with a CAMPAIGN_ID https://graph.facebook.com/<API_VERSION>/<CAMPAIGN_ID>?fields=account_id,name 
0
source

Source: https://habr.com/ru/post/978311/


All Articles