facebook / facebook-ruby-business-sdk

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

`FacebookAds::ClientError: (#2) Service temporarily unavailable:` #68

Closed abankspdx closed 5 years ago

abankspdx commented 5 years ago

Which SDK version are you using?

0.3.3

What's the issue?

Getting FacebookAds::ClientError: (#2) Service temporarily unavailable: on every request, not seeing any services/outages on their website?

Steps/Sample code to reproduce the issue

    @app_id = ENV.fetch('FACEBOOK_ACCOUNT_ID')
    @app_secret = ENV.fetch('FACEBOOK_APP_SECRET')
    @access_token = fetch_token

    puts @access_token

    @ad_account = FacebookAds::AdAccount.get("act_#{@app_id}",
                                             'name',
                                             access_token: @access_token,
                                             app_secret: @app_secret)

    puts "Ad Account Name: #{@ad_account.name}"

Observed Results:

fetch_token Prints an auth token correctly, which implies that the Account ID and Secret are correct.

the @ad_account call gets the error reported above

Expected Results:

the Ad Account name to be printed

mhurst commented 5 years ago

I'm having this same issue,. what was your resolution?

abankspdx commented 5 years ago

@mhurst That error is returned for practically any reason (I have learned). In my case the issue was using the incorrect access token. But we were also getting it for requesting an Ad Account with the wrong ID.