Sunday, May 29, 2011

How to obtain a Facebook access token to use face.com functionality

This is simple and here are the steps to follow.

1. Go to http://www.facebook.com/developers/apps.php/ page and create a new app and obtain your FB appID, api key and api secret.

2. If not, you have to create a face.com account and obtain a face.com API key, secret pair.

3. And register this FB api key and secret with your face.com API key. You can go to edit account settings in face.com and apply this.

Use app ID to fill client_id(i.e client_id=appID) to follows with redirect url and get the auth token. AND SKIP THE expire time variable also.
NOTE: Redirect_url should be in the same domian you specified your app in FB.

https://graph.facebook.com/oauth/authorize?
type=user_agent&
client_id=your_FB_APPID&
redirect_uri=http://abc.com/&
scope=user_photos,email,user_birthday,user_online_presence,offline_access

Out put of redirect url can be something like this and obtain the access token and use this to access the API.

http://face.com/about.php/#access_token=2242657575991sadasdasf1faf9%7C2.%7CYwds6rrGtfpOi7c&expires_in=0