facebook / facebook-php-business-sdk

PHP SDK for Meta Marketing API
https://developers.facebook.com/docs/business-sdk
Other
836 stars 519 forks source link

Ad Creation Error #62

Closed gautamm20 closed 9 years ago

gautamm20 commented 9 years ago

Everything in the script works perfectly, except the last segment of ad group creation. I've spend two hours editing the parameters and also looked at the class parameters at /src/FacebookAds/Object/Fields/AdGroupFields.php

After trying every combination it still spits out the "Invalid parameter" error. Not sure why this is happening. Hope someone can shed light on this.

gautamm20 commented 9 years ago

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.

pruno commented 9 years ago

Hi @gautamm20,

thanks for flagging this issue, we have added support for the blame field spec in Request Exceptions: https://github.com/facebook/facebook-php-ads-sdk/commit/dee1f793a2c78d6dab4b4baa8315c522104e8c3f, i hope this will make debugging easier.