Uncomplicated Hypermedia – Facebook’s Graph API

It is a pleasure to read the Facebook Graph API. It avoided many of the traps that web services offered by the other major players in the industry suffer from. Facebook’s API is simple, consistent and inter-connected. It is true to the spirit of the web.

It is simple, because as a developer, I do not have to learn about 10 different web services for each of users, pages, events, groups, applications etc. Having a separate web service for each is like having "end points" – resources that are not connected, each with a different set of conventions. In the Facebook Graph API, there are no end-points.

It is consistent, because all the representations look similar. Each representation has an identifier, a self-link, timestamps, and links to related resources. Apart from these being the ideal characteristics of representations on the web, for a developer, such representations are a pleasure to work with. Facebook just proves that you don’t need to focus heavily on formats like Google Data Protocol or Open Data Protocol to design representations that are consistent.

It is interconnected as every representation is linked to related resources. For instance, an album representation is linked to the profile that posted the album. Each user representation is linked to a collection of groups that the user is member of. This is hypermedia in action. Hypermedia does not have to be complicated – and Facebook just proves it.

I am sure it is possible to nitpick on minor details, but the underlying philosophy cannot be ignored. Finally, support for OAuth 2.0 is the icing on the cake.

Write a Comment