3

I'm trying to get budget per day and started with getting list of campaigns. I followed the instructions here https://developers.facebook.com/docs/marketing-api/sdks , but when it reaches this line

$my_adaccount = $me->getAdAccounts()->current();

It says: Fatal error: Uncaught FacebookAds\Http\Exception\AuthorizationException: (#2635) You are calling a deprecated version of the Ads API. Please update to the latest version: v2.9. in /home/jane/projects/facebook/vendor/facebook/php-ads-sdk/src/FacebookAds/Http/Exception/RequestException.php:163

So I updated to v2.9 but then it says that FacebookAds\Object\AdUser is not found. I added this class and other missing classes from v2.5 and it worked.

But there is another class missing, like use FacebookAds\Object\AdCampaign;

So the question is how can I install facebook sdk v2.9 with all classes, that needed? Like AdUser and AdCampaign?

Jane08
  • 127
  • 1
  • 14

1 Answers1

2

Many of the objects have been renamed to remove Ad from the start of their name.

So to fix this, just change AdUser to User, and AdCampaign to Campaign.

Paul Bain
  • 4,364
  • 1
  • 16
  • 30