【问题标题】:Facebook OAuthException, code: 1, An error occured while creating the share [HTTP 400])Facebook OAuthException,代码:1,创建共享时发生错误 [HTTP 400])
【发布时间】:2013-10-27 03:44:06
【问题描述】:

我正在 Rails 上构建一个 facebook 应用程序,并使用 koala gem 与 facebook api 进行交互。单击按钮对 vote.js.erb 进行 ajax 调用 vote.js.erb 中的以下代码

<%- current_voter.facebook.put_wall_post("Just a little post, thats all", "link" => "http://umedwar.herokuapp.com/candidates/1") -%>

抛出以下错误:

ActionView::Template::Error(类型:OAuthException,代码:1,消息:(#1) 创建共享时发生错误 [HTTP 400]):

这里提到了错误:https://developers.facebook.com/docs/reference/api/errors/,但我仍然不知道如何使它工作。请帮忙。

【问题讨论】:

    标签: ruby-on-rails facebook-graph-api koala


    【解决方案1】:

    您需要提供更多代码供他人真正诊断此问题。

    您是否像这样使用 current_voter 的 oauth_token 实例化 koala facebook 客户端:

    @graph = Koala::Facebook::API.new(current_voter.oauth_access_token)
    

    请参阅此处的考拉自述文件,其中向您展示了如何做到这一点。 https://github.com/arsduo/koala

    【讨论】:

    • 我知道我听起来很愚蠢,但同样的代码正在以某种方式工作。感谢您的及时回复。仍然有助于了解究竟是什么条件引发了此错误。
    猜你喜欢
    • 2016-02-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-12-23
    • 2012-09-17
    • 1970-01-01
    相关资源
    最近更新 更多