哪些 Facebook 权限允许发布到页面墙(不是个人资料墙)? [英] Which Facebook permissions allow for posting to a page wall (not profile wall)?

查看:31
本文介绍了哪些 Facebook 权限允许发布到页面墙(不是个人资料墙)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开展一个项目,将数据发布到 Facebook 页面的墙上.我已经设置了一个 Facebook 应用程序,并且当前在尝试发布到他们页面的墙上时向用户请求以下权限:

I am working on a project to post data to the walls of Facebook pages. I have set up a Facebook app and currently requesting the following permissions from user when attempting to post to their page's wall:

  • publish_stream
  • offline_access
  • manage_pages

代码当前成功发布到PROFILE的墙,但尝试发布到PAGE的墙时,返回以下错误:

The code currently posts to a PROFILE's wall successfully, but when trying to post to a PAGE's wall, the following error is returned:

Facebook 错误:(#200) 用户尚未授权应用程序执行此操作.

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

同样,我请求的权限显然足以发布到个人资料的墙上,但不能发布到页面的墙上.发布到页面的墙上我缺少哪些权限?在此先感谢您的帮助.

Again, I am requesting permissions which apparently are sufficient for posting to a profile's wall, but not to a page's wall. Which permission(s) am I missing for posting to a page's wall? Thank you in advance for any help.

推荐答案

这就是你要做的.首先,阅读有关扩展权限的文档.请注意,'manage_pages' 说:

here's what you do. First, read the documentation on extended permissions. Notice that 'manage_pages' says:

使您的应用程序能够检索用户管理的页面的 access_token.可以使用 Graph API 中的帐户"连接查询访问令牌.此权限仅与 Graph API 兼容.

Enables your application to retrieve access_tokens for pages the user administrates. The access tokens can be queried using the "accounts" connection in the Graph API. This permission is only compatible with the Graph API.

这意味着您必须根据来自

This means you have to switch your user's access token based on the response from the

https://graph.facebook.com/$USERID/accounts?access_token=$USER_ACCESS_TOKEN

为您的应用程序.因此,一旦您拥有页面访问令牌,请切换请求以发布您的消息,如下所示:

for your app. So once you have your PAGE ACCESS TOKEN, switch the request to post your message like such:

https://graph.facebook.com/$PAGEID/feed

在 postfields(使用 curl 或类似的东西)中,包含您的消息和 $PAGE_ACCESS_TOKEN

in postfields (using curl or some such), include your message and $PAGE_ACCESS_TOKEN

这篇关于哪些 Facebook 权限允许发布到页面墙(不是个人资料墙)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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