Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
293 views
in Technique[技术] by (71.8m points)

Post to a facebook page without "manage_pages" permission using php

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...