• Social graph • Connections Application Graph API Facebook Database Access Token Request Data Aggregate Information Response Data Saturday, November 12, 11
objects and connections • Identify entities and relationships by id • Data will be stored with smallest spaces and keep being updated Saturday, November 12, 11
the object in the Facebook social graph are connected to each other via connections • Objects are just like entities while connections are like relationship • For example, users, pages and groups are objects and likes, friends and feeds are connections Saturday, November 12, 11
information of an object with id or username • id-or-username can be “me” with the access token http://graph.facebook.com/<id-‐or-‐username> Saturday, November 12, 11
token should be transferred as a HTTP GET variable • More information: developers.facebook.com/docs/ reference/api/ http://graph.facebook.com/littleq0903?access_token=... Saturday, November 12, 11
string to denote the authentication of users, which request facebook information with your application • The information behind the access token ‣ user id ‣ app id ‣ expired time ‣ secret Saturday, November 12, 11
access all features of the Graph API or dialogs via Javascript • Authentication • Rendering the XFBML versions of Social Plugins • Most functions in the FB Javascript SDK require an app id Saturday, November 12, 11
must specify a <div> element with id “fb-root” in your web pages • The location of the script <div id=”fb-‐root”></div> http://connect.facebook.net/ /all.js en_US Saturday, November 12, 11
must specify a <div> element with id “fb-root” in your web pages • The location of the script <div id=”fb-‐root”></div> http://connect.facebook.net/ /all.js zh_TW Saturday, November 12, 11
the “fb-root” div element has been built FB.init({ appId : 'YOUR APP ID', status : true, // check login status cookie : true, // enable cookies xfbml : true // parse XFBML }); Saturday, November 12, 11
call to the Graph API • depending on the connect status and the permissions function SuccessCall(res){ alert(res.name); } FB.api('/me', SuccessCall); Saturday, November 12, 11
call to the Graph API • depending on the connect status and the permissions function SuccessCall(res){ alert(res.name); } FB.api('/me', SuccessCall); Call if success. Saturday, November 12, 11
or popups with Facebook FB.ui( { method: 'feed', name: 'Facebook Dialogs', link: 'https://developers.facebook.com/docs/reference/dialogs/', picture: 'http://fbrell.com/f8.jpg', caption: 'Reference Documentation', description: 'Dialogs provide a simple, consistent interface for applications to interface with users.', message: 'Facebook Dialogs are easy!' } ); Saturday, November 12, 11