facebook / facebook-ruby-business-sdk

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

You are calling a deprecated version of the Ads API. Please update to the latest version: v10.0. #131

Closed davissp14 closed 1 year ago

davissp14 commented 3 years ago

Which SDK version are you using?

0.9.0.3

What's the issue?

API call fails with: You are calling a deprecated version of the Ads API. Please update to the latest version: v10.0.

Steps/Sample code to reproduce the issue

#!/usr/bin/env ruby

require 'facebookbusiness'
FacebookAds.configure do |config|
  config.access_token = 'redacted'
  config.app_secret = 'redacted'
end

ad_account = FacebookAds::AdAccount.get('act_redacted', 'name')
ad_account.campaigns(fields: 'name').each do |campaign|
  puts campaign.name
end

Observed Results:

Successfully sent report
Traceback (most recent call last):
    7: from test.rb:10:in `<main>'
    6: from /Users/davissp14/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/facebookbusiness-0.9.0.3/lib/facebook_ads/edge.rb:45:in `each'
    5: from /Users/davissp14/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/facebookbusiness-0.9.0.3/lib/facebook_ads/edge.rb:31:in `[]'
    4: from /Users/davissp14/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/facebookbusiness-0.9.0.3/lib/facebook_ads/edge.rb:64:in `fetch_next_page'
    3: from /Users/davissp14/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/facebookbusiness-0.9.0.3/lib/facebook_ads/ad_object.rb:132:in `block (2 levels) in <class:AdObject>'
    2: from /Users/davissp14/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/facebookbusiness-0.9.0.3/lib/facebook_ads/api_request.rb:48:in `execute'
    1: from /Users/davissp14/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/facebookbusiness-0.9.0.3/lib/facebook_ads/api_request.rb:53:in `execute_now'
/Users/davissp14/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/facebookbusiness-0.9.0.3/lib/facebook_ads/api_request.rb:67:in `create_response': (#2635) You are calling a deprecated version of the Ads API. Please update to the latest version: v10.0.:  (fbtrace_id: AFD9VUZUlucP7Znx-i5jrY9) (FacebookAds::ClientError)
VictorHom commented 3 years ago

subscribing to this issue. I ran into this issue using the facebookbusiness gem for the first time

lbelenda commented 3 years ago

adding config.api_version = "v10.0" worked for me

stale[bot] commented 2 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.

alanho commented 1 year ago

closing this for now. it seem this a caused by calling an deprecated version of the API. can be solved by upgrading to latest version of the SDK. the deprecation date of each version of the API is listed here: https://developers.facebook.com/docs/graph-api/changelog/