发布到供稿时出错:“用户未授权应用程序执行此操作" [英] Error while posting to feed: "The user hasn't authorized the application to perform this action"

查看:121
本文介绍了发布到供稿时出错:“用户未授权应用程序执行此操作"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从url在我的Facebook上发布供稿时出现错误:

I'm getting error while posting a feed on my facebook from url:

(#200) The user hasn't authorized the application to perform this action

我正在使用

https://graph.facebook.com/me/feed?name=hello&message=hello_from_url&access_token=access_token

作为我的URL.我正在创建需要其范围参数的Rails应用程序,以便可以从Rails应用程序发布到时间轴上,但是我无法找到确切的解决方案.

as my URL. I'm creating a rails app for which I need scope parameter so that I can post on my timeline from rails app but I'm unable to find out the exact solution.

推荐答案

第一件事是向该发布URL添加scope参数是无用的,根据在身份验证"对话框上.

First thing is that adding scope parameter to this posting URL is useless, permissions are set on first use of app depending on the permissions definded in the scope on auth dialog.

您的应用程序需要publish_actions权限才能发布提要.而且,如果您将此权限添加到配置中,则必须再次验证您的应用程序才能接受新权限.

Your application needs publish_actions permission to post feed. And if you add this permission to config you have to authenticate to your app again to accept new permissions.

使用图形API资源管理器来检查一切是否正常.从右上角的下拉列表中选择您的应用程序,将方法更改为 POST 并粘贴me/feed?name=hello&message=hello_from_url.然后运行它,检查是否有此异常.点击获取访问令牌以检查您授予应用程序的权限.

Use Graph API Explorer to check if everything is fine with this. Select your application from dropdown in the top right corner, change method to POST and paste me/feed?name=hello&message=hello_from_url. Then run it and check if you have this exception or not. Click Get Access Token to check permissions you granted your app.

顺便说一句,如果您不使用Feed,则可以使用 fb_graph 发布供稿:

And BTW, you can use fb_graph to post feed, if you're not using it:

me = FbGraph::User.me(access_token)
 me.feed!(
    :message => '',
    :link => '',
    :name => '',
    :description => ''
  )

这篇关于发布到供稿时出错:“用户未授权应用程序执行此操作"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