且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

发布到供稿时出错:“用户未授权应用程序执行此操作"

更新时间:2023-02-17 09:29:34

第一件事是向该发布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 => ''
  )