There are 4 types of access token:
- User Access Token (Include page actions.)
- App Access Token (Modify and read the app settings. It can also be used to publish Open Graph actions.)
- Page Access Token (Specific to page actions.)
- Client Token (rarely used)
What you've done is retrieve the App Access Token, which was nothing to do with page.
So, in order to post Facebook feed pages as admin, you should use User Access Token OR Page Access Token instead.
User Access Token:
You will have to go through authorization dialog to retrieve your User Access Token:
Make sure you granted both manage_pages and status_update permission, as shown in the perms= parameter above. The reason can be found here: why does posting to facebook page yield "user hasn't authorized the application"
Then you do HTTP POST request (e.g. message=hello) to your page on https://graph.facebook.com/YOUR_PAGE_ID/feed?access_token=YOUR_USER_ACCESS_TOKEN
Page Access Token:
You have to use User Access Token to retrieve Page Access Token via API calls:
https://graph.facebook.com/me/accounts?access_token=YOUR_USER_ACCESS_TOKEN (Get all pages token)
https://graph.facebook.com/YOUR_PAGE_ID?fields=access_token&access_token=YOUR_USER_ACCESS_TOKEN (Get specific page token by page ID)
Then you do HTTP POST request (e.g. message=hello) to your page on 3 ways:
- https://graph.facebook.com/YOUR_PAGE_ID/feed?access_token=YOUR_PAGE_ACCESS_TOKEN
- https://graph.facebook.com/me/feed?access_token=YOUR_PAGE_ACCESS_TOKEN
- https://graph.facebook.com/feed?access_token=YOUR_PAGE_ACCESS_TOKEN
Update:
I suggest you to manually granted a User Access Token(e.g. Login/authorization dialog would appear, and user need to manually click to accept APP permission request, you can't programatically web scraping to do this first step, as it's violate TOS of the Facebook platform), then extend it to long-live(Expired 2 months) via https://graph.facebook.com/oauth/access_token?client_id=my_app_id&client_secret=my_app_secret&grant_type=fb_exchange_token&fb_exchange_token=User_Access_Token
And now you have long-live User Access Token, and then call https://graph.facebook.com/me/accounts?access_token=LONG_LIVE_USER_ACCESS_TOKEN to get NEVER expired Page Access Token. You can debug the Page Access Token at https://developers.facebook.com/tools/debug/accesstoken?q=YOUR_PAGE_ACCESS_TOKEN
As you can see, the Expires date is Never:
Documentation:
- https://developers.facebook.com/docs/facebook-login/access-tokens/
- https://developers.facebook.com/docs/graph-api/reference/app (No such thing post to page as admin)