Facebook发布到Page Wall会出错

时间:2014-08-26 10:22:43

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

我在rails 3中使用koala gem。我使用以下answer来获取页面的永久访问令牌。我已经为此测试目的授予了此访问令牌的所有权限。

public_profile, basic_info, read_stream, read_mailbox, read_page_mailboxes, rsvp_event,
email, read_insights, manage_notifications, manage_pages, publish_actions, user_birthday, 
user_religion_politics, user_relationships, user_hometown, user_location, user_likes, 
user_activities, user_interests, user_education_history, user_work_history, user_website, 
user_groups, user_events, user_photos, user_videos, user_friends, user_about_me, 
user_status, user_games_activity, user_tagged_places, user_actions.books, 
user_actions.music, user_actions.video, user_actions.news

现在从rails控制台我执行以下操作:

access_token = "some_string"
@user = Koala::Facebook::API.new(access_token)
@attachment = {:name => "Link name", :link => "http://www.example.com/", :caption => "{*actor*} posted a new review", :description => "This is a longer description of the attachment"}
@user.put_wall_post("This is some text", @attachment)

该操作返回以下内容:

Koala::Facebook::ClientError: type: GraphMethodException, code: 100, message: Unsupported post request. [HTTP 400]

但我的页面墙确实显示了帖子。我想知道可能是什么问题?

1 个答案:

答案 0 :(得分:0)

事实证明我的应用程序未发布,因此所有调用都返回错误。更改应用程序状态导致解决问题。