SlideShare une entreprise Scribd logo
1  sur  141
RESTful APIs




         Promises & Lies!
Tareque	
  (täreɪk)	
  	
  
what	
  do	
  all	
  these	
  companies	
  
     have	
  in	
  common?	
  
they	
  thrive	
  in	
  their	
  business	
  
using	
  APIs	
  
in	
  fact,	
  all	
  of	
  them	
  provide	
  
RESTful	
  APIs	
  
all	
  of	
  them	
  secure	
  their	
  APIs	
  
using	
  Oauth	
  
these	
  facts	
  are	
  not	
  coincidental	
  
these	
  companies	
  made	
  a	
  
choice	
  
they	
  chose	
  to	
  do	
  their	
  APIs	
  
right	
  
so	
  what	
  is	
  this	
  talk	
  about?	
  
it’s	
  about	
  Web	
  APIs	
  
it’s	
  about	
  how	
  we	
  build	
  APIs	
  
nowadays	
  
nice	
  &	
  solid	
  
we	
  all	
  have	
  been	
  building	
  APIs	
  
for	
  some	
  time	
  now	
  
till	
  this	
  date,	
  there	
  are	
  hardly	
  any	
  
resource	
  available	
  
that	
  tell	
  you	
  how	
  to	
  build	
  APIs	
  right	
  
standards	
  
best	
  practices	
  
we	
  all	
  learn	
  them	
  hard	
  way	
  
+	
  
=	
  magical	
  API	
  
Not  really..
 but	
  you	
  can	
  make	
  APIs	
  magical	
  
ask	
  questions	
  
is	
  your	
  API	
  RESTful?	
  
.	
  stateless	
  
.	
  cacheable	
  
.	
  HTTP	
  methods	
  
	
  
take	
  action	
  depending	
  on	
  the	
  
type	
  of	
  HTTP	
  request	
  
GET	
  	
   	
     	
  -­‐	
  retrieve	
  
POST	
   	
        	
  -­‐	
  create	
  
PUT	
   	
         	
  -­‐	
  update	
  
DELETE	
           	
  -­‐	
  destroy	
  	
  
using	
  these	
  verbs	
  API	
  clients	
  act	
  
on	
  resources	
  
your	
  API	
  is	
  only	
  as	
  good	
  as	
  the	
  
resources	
  it	
  delivers	
  
are	
  your	
  resources	
  well	
  defined?	
  
say	
  you	
  have	
  a	
  django	
  project	
  
it	
  has	
  a	
  lot	
  of	
  models	
  
attractive	
  models	
  
resource	
  !=	
  model	
  
resource	
  =	
  unit	
  of	
  information	
  
that	
  you	
  own	
  
and	
  everyone	
  else	
  wants	
  a	
  piece	
  
define	
  them	
  with	
  care	
  
class	
  Book	
  (Model):	
  
     	
  title	
   	
  =	
  Charfield(...)	
  
     	
  summary 	
  =	
  Charfield(...)	
  
     	
  isbn10	
   	
  =	
  Charfield(...)	
  
     	
  isbn13	
   	
  =	
  Charfield(...) 	
  	
  
     	
  authors	
  	
  =	
  ManyToManyField(...)	
  
     	
  created	
  	
  =	
  DateTimeField(...)	
  
	
  
{	
  
        	
  ‘title’ 	
     	
  :	
  ‘...’,	
  
        	
  ‘summary’      	
  :	
  ‘...’,	
  
        	
  ‘authors’      	
  :	
  [‘...’,	
  ‘...’],	
  
        	
  ‘editions’ 	
  :	
  [{	
  
        	
     	
  ‘number’	
        	
  	
  	
  	
  :	
  ‘...’,	
  
        	
     	
  ‘publisher’ 	
  	
  	
  	
  :	
  ‘...’,	
  
        	
     	
  ‘date_published’:	
  ‘...’,	
  
        	
     	
  }],	
  
        	
  ‘is_favorite’ :	
  true,	
  
                           	
  
}	
  
class	
  Book	
  (Model):	
  
       	
  title	
  
                  	
  =	
  Charfield(...)	
  
       	
  summary             	
  =	
  Charfield(...)	
  
       	
  isbn10	
            	
  =	
  Charfield(...)	
  
       	
  isbn13	
            	
  =	
  Charfield(...) 	
  	
  
       	
  authors	
           	
  =	
  ManyToManyField(...)	
  
       	
  created	
           	
  =	
  DateTimeField(...)	
  
	
  
