发布到没有“manage_pages”的Facebook页面使用php的权限 [英] Post to a facebook page without "manage_pages" permission using php
问题描述
使用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_page_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屋!