Post to a facebook page without “manage_pages” permission using php

独自空忆成欢 提交于 2019-12-17 06:51:26

问题


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


回答1:


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}


来源:https://stackoverflow.com/questions/23907802/post-to-a-facebook-page-without-manage-pages-permission-using-php

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!