Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook Ads API Error - Not enabled for usage

So I have been trying to create an app that uses the Facebook Ads API to get ad costs and stats. I have created an app and added my ad account ids to the app settings but still get the error:

"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 idear why it would still be giving me this error? Or how I can get through this step.

like image 375
Mindy Horvy Avatar asked Nov 18 '14 01:11

Mindy Horvy


2 Answers

When using the Ads API in development mode, you need to specify the AdAccounts you are going to use in the developer console.

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

like image 123
Paul Bain Avatar answered Oct 20 '22 07:10

Paul Bain


Let me give you the workaround that helped for me . You have to go your app and in the added products tab on the left side panel click on Marketing API , click on tools, on the right side, select the permissions needed and get the token. Now use this token and pass it with the FB.api('POST'.. call along with the other parameters. You won't get the error anymore and if you check your advert you will have a new campaign or Adset whichever you are trying to create.

like image 29
rawatdeepesh Avatar answered Oct 20 '22 08:10

rawatdeepesh