27.02.2013 Views

Rails%203%20In%20Action

Rails%203%20In%20Action

Rails%203%20In%20Action

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

This chapter covers<br />

� Building an API using new Rails 3 features<br />

� Rate-limiting the API<br />

� Versioning APIs<br />

1 http://json.org.<br />

2 http://xml.org.<br />

Designing an API<br />

In the past chapters, you’ve created a great application that allows your users to<br />

manage projects and tickets through a web browser. In this chapter, you are going<br />

to create a way for your users to manage this content through what’s known as an<br />

Application Programming Interface (API). As its name implies, an API is a programming<br />

interface (for your application) that returns either JavaScript Object<br />

Notation 1 (JSON) or XML 2 data for its requests, which are the two most common<br />

formats for modern APIs to return information in. People can then create programs<br />

or libraries (referred to as clients) to read and present this data in any way<br />

they see fit.<br />

347

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!