1

I'm trying to publish on a page throught FB API (with curl), I give this commande with post method to curl : https://graph.facebook.com/my_Page_Id/feed?message=Helloworld!&access_token=MY_PAGE_TOKEN

I get the following error code :

        [message] => (#200) If posting to a group, requires app being installed in the group, and \
      either publish_to_groups permission with user token, or both pages_read_engagement \
      and pages_manage_posts permission with page token; If posting to a page, \
      requires both pages_read_engagement and pages_manage_posts as an admin with \
      sufficient administrative permission

        [type] => OAuthException

        [code] => 200

        [fbtrace_id] => probably not necessary
    )

If I entry this URL into my browser, i get an empty JSon string just like following. But the post isn't sent too.

{
   "data": [
      
   ]
}

My app is not reviewed, but it still in dev mode. So if i understand the doc well, it's supposed to don't require these permissions...

1 Answers1

0

My app is not reviewed, but it still in dev mode. So if i understand the doc well, it's supposed to don't require these permissions...

No, you did not understand that correctly.

This API call still needs the necessary permissions to be granted by the user (a page admin). This has nothing to do with dev vs live mode.


To be able to ask users for those permissions, when in live mode, you will need to submit your app for review and get it approved though.

And as long as you are in dev mode, any such posts you made via the API, will only be visible to people with a role in your app, they will be hidden from everyone else.

CBroe
  • 91,630
  • 14
  • 92
  • 150
  • First thanks. Ok, but i'm not able to find docs that explains correctly how to set these permissions for my Admin account. – JPLEMARABOUT Jul 22 '20 at 09:37
  • https://developers.facebook.com/docs/facebook-login/permissions/requesting-and-revoking – CBroe Jul 22 '20 at 09:42
  • If you don’t want to implement any actual login flow, then you can also use Graph API Explorer to grant the permissions to your app from within there. – CBroe Jul 22 '20 at 09:42