Exchange Facebook Short Lived Token With Longed Live Ones!

0
2118
views

One of the best and easiest way I come across to do this operation! If you want you can do this operation with coding but here I will explain how to get Facebook long lived tokens using Facebook Graph API Explorer.
Graph API is like an Interface between your application and Facebook there you can Test, create, and authenticate API calls and debug responses. All said and done Let’s get started with this then!

First and Foremost to do this operation you need to have
1. Your Facebook App-ID
2. Secrete Key
3. Access Token(your last access token).

First you need to go to https://developers.facebook.com/tools-and-support/ Choose API Explorer
Graph API looks like this

There you need to select your application
First we will get an old access token by passing parameters like given below in GET method

/yourpageID?fields=access_token

After getting your access_token you need to perform post operation
Select carrot symbol in the dropdown it will show you three methods like GET,POST and DELETE

Select the Post method.

Exchange Facebook Short Lived Token With Longed Live Ones!

Below the input box you see an Add Field button there you need to enter field parameters
client_id=APP_ID&
client_secret=APP_SECRET&
grant_type=fb_exchange_token&
fb_exchange_token=EXISTING_ACCESS_TOKEN

In the above post method call we are asking Facebook for the particular appId and secrete key to grant us new access_token for the old one which is valid for long time.
Hit submit button in response you will get an access token with the duration of the time you can use it(which is obviously valid for long period of time.).

Feel free to ask any questions in the comments below. and I appreciate your suggestions.