Jordan Lane
Jordan Lane

Reputation: 106

Can't post status as a page using page token

I have set-up a Facebook page and I'm trying to use a Facebook app to post as the page on the page itself.

Using the user token I have got the page access_token and confirmed it has permissions defined in the perms array e.g.

"perms": [
   "ADMINISTER",
   "EDIT_PROFILE",
   "CREATE_CONTENT",
   "MODERATE_CONTENT",
   "CREATE_ADS",
   "BASIC_ADMIN"
 ]

As far as I can see in the documentation the required permissions are manage_pages and publish_pages, both of which are granted as can be seen using the /{user_id}/permissions endpoint.

{
  "data": [
    ...
    {
      "permission": "email",
      "status": "granted"
    },
    {
      "permission": "manage_pages",
      "status": "granted"
    },
    {
      "permission": "publish_pages",
      "status": "granted"
    },
    ...
  ]
}

I've also checked using the access token debugger which confirms the token is valid and has the following scopes:

user_friends, read_page_mailboxes, email, manage_pages, publish_pages, public_profile

If I then do a call using the page access_token to the page, I can see the extra information available to admins, including "can_post" being set to true, however when I do a POST request to post to the feed for example using POST /{page_id}/feed?access_token={page_access_token} it returns:

{
  "error": {
    "message": "(#200) The user hasn't authorized the application to perform this action",
    "type": "OAuthException",
    "code": 200,
    "fbtrace_id": "CQqJd1hfnMm"
  }
}

Any help would be appreciated at this point!

Upvotes: 0

Views: 230

Answers (2)

Jordan Lane
Jordan Lane

Reputation: 106

The answer turned out to be an issue with the API version being used, forcing the endpoint to use v2.3 or above fixed the issue as manage_pages was only introduced then. Unfortunately the error wasn't very descriptive about this!

Upvotes: 1

You need to get "publish_pages" permission from your app.

Upvotes: 1

Related Questions