{	
  
        	
  ‘title’
                  	
          	
  :	
  ‘...’,	
  
        	
  ‘summary’         	
  :	
  ‘...’,	
  
        	
  ‘authors’         	
  :	
  [‘...’,	
  ‘...’],	
  
        	
  ‘editions’        	
  :	
  [{	
  
        	
        	
  ‘number’                	
        	
  	
  	
  	
  :	
  ‘...’,	
  
        	
        	
  ‘publisher’ 	
  	
  	
  	
  :	
  ‘...’,	
  
        	
        	
  ‘date_published’:	
  ‘...’,	
  
        	
        	
  }],	
  
        	
  ‘is_favorite’ 	
  :	
  true,	
  
}	
  
resource	
  !=	
  model	
  
concise	
  &	
  complete	
  	
  
but	
  are	
  resources	
  the	
  only	
  thing	
  
you	
  send	
  in	
  API	
  responses?	
  
resource	
  structures	
  vary	
  wildly	
  
API	
  responses	
  should	
  be	
  
predictable	
  
API	
  responses	
  should	
  be	
  
parsable	
  
API	
  responses	
  should	
  be	
  
uniform	
  
API
                                RESPONSE




wrap	
  them	
  in	
  envelopes	
  
add	
  metadata	
  about	
  response	
  
.	
  HTTP	
  status	
  code	
  
.	
  error	
  code	
  &	
  message	
  
.	
  pagination	
  data	
  
{	
  
        	
  ‘status’ 	
  :	
  200,	
  
        	
  ‘errors’ 	
  :	
  [],	
  
        	
  ‘data’     	
  :	
  {	
  
        	
   	
  ‘title’          	
  :	
  ‘...’,	
  
        	
   	
  ‘isbn10’ 	
  :	
  ‘...’,	
  
        	
   	
  ‘summary’ 	
  :	
  ‘...’,	
  	
  
        	
   	
  ‘authors’ 	
  :	
  [‘...’,	
  ‘...’],	
  
        	
   	
  }	
  
        	
  }	
  
{	
  
        	
  ‘status’ 	
  :	
  400,	
  
        	
  ‘errors’ 	
  :	
  [{	
  
        	
        	
  ‘code’	
   	
  :	
  5,	
  
                                 	
  
        	
        	
  ‘message’	
     	
  :	
  ‘OMG	
  form	
  errors!’,	
  
        	
        	
  ‘data’	
   	
  :	
  {	
  
                                 	
  
        	
        	
   	
  ‘title’:	
  [‘Field	
  required’],	
  
                    	
  
        	
        	
   	
  }	
  
                    	
  
        	
        	
  }],	
  
        	
  ‘data’:	
  {},	
  
                         	
  
        	
  }	
  
{	
  
    	
  ‘status’ 	
  :	
  200,	
  
    	
  ‘errors’ 	
  :	
  [],	
  
    	
  ‘data’          	
  :	
  {	
  
    	
   	
  ‘pagination’:	
  {	
  
    	
   	
   	
  ‘count’ 	
  :	
  134,	
  
              	
  
    	
   	
   	
  ‘pages’ 	
  :	
  7,	
  
              	
  
    	
   	
   	
  }	
  
              	
  
    	
   	
  ‘results’:	
  [...],	
  
    	
   	
  }	
  
    	
  }	
  
now	
  that	
  you	
  have	
  uniform	
  
responses	
  
ask	
  yourself	
  
would	
  you	
  support	
  different	
  
serialization	
  formats?	
  
the	
  world	
  is	
  moving	
  towards	
  
json	
  
it’s	
  a	
  greener	
  alternative	
  to	
  XML	
  
but	
  you	
  might	
  want	
  to	
  support	
  
jsonp	
  
or	
  XML	
  
more	
  formats	
  =	
  more	
  testing	
  
more	
  formats	
  =	
  more	
  support	
  
                        requests	
  
it’s	
  cool	
  if	
  you	
  can	
  accommodate	
  
serialization	
  parameters	
  !=	
  cool	
  
format=xml	
  
client	
  can	
  add	
  .json	
  or	
  .xml	
  at	
  
