Closed joshhornby closed 9 years ago
@joshhornby
The code on that documentation page has not been properly update yet. We are working on it. In the meantime, here is the right one:
use FacebookAds\Object\AdSet;
$adset = new AdSet('<AD_SET_ID>');
$adset->update(array(
AdSet::STATUS_PARAM_NAME => AdSet::STATUS_PAUSED,
));
To read the status:
use FacebookAds\Object\AdSet;
use FacebookAds\Object\Fields\AdSetFields;
$adset = new AdSet('<AD_SET_ID>');
$adset->read(array(
AdSetFields::CONFIGURED_STATUS,
AdSetFields::EFFECTIVE_STATUS,
));
Hope this helps
@pruno Perfect. Thanks for your help :)
I am trying to update the status on an
AdSet
- I am following the the official docs but I get the following error when trying to run the code:InvalidArgumentException in FieldValidation.php line 44 :status is not a field of FacebookAds\Object\AdSet
This is because the status field is not in the returned object, or in the
AdSetFields
class (https://github.com/facebook/facebook-php-ads-sdk/blob/master/src/FacebookAds/Object/Fields/AdSetFields.php)Can you let me know how I update the status on the
AdSet
?Thanks