1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

cant manage to create ad via ad api - invalid parmeters??

Discussion in 'Facebook API' started by davidTimerman, Jan 7, 2015.

  1. #1
    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_*********');
    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
    davidTimerman, Jan 7, 2015 IP
  2. Gautamm Mehra

    Gautamm Mehra Greenhorn

    Likes Received:
    Best Answers:
    Trophy Points:
    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.
    Gautamm Mehra, Jan 25, 2015 IP
  3. airdomain

    airdomain Peon

    Likes Received:
    Best Answers:
    Trophy Points:
    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 ------------------


    $adgroup =newAdGroup(null, $account->id);
    AdGroupFields::CREATIVE => array('creative_id'=> $creative->id),
    AdGroupFields::NAME =>'My First AdGroup',
    AdGroupFields::CAMPAIGN_ID => $adset->id,
    AdGroupFields::ADGROUP_STATUS =>'ACTIVE',


    I need your advice. please.
    airdomain, Feb 23, 2015 IP