end	
  of	
  URL	
  
Now  you  
                                          see  it..	


http://api.domain.com/v1.0/books/game-­‐of-­‐thrones.xml	
  
Now  you  
                                        don’t..	


http://api.domain.com/v1.0/books/game-­‐of-­‐thrones	
  
in	
  absence	
  of	
  specified	
  format	
  
return	
  default	
  
then	
  it’s	
  all	
  good	
  
Did  you  
                                  notice  that?	


http://api.domain.com/v1.0/books/game-­‐of-­‐thrones	
  
versioning	
  your	
  API	
  is	
  cool	
  
6	
  days	
  of	
  beer	
  in	
  Portland	
  
your	
  pants	
  might	
  not	
  fit	
  
6	
  months	
  of	
  deployment	
  in	
  
production	
  
your	
  APIs	
  might	
  not	
  fit	
  
version	
  your	
  API	
  
Why  hello  
                                    there!	


http://api.domain.com/v1.0/books/game-­‐of-­‐thrones	
  
save	
  URL	
  namespace	
  
now	
  to	
  one	
  of	
  the	
  most	
  
important	
  questions..	
  
Is  the  anomaly  
 systemic,  creating  
fluctuations  in  even  
the  most  simplistic  
     equations?
always	
  hated	
  that	
  guy	
  
the	
  question	
  we	
  are	
  looking	
  for	
  
is..	
  
Is  your  API  secure?
some	
  endpoints	
  need	
  to	
  be	
  secure	
  
private	
  user	
  data	
  
resources	
  that	
  bring	
  revenue	
  
to	
  protect	
  resources,	
  use	
  an	
  
authentication	
  scheme	
  
use	
  Oauth	
  
use	
  Oauth	
  1.0	
  
use	
  Oauth	
  2.0	
  
use	
  2-­‐legged	
  Oauth	
  for	
  
applications	
  directly	
  accessing	
  
resources	
  
use	
  3-­‐legged	
  Oauth	
  for	
  
applications	
  accessing	
  resources	
  
on	
  behalf	
  of	
  users	
  
use	
  HTTPS	
  for	
  calls	
  to	
  protected	
  
resources	
  
using	
  Oauth	
  might	
  get	
  a	
  little	
  
complex	
  
how	
  to	
  minimize	
  that	
  complexity?	
  
what’s	
  the	
  easiest	
  route	
  to	
  
securing	
  your	
  API?	
  
and	
  making	
  your	
  API	
  comply	
  
with	
  the	
  concepts	
  we	
  discussed?	
  
bring	
  us	
  to	
  the	
  next	
  question..	
  
do	
  you	
  use	
  any	
  API	
  frameworks?	
  
django-­‐piston	
  
tastypie	
  
django-­‐rest-­‐framework	
  
dj-­‐webmachine	
  
take	
  your	
  pick	
  
none	
  of	
  these	
  frameworks	
  will	
  
do	
  everything	
  for	
  you	
  
make	
  them	
  work	
  for	
  you	
  
to	
  build	
  
we	
  used	
  django-­‐piston	
  
piston	
  has	
  built	
  in	
  Oauth	
  support	
  
and	
  a	
  flexible	
  architecture	
  using	
  
pluggable	
  components	
  
pluggable	
  resource	
  handlers	
  
pluggable	
  emitters	
  (serializers)	
  
pluggable	
  authentication	
  
we	
  enhanced	
  django-­‐piston	
  
.	
  pluggable	
  envelopes	
  
.	
  form	
  error	
  feedbacks	
  
.	
  anonymous	
  tokens	
  
added	
   resource	
  definition	
  
          subsystem	
  
class	
  BookDetailedView	
  (PistonView):	
  
	
  	
  	
  	
  fields	
  =	
  [	
  
             	
  ‘title’,	
  
             	
  ‘isbn10’,	
  
             	
  ‘pages’,	
  
             	
  Field(	
  
             	
        	
  ‘’,	
  
             	
        	
  lambda	
  x:	
  [y.name	
  for	
  y	
  in	
  
x.authors.all()],	
  
             	
        	
  destination=‘authors’,	
  
             	
        	
  ),	
  
             	
  ]	
  
	
  
return	
  BookDetailedView(book)	
  
