简体   繁体   English

Facebook考拉宝石版本

[英]Facebook Koala Gem Version

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]" 我在轨道上使用gem koala,但即使将api的版本设置为2.0(我在Koala.config.api_version上进行了检查),它也会返回错误“ Koala :: Facebook :: ClientError:类型:OAuthException,代码: 12,消息:对于版本v2.4和更高版本[HTTP 400],不建议使用(#12)单一状态API”

Does anyone knows how to fix it? 有谁知道如何解决? Thanks 谢谢

Got it. 得到它了。 With the method put_comment("post_id", {}, api_version: "v2.0") it worked 使用方法put_comment(“ post_id”,{},api_version:“ v2.0”)可以正常工作

You could also set the API version in an initializer: 您还可以在初始化程序中设置API版本:

config/initializers/koala.rb

Koala.configure do |config|
  config.api_version = "v2.0"
end

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM