Promoted Object Is Missing when creating a Creative on Facebook Marketing API

Viewed 4363

I'm trying to create a new ad creative with the following HTTP request

response = HTTParty.post(
        "https://graph.facebook.com/v2.9/act_#{account_id}/adcreatives",
        :query => {
            :ad_format => "DESKTOP_FEED_STANDARD",
            :access_token => @ads_access_token,
            :creative => {
                :object_story_spec => {
                    :object_id => page_id,
                    :link_data => {
                        :call_to_action => {
                            :type => ad_cta,
                            :value => {
                                :link => ad_url
                            }
                        },
                        :link => ad_url,
                        :message => ad_text,
                        :description => ad_description,
                        :name => ad_headline,
                        :picture => ad_image_url
                    },
                    :page_id => "233558376717908"
                }
            }
        }
    )

But unfortunately I keep on getting the following error:

{"error"=>
  {"message"=>"Invalid parameter",
   "type"=>"OAuthException",
   "code"=>100,
   "error_subcode"=>1487930,
   "is_transient"=>false,
   "error_user_title"=>"Promoted Object Is Missing",
   "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"=>"DpnhEGhLaSj"}}

I did set up a promoted object for the adset, but I don't understand what it has to do with the adcreative.

Thanks!

0 Answers
Related