{	
  
        	
  ‘title’ 	
  :	
  ‘...’,	
  
        	
  ‘isbn10’ 	
  :	
  ‘...’,	
  
        	
  ‘pages’ 	
  :	
  357,	
  	
  
        	
  ‘authors’	
  :	
  [‘...’,	
  ‘...’],	
  
}	
  
http://github.com/pbs-­‐education/django-­‐piston	
  
again,	
  you	
  have	
  quite	
  a	
  few	
  choices	
  
.	
  django-­‐piston	
  
.	
  tastypie	
  
.	
  django-­‐rest-­‐framework	
  
.	
  dj-­‐webmachine	
  
take	
  your	
  pick	
  
make	
  them	
  work	
  for	
  you	
  
build	
  your	
  API	
  right	
  
join	
  the	
  party	
  
thank	
  you	
  
tarequeh	
  
   	
  -­‐	
  slideshare.net	
  
   	
  -­‐	
  twitter	
  
   	
  -­‐	
  .com	
  

Contenu connexe

Tendances

Leveraging the Power of Graph Databases in PHP
Leveraging the Power of Graph Databases in PHPLeveraging the Power of Graph Databases in PHP
Leveraging the Power of Graph Databases in PHPJeremy Kendall
 
Gail villanueva add muscle to your wordpress site
Gail villanueva   add muscle to your wordpress siteGail villanueva   add muscle to your wordpress site
Gail villanueva add muscle to your wordpress sitereferences
 
Fields in Core: How to create a custom field
Fields in Core: How to create a custom fieldFields in Core: How to create a custom field
Fields in Core: How to create a custom fieldIvan Zugec
 
The Query the Whole Query and Nothing but the Query
The Query the Whole Query and Nothing but the QueryThe Query the Whole Query and Nothing but the Query
The Query the Whole Query and Nothing but the QueryChris Olbekson
 
Introduction to Moose
Introduction to MooseIntroduction to Moose
Introduction to Moosethashaa
 
Yii, frameworks and where PHP is heading to
Yii, frameworks and where PHP is heading toYii, frameworks and where PHP is heading to
Yii, frameworks and where PHP is heading toAlexander Makarov
 
Open Source Search: An Analysis
Open Source Search: An AnalysisOpen Source Search: An Analysis
Open Source Search: An AnalysisJustin Finkelstein
 
Surviving the Zombie Apocalypse using Custom Post Types and Taxonomies
Surviving the Zombie Apocalypse using Custom Post Types and TaxonomiesSurviving the Zombie Apocalypse using Custom Post Types and Taxonomies
Surviving the Zombie Apocalypse using Custom Post Types and TaxonomiesBrad Williams
 
Introduction To Moose
Introduction To MooseIntroduction To Moose
Introduction To MooseMike Whitaker
 
Moose (Perl 5)
Moose (Perl 5)Moose (Perl 5)
Moose (Perl 5)xSawyer
 
OO Perl with Moose
OO Perl with MooseOO Perl with Moose
OO Perl with MooseNelo Onyiah
 
How to use MongoDB with CakePHP
How to use MongoDB with CakePHPHow to use MongoDB with CakePHP
How to use MongoDB with CakePHPichikaway
 

Tendances (14)

Leveraging the Power of Graph Databases in PHP
Leveraging the Power of Graph Databases in PHPLeveraging the Power of Graph Databases in PHP
Leveraging the Power of Graph Databases in PHP
 
Gail villanueva add muscle to your wordpress site
Gail villanueva   add muscle to your wordpress siteGail villanueva   add muscle to your wordpress site
Gail villanueva add muscle to your wordpress site
 
Fields in Core: How to create a custom field
Fields in Core: How to create a custom fieldFields in Core: How to create a custom field
Fields in Core: How to create a custom field
 
Theme API
Theme APITheme API
Theme API
 
The Query the Whole Query and Nothing but the Query
The Query the Whole Query and Nothing but the QueryThe Query the Whole Query and Nothing but the Query
The Query the Whole Query and Nothing but the Query
 
XQuery Design Patterns
XQuery Design PatternsXQuery Design Patterns
XQuery Design Patterns
 
Introduction to Moose
Introduction to MooseIntroduction to Moose
Introduction to Moose
 
Yii, frameworks and where PHP is heading to
Yii, frameworks and where PHP is heading toYii, frameworks and where PHP is heading to
Yii, frameworks and where PHP is heading to
 
