Saturday, February 8, 2014

Getting Facebook Access Token for JAVA applications

    When for the first time i used facebook API in my java application using the  library restFb i faced real trouble with the access token .For that i browsed a lot to get the token at last i was able.So to make it easy here are the steps to get the access token that is valid for 2 months.

Step:1
   First of all create a facebook application and goto the application page.goto tools and click on APIExplorer   in the menu as shown below select your application...


 click on get accesstoken..


 
on clicking debug it will show you that it is valid for 1 hour only..Note the access token as use the URL below with the noted token...
   https://graph.facebook.com/oauth/access_token?grant_type=fb_exchange_token
&client_id=APP__ID&client_secret=APPP__SECRET&fb_exchange_token=CURRENT_TOKEN

So in return u will return with an token that is valid for 2 months..

Thanks...........

No comments:

Post a Comment