Nicolaesse
Nicolaesse

Reputation: 2724

Facebook Graph API...how to get started?

Hi I'm trying to get a JSON file about the list of the friends of Bret Taylor ("btaylor" is a profile of Facebook used for practice). I am reading the Graph API official guide (on FB website) and I am undesrtanding that for this request I need an authorization token code.

I've found an access token code from the link

https://graph.facebook.com/oauth/access_token?
     client_id=YOUR_APP_ID&client_secret=YOUR_APP_SECRET&
     grant_type=client_credentials

where I've wrote my aps id and secret code but if I try to open the following URL using the access token code

https://graph.facebook.com/btaylor/friends?access_token=MY_TOKE_AUTH_CODE

I get the following error message:

{
   "error": {
      "message": "(#604) Can't lookup all friends of 220439. Can only lookup for the logged in user (0), or friends of the logged in user with the appropriate permission",
      "type": "OAuthException"
   }
}

the token code is something like access_token=112701417077438|GnwE4LeR_f_3r-mmxoi79ukgEFd

Where is the problem? With Google I've found some tutorial with long php pages but following the official guide I can't understand how to use all of this code...on the official guide everything appear extrimely short and easy...

Upvotes: 1

Views: 2067

Answers (1)

Alexis Dufrenoy
Alexis Dufrenoy

Reputation: 11966

First things first, you need to set up your Facebook application. Go to the Developer App:

https://developers.facebook.com/apps

During the process, you will get an App ID and an App Secret. Take note of them.

What to need to do next depends on the type of app you want to create, either a web app or a app on Facebook. You speak about Access Tokens, so I guess you want to create a web app.

Steps are here, it's pretty easy:

http://developers.facebook.com/docs/guides/web/#login

You will need the infos gathered on the first step.

Upvotes: 1

Related Questions