Gagan
Gagan

Reputation: 61

Getting error during update ad creatives by FB marketing API

I am using Facebook marketing API for update adcreatives but I am getting below error.

{"error":{"message":"Invalid parameter","type":"OAuthException","code":100,"error_subcode":1815573,"is_transient":false,"error_user_title":"Failed to update the creative","error_user_msg":"Failed to update creative 6,060,290,455,919. Please specify name, status or associated adlabels for updating the creative.","fbtrace_id":"AZj1cjgCsX7DcTVUvMLJCo-"}}

My code is:

try{
            $object_story_spec = new AdCreativeObjectStorySpec();
            $object_story_spec->setData(array(
            AdCreativeObjectStorySpecFields::PAGE_ID => '<page_id>',
            AdCreativeObjectStorySpecFields::LINK_DATA => $link_data,
            ));
                   
            $creative = new AdCreative("<adcreativeid>");
            $creative->setData(array(
                AdCreativeFields::OBJECT_STORY_SPEC => $object_story_spec
            ));
            $creative->updateSelf();
        }catch (\FacebookAds\Http\Exception\AuthorizationException $e) {
            print_r($e->getResponse()->getBody());
        }

Upvotes: 1

Views: 805

Answers (1)

Seeni
Seeni

Reputation: 1606

Because update of those fields are not allowed. You can check the same in Developer Docs.

Only fields that can be updated are name,status,adlabels,account_id.

Upvotes: 1

Related Questions