Open Source Search: An Analysis
Open Source Search: An AnalysisOpen Source Search: An Analysis
Open Source Search: An Analysis
 
Surviving the Zombie Apocalypse using Custom Post Types and Taxonomies
Surviving the Zombie Apocalypse using Custom Post Types and TaxonomiesSurviving the Zombie Apocalypse using Custom Post Types and Taxonomies
Surviving the Zombie Apocalypse using Custom Post Types and Taxonomies
 
Introduction To Moose
Introduction To MooseIntroduction To Moose
Introduction To Moose
 
Moose (Perl 5)
Moose (Perl 5)Moose (Perl 5)
Moose (Perl 5)
 
OO Perl with Moose
OO Perl with MooseOO Perl with Moose
OO Perl with Moose
 
How to use MongoDB with CakePHP
How to use MongoDB with CakePHPHow to use MongoDB with CakePHP
How to use MongoDB with CakePHP
 

En vedette

Building RESTful APIs
Building RESTful APIsBuilding RESTful APIs
Building RESTful APIsSilota Inc.
 
REST Easy with Django-Rest-Framework
REST Easy with Django-Rest-FrameworkREST Easy with Django-Rest-Framework
REST Easy with Django-Rest-FrameworkMarcel Chastain
 
Linux Composite Communication
Linux Composite CommunicationLinux Composite Communication
Linux Composite CommunicationTareque Hossain
 
Are RESTful APIs Well-designed? Detection of their Linguistic (Anti)Patterns
Are RESTful APIs Well-designed? Detection of their Linguistic (Anti)PatternsAre RESTful APIs Well-designed? Detection of their Linguistic (Anti)Patterns
Are RESTful APIs Well-designed? Detection of their Linguistic (Anti)PatternsFrancis Palma
 
API Design & Security in django
API Design & Security in djangoAPI Design & Security in django
API Design & Security in djangoTareque Hossain
 
All you need to know when designing RESTful APIs
All you need to know when designing RESTful APIsAll you need to know when designing RESTful APIs
All you need to know when designing RESTful APIsJesús Espejo
 
RESTFul API Design and Documentation - an Introduction
RESTFul API Design and Documentation - an IntroductionRESTFul API Design and Documentation - an Introduction
RESTFul API Design and Documentation - an IntroductionMiredot
 
Building Consistent RESTful APIs in a high-performance environment
Building Consistent RESTful APIs in a high-performance environmentBuilding Consistent RESTful APIs in a high-performance environment
Building Consistent RESTful APIs in a high-performance environmentLinkedIn
 
대용량 분산 아키텍쳐 설계 #1 아키텍쳐 설계 방법론
대용량 분산 아키텍쳐 설계 #1 아키텍쳐 설계 방법론대용량 분산 아키텍쳐 설계 #1 아키텍쳐 설계 방법론
대용량 분산 아키텍쳐 설계 #1 아키텍쳐 설계 방법론Terry Cho
 

En vedette (10)

Building RESTful APIs
Building RESTful APIsBuilding RESTful APIs
Building RESTful APIs
 
REST Easy with Django-Rest-Framework
REST Easy with Django-Rest-FrameworkREST Easy with Django-Rest-Framework
REST Easy with Django-Rest-Framework
 
RESTful API Design, Second Edition
RESTful API Design, Second EditionRESTful API Design, Second Edition
RESTful API Design, Second Edition
 
Linux Composite Communication
Linux Composite CommunicationLinux Composite Communication
Linux Composite Communication
 
Are RESTful APIs Well-designed? Detection of their Linguistic (Anti)Patterns
Are RESTful APIs Well-designed? Detection of their Linguistic (Anti)PatternsAre RESTful APIs Well-designed? Detection of their Linguistic (Anti)Patterns
Are RESTful APIs Well-designed? Detection of their Linguistic (Anti)Patterns
 
API Design & Security in django
API Design & Security in djangoAPI Design & Security in django
API Design & Security in django
 
All you need to know when designing RESTful APIs
All you need to know when designing RESTful APIsAll you need to know when designing RESTful APIs
All you need to know when designing RESTful APIs
 
RESTFul API Design and Documentation - an Introduction
RESTFul API Design and Documentation - an IntroductionRESTFul API Design and Documentation - an Introduction
RESTFul API Design and Documentation - an Introduction
 
