I need to post messages on a Facebook page. Specifically I want to post via cron
.
Here's what the API docs say:
Page Access Token – These access tokens are similar to user access tokens, except that they provide permission to APIs that read, write or modify the data belonging to a Facebook Page. To obtain a page access token you need to start by obtaining a user access token and asking for the manage_pages permission. Once you have the user access token you then get the page access token via the Graph API.
How I can obtain a user access and page access token without a page callback? Is this possible?
What you need it an Extended Page Token, it is valid forever. You get one like this:
manage_pages
permission (and publish_pages
if you want to post as Page later), to get a User Token/me/accounts?fields=access_token
with the Extended User Token to get a list of all your Pages with Extended Page Tokens - or use /page-id?fields=access_token
to get an Extended Page Token for a specific PageInformation about all Tokens and how to extend the User Token: