ict.ken.be

Delivering solid user friendly software solutions since the dawn of time.

Facebook Platform Overview

Categories: Facebook Notes

by Yasser Shohoud

http://facebook.com/shohoudy

http://developers.facebook.com/socialdesign/

  • Community: people we know and trust
  • Conversations: help people get in contact
  • Identity: how each user wants to be seen, express themselves

Social graph and social channels
Graph API & FQL, Authentication & Permissions, Dialogs, Social Plugins
Applications: Pages, Page Tabs, Canvas, Web Sites, Mobile, Desktop & Devices

The social graph

Edges: play, like, friends, read, checkin, connect, use

Pages

  • Presence of your brand
  • Apps can be surfaced as page tabs
  • Website presence, Canvas app experience, Page tab experience

Social Plugins

  • like button 
  • activity feed
  • comments
  • recommendations
  • like box
  • registration
  • facepile
  • live stream
  • login button 
  • send button

Dialogs

  • feed dialog: post to timeline or friends timeline
  • send dialog
  • request dialog

Meta Data

Add javascript SDK to your page

  • When using the feed dialog, you do not need to request permissions.
  • So if possible always use this instead of the api.

Graph API

Authentication
https://developers.facebook.com/docs/authentication

Access objects using their ID as the first path component /object_id

?ids=cocacola,pepsi
?ids=http://www.imdb.com/title/tt0117500
/me
/me?metadata=1

Access a connection by specifying it as the second path component
/notes is a collection of note objects

Limiting results and paging

?fields=id,name,location
?limit=3
?offset=100
?offset=100&limit=50
?since=1320105600&until=1320192000

Creating objects
POST to /me/events with event parameters

https://developers.facebook.com/tools/explorer

Batching API Calls
https://developers.facebook.com/docs/reference/api/batch/

Real-Time Updates

  • Get pings from Facebook when specific data changes
  • You get just the changed fields, not the changes
  • Every 5 seconds/1000 changes
  • You set up an endpoint to receive pings
  • You call /app_id/subscriptions to create/update/delete subscriptions
  • https://developers.facebook.com/docs/reference/api/realtime/

Facebook Query Language (FQL)

/fql?q=SELECT name FROM user WHERE uid=574937872

/fql?q=SELECT uid,name,pic_square FROM user WHERE uid = me()
OR uid IN (SELECT uid2 FROM friend WHERE uid1 = me())

/fql?q={"query1":"SELECT uid,rsvp_status FROM event_member WHERE
eid=12345678","query2":"SELECT name,url,pic FROM profile WHERE id IN
(SELECT uid FROM #query1)"}

Dates

  • Returned in ISO-8601 (2011-11-17T18:00:16+0000)
  • Can specify a date_format following php date function
  • http://php.net/manual/en/function.date.php
  • eg. date_format=U for Unix dates 1321552816
  • eg. date_format=r for Thu, 17 Nov 2011 18:00:16+0000
  • Default graph api timezone is UTC
  • Default fql timezone is PST -> UTC-8

More

Solid Tests: https://solid.fbdublin.com
Forums: htttp://facebook.stackoverflow.com
Bugs: https://developers.facebook.com/bugs
Roadmap: https://developers.facebook.com/roadmap