Building Consistent RESTful APIs in a high-performance environment
Building Consistent RESTful APIs in a high-performance environmentBuilding Consistent RESTful APIs in a high-performance environment
Building Consistent RESTful APIs in a high-performance environment
 
대용량 분산 아키텍쳐 설계 #1 아키텍쳐 설계 방법론
대용량 분산 아키텍쳐 설계 #1 아키텍쳐 설계 방법론대용량 분산 아키텍쳐 설계 #1 아키텍쳐 설계 방법론
대용량 분산 아키텍쳐 설계 #1 아키텍쳐 설계 방법론
 

Similaire à RESTful APIs: Promises & lies

Data models in Angular 1 & 2
Data models in Angular 1 & 2Data models in Angular 1 & 2
Data models in Angular 1 & 2Adam Klein
 
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and JasmineSingle Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and JasminePaulo Ragonha
 
Seu primeiro app Android e iOS com Compose Multiplatform
Seu primeiro app Android e iOS com Compose MultiplatformSeu primeiro app Android e iOS com Compose Multiplatform
Seu primeiro app Android e iOS com Compose MultiplatformNelson Glauber Leal
 
Introduction to node.js
Introduction to node.jsIntroduction to node.js
Introduction to node.jsAdrien Guéret
 
Crossing the Bridge: Connecting Rails and your Front-end Framework
Crossing the Bridge: Connecting Rails and your Front-end FrameworkCrossing the Bridge: Connecting Rails and your Front-end Framework
Crossing the Bridge: Connecting Rails and your Front-end FrameworkDaniel Spector
 
GraphQL & Relay - 串起前後端世界的橋樑
GraphQL & Relay - 串起前後端世界的橋樑GraphQL & Relay - 串起前後端世界的橋樑
GraphQL & Relay - 串起前後端世界的橋樑Pokai Chang
 
Stop the noise! - Introduction to the JSON:API specification in Drupal
Stop the noise! - Introduction to the JSON:API specification in DrupalStop the noise! - Introduction to the JSON:API specification in Drupal
Stop the noise! - Introduction to the JSON:API specification in DrupalBjörn Brala
 
Overview of GraphQL & Clients
Overview of GraphQL & ClientsOverview of GraphQL & Clients
Overview of GraphQL & ClientsPokai Chang
 
Tomer Elmalem - GraphQL APIs: REST in Peace - Codemotion Milan 2017
Tomer Elmalem - GraphQL APIs: REST in Peace - Codemotion Milan 2017Tomer Elmalem - GraphQL APIs: REST in Peace - Codemotion Milan 2017
Tomer Elmalem - GraphQL APIs: REST in Peace - Codemotion Milan 2017Codemotion
 
Ember Data and JSON API
Ember Data and JSON APIEmber Data and JSON API
Ember Data and JSON APIyoranbe
 
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...SPTechCon
 
Zensations Drupal 8 GraphQL Presentation 2015
Zensations Drupal 8 GraphQL Presentation 2015Zensations Drupal 8 GraphQL Presentation 2015
Zensations Drupal 8 GraphQL Presentation 2015Zensations GmbH
 
Enter the app era with ruby on rails (rubyday)
Enter the app era with ruby on rails (rubyday)Enter the app era with ruby on rails (rubyday)
Enter the app era with ruby on rails (rubyday)Matteo Collina
 
Prompt engineering for iOS developers (How LLMs and GenAI work)
Prompt engineering for iOS developers (How LLMs and GenAI work)Prompt engineering for iOS developers (How LLMs and GenAI work)
Prompt engineering for iOS developers (How LLMs and GenAI work)Andrey Volobuev
 
Finding Restfulness - Madrid.rb April 2014
Finding Restfulness - Madrid.rb April 2014Finding Restfulness - Madrid.rb April 2014
Finding Restfulness - Madrid.rb April 2014samlown
 
Ruby on Rails: Tasty Burgers
Ruby on Rails: Tasty BurgersRuby on Rails: Tasty Burgers
Ruby on Rails: Tasty BurgersAaron Patterson
 
Big Data Web applications for Interactive Hadoop by ENRICO BERTI at Big Data...
 Big Data Web applications for Interactive Hadoop by ENRICO BERTI at Big Data... Big Data Web applications for Interactive Hadoop by ENRICO BERTI at Big Data...
