UPDATED 13:55 EDT / SEPTEMBER 08 2011

NEWS

Learning Lessons for Building a Reliable and Secure API

RESTful APIs are becoming a standard for gluing apps in a Web oriented environment. Twitter, Google and a host of other Web properties have thrived by developing their own REST APIs. The use is so widespread that there are some developers who maintain that the API should be developed before anything else.

Still, a steep learning curve exists in building APIs. There is a surprising lack of resources or standards to go by. This is especially true when integrating security through OAuth, the now most common security protocol for APIs on the Web. There is little that tells you how to build an API the right way with security in mind.

At DjangoCon in Portland yesterday, Tareque Hossain presented a discussion titled: RESTful APIs: Promises & Lies. Hossain is a senior technologist with the PBS Education Technology Team. He shared his team’s experience in building an API and the lessons the group learned along the way.

I caught up with Hossain at DjangoCon and did an interview with him. But let’s first look at the approach Hossain and his group took as it is an interesting story about how the group approached its API development and in the process enhanced an open-source technology for the Django community.

Here’s the slide deck Hosssain showed at Djangocon.  His lesson can be summed up as follows:

  • Your API is only as good as the resources it delivers. That means defining resources accordingly.
  • Resources are not the only thing your API delivers. API responses should be uniform and wrapped in envelopes with associated metadata such as HTTP status code, error messaging and pagination data.
  • Automate your methods for offering formats.
  • Version control is critical.
  • Use OAuth
  • To effectively use OAuth, work with an API framework. Django is Hossain’s focus so that means choosing django-piston, tastypie, django-rest-framework or dj-webmachine.
  • Hossain used django-piston for PBS Learning Media, which has built in Oauth support with a varirty of pluggable items such as pluggable resource handlers, pluggable emitters, and pluggable authentication.
  • Hossain and his group enhanced django-piston for the open-source community. They added pluggable envelopes, form error feedback and anonymous tokens.

Here’s my interview with Hossein after the talk in which he sums up his experiences in building APIs.

Services Angle

A new generation of apps is needed for the emerging modern infrastructure. A critical aspect of that is the API. Services organizations need to hire more developers to build apps. But just as important are the processes for building APIs. The trick is in finding the right way to do it.


A message from John Furrier, co-founder of SiliconANGLE:

Support our mission to keep content open and free by engaging with theCUBE community. Join theCUBE’s Alumni Trust Network, where technology leaders connect, share intelligence and create opportunities.

  • 15M+ viewers of theCUBE videos, powering conversations across AI, cloud, cybersecurity and more
  • 11.4k+ theCUBE alumni — Connect with more than 11,400 tech and business leaders shaping the future through a unique trusted-based network.
About SiliconANGLE Media
SiliconANGLE Media is a recognized leader in digital media innovation, uniting breakthrough technology, strategic insights and real-time audience engagement. As the parent company of SiliconANGLE, theCUBE Network, theCUBE Research, CUBE365, theCUBE AI and theCUBE SuperStudios — with flagship locations in Silicon Valley and the New York Stock Exchange — SiliconANGLE Media operates at the intersection of media, technology and AI.

Founded by tech visionaries John Furrier and Dave Vellante, SiliconANGLE Media has built a dynamic ecosystem of industry-leading digital media brands that reach 15+ million elite tech professionals. Our new proprietary theCUBE AI Video Cloud is breaking ground in audience interaction, leveraging theCUBEai.com neural network to help technology companies make data-driven decisions and stay at the forefront of industry conversations.