Facebook Marketing API错误,您必须选择要升级的对象

时间:2016-09-14 12:23:20

标签: facebook facebook-graph-api

我正在尝试通过脸谱图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次调用,其中包含以下参数:

{: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 个答案:

答案 0 :(得分:3)

如果在广告对象创建期间未提供AdCreative ID,也会引发此错误。

您正尝试将AdCreative参数发布到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