Facebook营销API错误,您必须选择一个对象进行推广
问题描述:
我试图通过Facebook图形API创建广告。我成功地创建了广告系列,广告集和广告素材。尝试制作广告时,它会给我提供以下错误信息。Facebook营销API错误,您必须选择一个对象进行推广
{"error"=>{"message"=>"Invalid parameter", "type"=>"OAuthException", "code"=>100, "error_subcode"=>1487930, "is_transient"=>false, "error_user_title"=>"You Must Select an Object to Promote", "error_user_msg"=>"Your campaign must include an ad set with a selected object to promote related to your objective (ex: Page, URL, event). Please update your ad set to continue.", "fbtrace_id"=>"BVtDHG2rTNn"}}
我做了一个POST
呼叫端点https://graph.facebook.com/v2.7/act_XXXXXXX/ads
,具有以下PARAMS:
{:name=>"Buy new Item", :object_story_spec=>{:link_data=>{:call_to_action=>{:value=>{}, :type=>"LEARN_MORE"}, :name=>"Buy new Item", :message=>"amazing Items for you", :image_hash=>"7cc87683d1b75492622a82a158790dcb", :link=>"www.xyz.com"}, :page_id=>"123123123"}, :access_token=>"xxxxxxxxxxxxxxxxxxxx"}
谁能帮助我的问题吗?
答
如果Ad对象创建期间没有提供AdCreative id,则也会抛出此错误。
您正试图将AdCreative params发布到Ad端点。
curl \
-F 'name=My Ad' \
-F 'adset_id=<AD_SET_ID>' \
-F 'creative={"creative_id":"<CREATIVE_ID>"}' \
-F 'status=PAUSED' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v2.8/act_<AD_ACCOUNT_ID>/ads