Big Data Web applications for Interactive Hadoop by ENRICO BERTI at Big Data...Big Data Spain
 

Similaire à RESTful APIs: Promises & lies (20)

Data models in Angular 1 & 2
Data models in Angular 1 & 2Data models in Angular 1 & 2
Data models in Angular 1 & 2
 
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and JasmineSingle Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
 
Ams adapters
Ams adaptersAms adapters
Ams adapters
 
Seu primeiro app Android e iOS com Compose Multiplatform
Seu primeiro app Android e iOS com Compose MultiplatformSeu primeiro app Android e iOS com Compose Multiplatform
Seu primeiro app Android e iOS com Compose Multiplatform
 
Introduction to node.js
Introduction to node.jsIntroduction to node.js
Introduction to node.js
 
Play á la Rails
Play á la RailsPlay á la Rails
Play á la Rails
 
Crossing the Bridge: Connecting Rails and your Front-end Framework
Crossing the Bridge: Connecting Rails and your Front-end FrameworkCrossing the Bridge: Connecting Rails and your Front-end Framework
Crossing the Bridge: Connecting Rails and your Front-end Framework
 
GraphQL & Relay - 串起前後端世界的橋樑
GraphQL & Relay - 串起前後端世界的橋樑GraphQL & Relay - 串起前後端世界的橋樑
GraphQL & Relay - 串起前後端世界的橋樑
 
Stop the noise! - Introduction to the JSON:API specification in Drupal
Stop the noise! - Introduction to the JSON:API specification in DrupalStop the noise! - Introduction to the JSON:API specification in Drupal
Stop the noise! - Introduction to the JSON:API specification in Drupal
 
Overview of GraphQL & Clients
Overview of GraphQL & ClientsOverview of GraphQL & Clients
Overview of GraphQL & Clients
 
Tomer Elmalem - GraphQL APIs: REST in Peace - Codemotion Milan 2017
Tomer Elmalem - GraphQL APIs: REST in Peace - Codemotion Milan 2017Tomer Elmalem - GraphQL APIs: REST in Peace - Codemotion Milan 2017
Tomer Elmalem - GraphQL APIs: REST in Peace - Codemotion Milan 2017
 
Ember Data and JSON API
Ember Data and JSON APIEmber Data and JSON API
Ember Data and JSON API
 
JSON and the APInauts
JSON and the APInautsJSON and the APInauts
JSON and the APInauts
 
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
 
Zensations Drupal 8 GraphQL Presentation 2015
Zensations Drupal 8 GraphQL Presentation 2015Zensations Drupal 8 GraphQL Presentation 2015
Zensations Drupal 8 GraphQL Presentation 2015
 
Enter the app era with ruby on rails (rubyday)
Enter the app era with ruby on rails (rubyday)Enter the app era with ruby on rails (rubyday)
Enter the app era with ruby on rails (rubyday)
 
Prompt engineering for iOS developers (How LLMs and GenAI work)
Prompt engineering for iOS developers (How LLMs and GenAI work)Prompt engineering for iOS developers (How LLMs and GenAI work)
Prompt engineering for iOS developers (How LLMs and GenAI work)
 
Finding Restfulness - Madrid.rb April 2014
Finding Restfulness - Madrid.rb April 2014Finding Restfulness - Madrid.rb April 2014
Finding Restfulness - Madrid.rb April 2014
 
Ruby on Rails: Tasty Burgers
Ruby on Rails: Tasty BurgersRuby on Rails: Tasty Burgers
Ruby on Rails: Tasty Burgers
 
Big Data Web applications for Interactive Hadoop by ENRICO BERTI at Big Data...
 Big Data Web applications for Interactive Hadoop by ENRICO BERTI at Big Data... Big Data Web applications for Interactive Hadoop by ENRICO BERTI at Big Data...
Big Data Web applications for Interactive Hadoop by ENRICO BERTI at Big Data...
 

Plus de Tareque Hossain

django Forms in a Web API World
django Forms in a Web API Worlddjango Forms in a Web API World
django Forms in a Web API WorldTareque Hossain
 
Life in a Queue - Using Message Queue with django
Life in a Queue - Using Message Queue with djangoLife in a Queue - Using Message Queue with django
Life in a Queue - Using Message Queue with djangoTareque Hossain
 
