Unable to read advertisements via Koala::Facebook API

问题内容:

I have a Rails web app that allows the user to manage Ads from Facebook. This is done through the Koala API as followed:

graph = Koala::Facebook::API.new(access_token)

This method stopped working, and it is giving me this error:

Koala::Facebook::ClientError: type: OAuthException, code: 278, message: (#278) Reading advertisements requires an access token with the extended permission ads_read [HTTP 403]

Any advice please ?

问题评论:

答案:

答案1:

you need to have access token. You can get it with gem ‘fb_graph2’

Also you need to create a facebook app and get from that your id and secret_key

auth = FbGraph2::Auth.new(ENV["FACEBOOK_APP_ID"], ENV["FACEBOOK_APP_SECRET"])
graph = Koala::Facebook::API.new(auth.access_token!)

答案评论:

原文地址:

https://stackoverflow.com/questions/47755022/unable-to-read-advertisements-via-koalafacebook-api

Add a Comment