发布到没有“manage_pages”的Facebook页面使用php的权限 [英] Post to a facebook page without "manage_pages" permission using php

查看:97
本文介绍了发布到没有“manage_pages”的Facebook页面使用php的权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含博客文章的网站。我们需要将博客自动发布到Facebook页面。 Curently我可以发布到我的时间表。但我不能发布到Facebook页面。我在谷歌搜索很多代码说我们需要manage_pages权限。 *我的应用程序,Facebook页面在同一个帐户。我已经提交了manage_pages批准。他们表示,由于您是应用程序和Facebook页面的管理员,您可以将其发布到您的页面,而无需管理页面权限。但是我总是收到#200错误。他们的回复是您不需要请求这些权限,因为您的博客或CMS与您管理的应用程序集成在一起。作为应用程序管理员,您可以已经访问这些权限,并发布到您的时间轴或您管理的页面。可以通过将其添加为应用程序的开发人员来提供对其他用户的访问权限。我需要代码发布到没有manage_pages权限的facebook页面,因为他们解释了

解决方案

使用Graph API请求一个新的用户访问令牌Explorer(包含 manage_pages 权限,最终与 publish_pages 一起使用)。确保使用您自己的应用程序,因为您要将生成的(短命)访问令牌交换为长期存储令牌:



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

  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} 

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



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

  https://developers.facebook.com/tools验证生成的令牌/ debug / accesstoken?q = {generated_pa​​ge_token} 


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

解决方案

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:

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).

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}

这篇关于发布到没有“manage_pages”的Facebook页面使用php的权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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