Introducing KMux - The Kernel Multiplexer
Introducing KMux - The Kernel MultiplexerIntroducing KMux - The Kernel Multiplexer
Introducing KMux - The Kernel MultiplexerTareque Hossain
 
SIGTRAN - An Introduction
SIGTRAN - An IntroductionSIGTRAN - An Introduction
SIGTRAN - An IntroductionTareque Hossain
 
Xen & the Art of Virtualization
Xen & the Art of VirtualizationXen & the Art of Virtualization
Xen & the Art of VirtualizationTareque Hossain
 
Introduction to django-config
Introduction to django-configIntroduction to django-config
Introduction to django-configTareque Hossain
 

Plus de Tareque Hossain (9)

django Forms in a Web API World
django Forms in a Web API Worlddjango Forms in a Web API World
django Forms in a Web API World
 
The solr power
The solr powerThe solr power
The solr power
 
Life in a Queue - Using Message Queue with django
Life in a Queue - Using Message Queue with djangoLife in a Queue - Using Message Queue with django
Life in a Queue - Using Message Queue with django
 
Introducing KMux - The Kernel Multiplexer
Introducing KMux - The Kernel MultiplexerIntroducing KMux - The Kernel Multiplexer
Introducing KMux - The Kernel Multiplexer
 
SIGTRAN - An Introduction
SIGTRAN - An IntroductionSIGTRAN - An Introduction
SIGTRAN - An Introduction
 
Django orm-tips
Django orm-tipsDjango orm-tips
Django orm-tips
 
Django Deployment
Django DeploymentDjango Deployment
Django Deployment
 
Xen & the Art of Virtualization
Xen & the Art of VirtualizationXen & the Art of Virtualization
Xen & the Art of Virtualization
 
Introduction to django-config
Introduction to django-configIntroduction to django-config
Introduction to django-config
 

Dernier

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 

Dernier (20)

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

RESTful APIs: Promises & lies

Notes de l'éditeur

  1. ----- Meeting Notes (9/7/11 09:17) -----Let's take a look at these company logos. You are familiar with most of them
  2. Take a look again!
  3. Because
  4. So what’s the deal with promises & lies?
  5. So how do start building APIs? Do you make a django project and spit some json out?
  6. And you get magical API
  7. Unfortunately, that’s not true
  8. You just have to ask yourself a few questions..
  9. RESTful APIs are stateless, cacheable and relies on HTTP methods
  10. In RESTful APIs, handlers..
  11. Speaking of resources
  12. Resources are units of information that are of interest to your clients..
  13. Units of information
  14. Just like Kitkat
  15. Now let’s take a look at the resource that can be built around that.. Besides some model attributes, it includes editions. Editions have further attributes that are of interest to API consumers. Lastly, there can be attributes that are very specific to the consumer requesting the resource.
  16. Now let’s put them next to each other for a better understanding
  17. Remember this guy
  18. He always brought friends
  19. Many friends
  20. How was Neo able to fight them off, all by himself?
  21. Because they were all agents Smiths. Their tactics were uniform. So Neo knew exactly how to approach them.
  22. So wrap them in envelopes
  23. Include information like.. when appropriate
  24. For example you can deliver a response that has HTTP status code, errors and finally the data for a successful GET request
  25. If a POST or PUT request fails, you can add the error metadata to your response.Makes it easy for the client to understand what exactly went wrong
  26. Let’s take a look at a response that provides pagination information. You can include fields like how many results were found, how many pages that maps to etc.
  27. You should remember..
  28. It’s perfectly alright to have multiple serialization formats if you can accommodate the extra efforts
  29. But don’t accept serialization formats as GET parameters
  30. Like that
  31. Or they can choose not to
  32. Like that
  33. Starting with Oauth 2.0 it’s mandated that you use HTTPS for calls to protected resources..
  34. How do you minimize that complexity
  35. Next, API frameworks
  36. Next, API frameworks
  37. A major feature we added was..
  38. Lets take a look at that now.. this is how you’d define the resource for the Book model we previously discussed. It takes an object and uses your definitions to create a resource
  39. Once you have that definition, you callit like this..
  40. For example you can deliver a response that has HTTP status code, errors and finally the data for a successful GET request
  41. You can find all necessary information about this enhanced django piston on PBS Education’s Github profile
  42. We did!