2016-09-14 109 views
1

我試圖通過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"} 

誰能幫助我的問題嗎?

P.S.此SO question also faces the same problem on PHP SDK

回答

1

如果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 
相關問題