首页 > 解决方案 > FB 营销 API 更新广告素材时出错

问题描述

我正在使用 Facebook 营销 API 来更新广告,但我遇到了错误。

{"error":{"message":"无效参数","type":"OAuthException","code":100,"error_subcode":1815573,"is_transient":false,"error_user_title":"更新失败creative","error_user_msg":"未能更新广告素材 6,060,290,455,919。请指定名称、状态或关联的广告标签以更新广告素材。","fbtrace_id":"AZj1cjgCsX7DcTVUvMLJCo-"}}

我的代码是:

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());
        }

标签: facebookfacebook-php-sdkfacebook-marketing-api

解决方案


推荐阅读