Hello everyone , hope this question is relevant here , ive just started using the ads api (with the php sdk) , i went through the "getting started" tutorial for creating an ad , everything goes smooth until the ad creation itself , $adgroup = new AdGroup(null, 'act_*********'); adgroup->create(array( AdGroupFields::CREATIVE => array('creative_id' => $creative->id), AdGroupFields::NAME => 'My First AdGroup', AdGroupFields::CAMPAIGN_ID => ******, )); at this point i get a response in the form of Uncaught exception 'FacebookAds\Http\Exception\AuthorizationException' with message 'Invalid parameter' ive searched and searched for why this might be happening , but nothing comes up ... any thoughts ? thanks in advance david
Finally found a solution! The Ad Group Status is now a required field. The exception handling errors at the graph API is way better than the SDK which is rather cryptic and leads of hours of wastage of time. By adding: AdGroupFields::ADGROUP_STATUS => 'ACTIVE' while creating the ad group, the operation was successful. You can of course replace ACTIVE with any of the other states such as PAUSED etc.
I have same problem when I create ad! With Facebook Ad Api, I can't create ad(group) although I have created the Campaign, AdSet, and AdCreative successfully. And I added the parameter, 'status', to my code according to yours, but I have same result. What's wrong??? ------------ PHP Codes ------------------ useFacebookAds\Object\AdGroup;useFacebookAds\Object\Fields\AdGroupFields; $adgroup =newAdGroup(null, $account->id); $adgroup->setData(array( AdGroupFields::CREATIVE => array('creative_id'=> $creative->id), AdGroupFields::NAME =>'My First AdGroup', AdGroupFields::CAMPAIGN_ID => $adset->id, AdGroupFields::ADGROUP_STATUS =>'ACTIVE', )); $adgroup->create(); I need your advice. please.