Navigation

Facebook POST via PHP

APP access tokens are used to get information that your app is privileged to access. And in some cases where publish_stream is granted from an app user, you can use it to post to that user's wall, without needing a USER access token.

USER access tokens are given to your app and they relate to the permissions a specific app user has granted to your application so you app can act on their behalf.

PAGE access tokens are given to page admins so they can act on behalf of the page. To go from a user access token to a page access token, call /me/accounts using the user access token to get a list of pages they admin along with each pages access tokens.

 

https://developers.facebook.com/tools/explorer/
Input URL, Access Token, or Open Graph Action ID - https://developers.facebook.com/tools/debug
Access Token - https://developers.facebook.com/docs/facebook-login/access-tokens/
Access Token Tool - https://developers.facebook.com/tools/access_token/
Facebook, me accounts (Application change to your app, than subbmit) - https://developers.facebook.com/tools/explorer/?method=GET&path=me%2Faccounts

To associate an existing Facebook Page with an App:

  1. Go to your Facebook Page and click "Edit Page" section
  2. In the Basic Information tab, set Category as "Brands & Products" -> "App Page"
    • Make sure the Page name is the same as the App name
  3. Go to your Facebook App "Edit App" page, and now you will be able to choose the Page as the App page.

https://developers.facebook.com/docs/reference/api/securing-graph-api/

http://stackoverflow.com/questions/10183625/extending-facebook-page-access-token

http://blog.petrovsky.cz/311/how-to-set-facebook-app-token-to-60-day-validity/

http://blog.petrovsky.cz/295/posting-to-facebook-page-in-batches-php-class/

http://stackoverflow.com/questions/9373645/can-you-get-a-public-facebook-pages-feed-using-graph-api-without-asking-a-user

http://www.youtube.com/watch?v=8383iyKYC1g

http://knowledge.petrovsky.cz/programming/token_generator-php.txt

 

 

 

You can use following api from facebook to refresh token life to 60 days and just when the token is about to expire, call the same api again with-in 60 days to refresh its life back to 60 days from that point of time Token expire is present in expires parameter and its value is in seconds

Replace CLIENT_ID and CLIENT_SECRET with their actual value

https://graph.facebook.com/oauth/access_token?client_id=<CLIENT_ID>
&client_secret=<CLIENT_SECRET>&grant_type=fb_exchange_token
&fb_exchange_token=<ACCESS_TOKEN>

in ACCESS_TOKEN, put the actual token value without appending "access_token="