Facebook IFrame Applications and the Zend Framework Tutorial 2: Accessing the Graph APIOverviewThis tutorial is designed to help Facebook and Zend Framework developers access the Facebook Graph API from within their IFrame application on the Facebook Platform ®. This may not be the BEST method of accessing the Graph API but it is intended as a decent starting point for your own implementation. It presumes you have completed part 1 in the series, which describes the authentication process.The Graph APIThe graph API is Facebook's latest API implementation, based around custom URLs to grab JSON data about people and objects. For example, to grab the information about the Zend Framework page on Facebook, we simply navigate to it's Graph URL, which is http://graph.facebook.com/ followed by the Facebook object ID, which in this case is 103731186331757. If you navigate to http://graph.facebook.com/103731186331757 in your browser, you will see the JSON data for the Zend Framework page:Improving the Error HandlingFirstly, lets improve a bit on the error handling from the first tutorial by creating a custom exception we can throw for all things Facebook. Head over to your command line tool, and let's do the following...zf create model FacebookExceptionThen in the created model, let's just make an empty class extending Zend_Exception:
Voir