3

I have a question, I'm trying to post on a page with the token acquired from

https://graph.facebook.com/oauth/access_token? client_id=YOUR_APP_ID&client_secret=YOUR_APP_SECRET& grant_type=client_credentials

I guess the app has permission to post on that page, but when I try to post I get the following error

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

How do I verify the permission?

Basically, I want to be able to post to a page as a page without asking user to login, Would be great if someone can help me out!

apaderno
  • 28,547
  • 16
  • 75
  • 90
Quest Snd
  • 31
  • 2

1 Answers1

0

The token that you are acquiring is an App Access Token.

And to post on a page as a page itself, you need a page access token.

To get the page access token, you need to make the following API call with an access token with manage_pages permission:

/{page-id}?fields=access_token

this will give you the page access token for your pages. Use that and publish the post.

You can also have a never-expiring page access token. To get one follow this: What are the Steps to getting a Long Lasting Token For Posting To a Facebook Fan Page from a Server

Community
  • 1
  • 1
Sahil Mittal
  • 20,697
  • 12
  • 65
  • 90