Search code examples
rubyfacebook-graph-apiruby-on-rails-4koalakoala-gem

Reading comments for a FB post with Koala gem with Rails 4


I have a rails4 app, from which I can put a wall post to logged in users facebook wall. Now what I want to do is read the FB comments for that given post and show then in my application.

I'm using Rails 4 and koala gems. Following is my code

Koala::Facebook::API.new(<user.oauth_token>).get_object("<facebook post id>") but I'm keep on getting this error.

{ "error": { "message": "Unsupported get request. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api", "type": "GraphMethodException", "code": 100 } }

And I cannot see any mismatching in the API, strange thing is I remember I'm using the same code about 3-4 weeks back and If I remember correctly it was working fine that time,

it seems like its not an authentication problem because, If I use

Koala::Facebook::API.new(<user.oauth_token>).get_object("me") it works fine.


Solution

  • You will get the GraphMethodException Unsupported get request. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api when the user access token you specified does not have access to the Facebook object you are requesting. Here is a bug report with more specifics:

    https://developers.facebook.com/bugs/1418832665047223/