Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Rest for the Web!
The new buzzword in town

Nitesh Oswal
www.niteshoswal.me
APIs: What & Why?
What is an API?
Application Programming Interface
An API is the interface implemented by
an application which allows us to...
What is REST?
REpresentational State Transfer
●

Architectural Style

●

Not a standard, unlike SOAP

●

Modern best pract...
Constraints
●

Client – Server Independance

●

Stateless

●

Cacheable

●

Layered System

●

Code in demand

●

Uniform ...
Examples
●

Twitter

●

Dropbox

●

Instagram

●

Github

●

Paypal

●

Soundcloud

●

Google+

●

...
Trends

Source: http://blog.programmableweb.com/2011/03/08/3000-web-apis/
3,000 Web APIs: Trends From a Quickly Growing Di...
REST APIs: ?
Any API which conforms with the REST
constraints for data transfer is called a
REST API!
Top 3 Qualities
●

Intuitive
–

●

No surprises, easy to learn

Documented
–
–

●

Simple answers to simple questions
Refe...
Resources,
Representations,
Metadata
Resource
●

Nouns not verbs

●

Could be any information

●

They tell you what they ‘are’
Representation
●

Sequence of bytes

●

Described by representation metadata

●

Less precisely, a document, an entity, or...
Embrace HTTP
●

GET, POST, PUT, PATCH, DELETE

●

Explorable with simple tools
Embrace HTTP
GET /document
GET /document/1
POST /document
PUT /document/1
DELETE /document/1

Retrieve all documents
Retri...
Example
Best Practices
security

Https!

base URLs

api.mycompany.com

serialization

json

timestamps

ISO 8601 & UTC

caching

E...
Questions?
Thank you
Upcoming SlideShare
Loading in …5
×

REST for the Web!

232 views

Published on

A really simple overview of what is REST APIs

Published in: Technology
  • Be the first to comment

  • Be the first to like this

REST for the Web!

  1. 1. Rest for the Web! The new buzzword in town Nitesh Oswal www.niteshoswal.me
  2. 2. APIs: What & Why?
  3. 3. What is an API? Application Programming Interface An API is the interface implemented by an application which allows us to communicate with it.
  4. 4. What is REST? REpresentational State Transfer ● Architectural Style ● Not a standard, unlike SOAP ● Modern best practice ● Developed closely with HTTP 1.1
  5. 5. Constraints ● Client – Server Independance ● Stateless ● Cacheable ● Layered System ● Code in demand ● Uniform Interface
  6. 6. Examples ● Twitter ● Dropbox ● Instagram ● Github ● Paypal ● Soundcloud ● Google+ ● ...
  7. 7. Trends Source: http://blog.programmableweb.com/2011/03/08/3000-web-apis/ 3,000 Web APIs: Trends From a Quickly Growing Directory
  8. 8. REST APIs: ? Any API which conforms with the REST constraints for data transfer is called a REST API!
  9. 9. Top 3 Qualities ● Intuitive – ● No surprises, easy to learn Documented – – ● Simple answers to simple questions References, tutorials & quick start guides Opinionated – CamelCase, ids, responses, paginated etc.
  10. 10. Resources, Representations, Metadata
  11. 11. Resource ● Nouns not verbs ● Could be any information ● They tell you what they ‘are’
  12. 12. Representation ● Sequence of bytes ● Described by representation metadata ● Less precisely, a document, an entity, or an instance
  13. 13. Embrace HTTP ● GET, POST, PUT, PATCH, DELETE ● Explorable with simple tools
  14. 14. Embrace HTTP GET /document GET /document/1 POST /document PUT /document/1 DELETE /document/1 Retrieve all documents Retrieve a specific document #1 Create a new document Update an existing document #1 Delete an existing document #1
  15. 15. Example
  16. 16. Best Practices security Https! base URLs api.mycompany.com serialization json timestamps ISO 8601 & UTC caching Etag & Last modified gzip Always & pretty print responses versioning /v1/ OR /v1.1/
  17. 17. Questions?
  18. 18. Thank you

×