Luís Ramalho bio photo

Luís Ramalho

Developer & Entrepreneur

Twitter LinkedIn Github Stackoverflow

You will need:

  • [APPLICATION_ID]
  • [APPLICATION_SECRET] (https://developers.facebook.com/apps/[APPLICATION_ID])
https://www.facebook.com/dialog/oauth?client_id=[APPLICATION_ID]
&scope=manage_pages,publish_stream
&response_type=token
&redirect_uri=https://www.facebook.com/connect/login_success.html

When you see 'Success' then you have a URL like:

https://www.facebook.com/connect/login_success.html#access_token=[ACCESS_TOKEN]&expires_in=[SECONDS]

Grab the [ACCESS_TOKEN] then,

https://graph.facebook.com/oauth/access_token?client_id=[APPLICATION_ID]
&client_secret=[APPLICATION_SECRET]
&grant_type=fb_exchange_token
&fb_exchange_token=[ACCESS_TOKEN]

Finally, you will see your extended page access token that never expires

access_token=[EXTENDED_ACCESS_TOKEN]
https://graph.facebook.com/me/accounts?access_token=[EXTENDED_ACCESS_TOKEN]