Facebook API Error: "User does not have sufficient administrative permission for this action on this page."
Asked Answered
P

2

12

I'm using a Facebook app (in development mode) to generate a page access token so that my personal web app can schedule/edit/delete posts on a Facebook fan page.

I'm using the Graph Explorer to generate the token while logged in as the admin of the fan page.

When I use that token, I'm able to GET a list of the scheduled posts, but whenever I try to edit or delete a post, I get this error:

"User does not have sufficient administrative permission for this action on this page."

Here is the debug of the token:

enter image description here

Any ideas on how to fix this?

Pindaric answered 6/10, 2016 at 15:59 Comment(2)
Sounds like the user does not have the necessary admin level on the page - this is something that needs to be fixed in the page settings.Harrison
I am the admin of the page. I can manually create, edit and delete scheduled posts within Facebook.Pindaric
E
0

Here according to the documentation

DELETING YOUR POST

These are the permissions you need in the scope of your token.

  • To delete a user's post, a user access token with publish_actions permission is required.
  • To delete a Page's post a Page access token and publish_pages permission is required.
  • To delete a User's post on Page a Page access token is required.
  • To delete another User's post on a Page-owned event the user_managed_groups permission is required.

UPDATING YOUR POST

  • A user access token with publish_actions permission.

SO you need publish_actions permission within the scope of your token.

Update 1

Also check here if you have the valid page role

Endermic answered 16/10, 2016 at 18:20 Comment(5)
Correct me if I'm wrong, but I'm just trying to create/delete/update Page posts, so only publish_pages is required, which I already have.Pindaric
I also added publish_actions to the scope, but am still getting the same errorPindaric
Please update the screenshot which you get after adding publish_actions plugin,would be very helpful and can you also mention the error now which you get please? thanks.Endermic
yea i think you are right,it should have definitely worked,maybe you can try to add user access token too with publish_actions permission and also add user_managed_groups permission to itEndermic
I have tried all of those things. If you use a user token with publish_actions, it says you need a page token. I'm getting the same error.Pindaric
P
0

As per the latest documentation of the facebook graph api (https://developers.facebook.com/docs/graph-api/reference/v17.0/page/feed), We can call the following endpoint to create a post on the page. create your post by requesting the /{page-id}/feed endpoint of the selected page. You can find the delete and update endpoint here as well.

POST https://graph.facebook.com/v15.0/{page-id}/feed?access_token={page-access-token}

{page-id}: The id of the target page in the data list
{page-access-token}: The access_token of the target page in the data list
Request body: Post object in JSON format. Add {“message” : “your post”} to set the text. Add {“link” : “A URL”} to include an image or other media.
Header ‘Content-Type': 'application/json‘
Photomicroscope answered 4/7, 2023 at 12:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.