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.
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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With