Getting started w/ Facebook API (FQL)

Alex Egg,

This is a quick start guide to get you up and running w/ FQL part of the Facebook API.

Say for example: We want to get all the videos of a user (myself in this case) - we first need to get the user’s permission to access their information. Facebook handles authentication via the oath protocol. The flow would like this:

  1. User clicks link to install your app and clicks yes
  2. Response sends oath token so you can access their data.

Before anything else you need to first register you app and get it’s app id.

Get OAuth Token

Now for step #1 in the flow send the user the below link - it’s the standard FB app yes/no page we’ve all seen:

After the user clicks OK they are redirect to the redirect_url and the oath toaken is in the response URL.

After this you’ll get your oath token!!!


Query API

Now you can query that user’s graph:|2.g6_akCDY7umr94sKl4_M1w__.3600.1303063200.1-674426473|Y2KQmx-VlKvcxPX0WX0SOx6OpP8

and use FQL queries vid, owner, title, description, thumbnail_link, embed_html, updated_time, created_time FROM video WHERE owner=13772156826&access_token=164837516907837|2.2gdLzMH6jVTBP2g8sr604g__.3600.1302642000-674426473|c5sHb3xK-zCvdmdOb2vzeiov7Yo

That will get all videos of given user in XML.


Permalink: getting-started-w-facebook-api

Tags: facebook api social graph fql

Last edited by Alex Egg, 2011-06-10 15:54:48
View Revision History