0

I'm trying to retrieve a single post to comment on it. I'm using the gem koala on, rails, but even setting the version of api to 2.0 (I checked on Koala.config.api_version), it returns the error "Koala::Facebook::ClientError: type: OAuthException, code: 12, message: (#12) singular statuses API is deprecated for versions v2.4 and higher [HTTP 400]"

Does anyone knows how to fix it? Thanks

Ronan Lopes
  • 3,320
  • 4
  • 25
  • 51
  • Did you search for the same [error](http://stackoverflow.com/questions/31353591/how-should-we-retrieve-an-individual-post-now-that-post-id-is-deprecated-in-v) – Pavel Bulanov Jun 08 '16 at 15:35
  • Yeah, but using the api v2.0 it should work, Problem is that it looks like it is requesting as api > 2.4. Anyway, with another method it worked. Thanks! – Ronan Lopes Jun 09 '16 at 14:50

2 Answers2

0

Got it. With the method put_comment("post_id", {}, api_version: "v2.0") it worked

Ronan Lopes
  • 3,320
  • 4
  • 25
  • 51
0

You could also set the API version in an initializer:

config/initializers/koala.rb

Koala.configure do |config|
  config.api_version = "v2.0"
end
cenanozen
  • 1,130
  • 18
  • 29
  • Won’t do any good any more though, since API v2.0 isn’t available any more since over three years by now. So adding this answer on _this_ topic now is kinda pointless. – CBroe Jun 21 '18 at 09:51
  • @CBroe yes, but it shows that you can set a global API version. I've just did this to use 2.12 – cenanozen Jun 21 '18 at 11:39
  • Doesn’t change the fact that this won’t fix any “singular statuses API is deprecated for versions v2.4 and higher” error now - going back _below_ API version 2.4 isn’t possible for _any_ app any more now. – CBroe Jun 21 '18 at 11:44
  • @CBroe I have apps that run perfectly at 2.10. The error you mentioned might be about a particular API – cenanozen Jun 21 '18 at 11:51
  • _“I have apps that run perfectly at 2.10”_ - good for you, but has absolutely nothing to do with the problem in question here. The way posts are accessed has changed with API v2.4 - so explicitly setting the API version to something below 2.4 might have helped _at the time_ this question was asked - but now no version below 2.4 is available any more, so setting the API version would not be able to fix the problem OP had here for anyone at this point. – CBroe Jun 21 '18 at 11:56