user584397
user584397

Reputation: 347

Post notes to a facebook page with an Application Api Key

I'm getting an application api key with this request:

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

I want to create notes on a user page but it fails. I'm sending a post request with subject and message to:

https://graph.facebook.com/[PAGE_ID]/notes/access_token=[APP_TOKEN]

But what i get is:

{
   "error": {
      "message": "(#281) Requires extended permission: create_note",
      "type": "OAuthException",
      "code": 281
   }
}

With an user api key with all permissions, i was just sending a request to /accounts/, then getting the page key and I was able to create notes. But I am confused about application keys. Maybe i just need additional permissions but i don't know how to do it.

This is how the application looks in user's App Center: enter image description here

Any ideas?

P.S.: the reason i use an APP key is that it doesn't expire. Simple user keys expire in about 2 hours.

Upvotes: 0

Views: 257

Answers (1)

C3roe
C3roe

Reputation: 96412

You can not ask for permissions for an app access token.

What you want to do requires a page access token.

P.S.: the reason i use an APP key is that it doesn't expire. Simple user keys expire in about 2 hours.

As has been said here in various discussions about the deprecation of offline_access multiple times before:

Page access tokens acquired using a long-lived user access token do not expire by default.

Upvotes: 1

Related Questions