Reputation: 9
I've read several tutorials on how to make a Facebook post via Python API. Documentation on this link states that -
As of April 24,2018, the pubish_actions permission has been removed. Please see the Breaking Changes Changelog for more details. To provide a way for your app users to share content to Facebook, we encourage you to use our Sharing products instead.
Still followed the steps:
Attempting to Request publish_pages using Graph API Explorer tool leads to this error -
Invalid Scopes: publish_pages. This message is only shown to developers. Users of your app will ignore these permissions if present. Please read the documentation for valid permissions at: https://developers.facebook.com/docs/facebook-login/permissions
Attempted to create a post using the graph API request:
curl -i -X POST \
-d "url=https://www.facebook.com/images/fb_icon_325x325.png" \
-d "caption=test photo upload" \
-d "access_token=<user_photos_user_access_token>" \
"https://graph.facebook.com/v3.0/me/photos"
This request leads to the following error message -
This endpoint is deprecated since the required permissions manage_pages,publish_pages are deprecated
Now that publish_pages permission is deprecated, how do I publish a post as a Facebook page using API?
Upvotes: 1
Views: 2486
Reputation: 1441
You'll need to look into the newer API and permissions manage_pages
and publish_pages
which you can see in the docs here.
You need both these permissions to post as a page. Also you need to go through an app review process to get these permissions which is detailed on the pages docs.
Edit to answer additional question in comments: As it says in the linked docs, the tokens expire after an hour and you must request a new one. See bottom of tokens page.
Upvotes: 1