在没有“manage_pages"的情况下发布到 Facebook 页面;使用php的权限

问题描述:

我有一个包含博客文章的网站.我们需要自动将博客发布到 facebook 页面.目前我可以发布到我的时间线.但我无法发布到 facebook 页面.我在谷歌搜索过.许多代码说我们需要 manage_pages 权限.* 我的应用程序,同一帐户中的 Facebook 页面.我已提交 manage_pages 以供批准.他们说您可以在没有 manage_page 权限的情况下发布到您的页面,因为您是应用程序和 Facebook 页面的管理员.但我总是收到#200 错误.他们的详细回复是您不需要请求这些权限,因为您的博客或 CMS 与您管理的应用程序集成在一起.作为应用程序管理员,您已经可以访问这些权限并发布到您的时间轴或您管理的页面.您可以通过将其他用户添加为您的应用程序的开发人员来提供对其他用户的访问权限."正如他们所解释的,我需要在没有 manage_pages 权限的情况下发布到 Facebook 页面的代码

I have a website that contains blog post. we need to post blogs automatically to facebook page. Curently I could post to my timeline. But I could'nt post to facebook page. I've search in google. many code says we need manage_pages permission. * My App,Facebook page in same account. I have submitted manage_pages for approval. They said you could post to your page without manage_page permissions due to you are the administrator of app and facebook pages. But always I'm receiving #200 error. Their detialed reply is "You do not need to request these permissions because your blog or CMS is integrated with an app that you admin. As an App admin, you can already access these permissions and post to your Timeline or a page you admin. You can provide access to additional users by adding them as developers of your App." I need code for post to facebook page without manage_pages permissions as they explained

使用 Graph API Explorer 请求新的用户访问令牌(具有 manage_pages 权限,最终结合 publish_pages代码>).请务必使用您自己的应用之一,因为您想将生成的(短期)访问令牌交换为长期存在的访问令牌:

Request a new User Access Token by using the Graph API Explorer (with manage_pages permission, eventually in conjunction with publish_pages). Be sure to use one of your own apps, because you want to exchange the generated (short-lived) access token to a long-lived one:

从图表资源管理器的相应表单字段中复制新生成的用户访问令牌,打开一个新的浏览器选项卡并粘贴如下所示的 URL

Copy the newly generated User Access Token from the according form field from the Graph Explorer, open a new browser tab and paste a URL like the following

https://graph.facebook.com/oauth/access_token?grant_type=fb_exchange_token&client_id={your_app_id}&client_secret={your_app_secret}&fb_exchange_token={user_token_from_last_step}

这将创建一个长期存在的用户访问令牌.现在,将这个新的访问令牌从浏览器选项卡的内容复制到图表资源管理器(到访问令牌的相应表单字段中).

This will create a long-lived User Access Token. Now, copy this new Access Token from the browser tab's content to the Graph Explorer (into the according form field for Access Tokens).

现在,您可以使用此访问令牌调用 /me/accounts,您将收到您管理的页面列表.从列表中选择一个页面访问令牌,并通过

Now, you can call /me/accounts with this Access Token, and you'll receive a list of the pages you administer. Choose a Page Access Token from the list, and verify the generated token via

https://developers.facebook.com/tools/debug/accesstoken?q={generated_page_token}