facebook / facebook-ruby-business-sdk

Ruby SDK for Meta Marketing API
https://developers.facebook.com/docs/business-sdk
Other
210 stars 159 forks source link

Invalid parameter: Ambiguous Promoted Object Fields #6

Closed ghost closed 4 years ago

ghost commented 7 years ago

I am getting this error, "Invalid parameter: Ambiguous Promoted Object Fields", when I try to create my ad. I have followed the code in the example you have provided. Here is my code for reference:

  #Create ad campaign
  campaign = ad_account.campaigns.create({
    name: params[:campaign_name],
    objective: 'LINK_CLICKS'
  })

  #Create adsets
  ad_set = ad_account.adsets.create({
    name: 'Test ad set' ,
    campaign_id: campaign.id,
    bid_amount: 1000,
    billing_event: 'LINK_CLICKS',
    daily_budget: 15000, #params[:daily_budget],
    targeting: {
      age_max: params[:age_max],
      age_min: params[:age_min],
      geo_locations: {
        countries: [
          "US"
        ]
      },
      publisher_platforms: [
        "facebook",
      ],
      facebook_positions: [
        "feed",
      ],
      instagram_positions: [
        "stream",
      ],
      device_platforms: [
        "mobile",
        "desktop",
      ],
    }            
  })

  #Create ad
  ad = ad_account.ads.create({
    status: 'PAUSED',
    name: 'Test ad set',
    adset_id: ad_set.id,
    creative: {
      object_story_spec: {
        page_id: page_id,
        link_data: {
          link: params[:link],
          message: params[:link_title],
          name: "Test",
          attachment_style: "link",
          call_to_action: {
            type: params[:call_to_action]
          }
        }
      },
      title: 'Test title',
      body: 'Test body',
      object_url: params[:link],
      image_file: '/images/vynil.jpg'
    },
    logo: '/images/vynil.jpg'
  })

Thank you!

ankitrg commented 7 years ago

I think object_url: params[:link] is causing the issue, not sure though.

aribouius commented 6 years ago

@OrrYakobiStudent did you ever find a solution for this? I'm running into the same problem.

stale[bot] commented 4 years ago

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 4 years ago

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.