SlideShare uma empresa Scribd logo
1 de 35
> GET /problems/MONEY HTTP/1.1   I	 GOT	 99
                                 PROBLEMS
> Host: localhost
> Accept: */*

< HTTP/1.1 200 OK




> GET /problems/POWER HTTP/1.1
> Host: localhost
                                 BUT	 REST
                                 AINT	 ONE
> Accept: */*

< HTTP/1.1 200 OK



> GET /problems/REST HTTP/1.1
> Host: localhost
> Accept: */*
                                 @adrianfcole
< HTTP/1.1 404 Not Found
PROBLEMS
 ➡Why API
 ➡ReST vs other HTTP APIs?
 ➡Design Patterns vs Real APIs
WHO	 IS	 THIS	 GUY?
๏ @adrianfcole

๏ architect CloudHub at MuleSoft

๏founder jclouds
THANKS
  ★     api-craft
  ★     mattstep
  ★   gtcampbell
  ★       mulies
WHY	 WE	 API

          photo copyright 2005 Sony Pictures
COLLABORATE
GROW	 
ECOSYSTEM
AND	 
INNOVATE
HOW	 
TO	  ReST SOAP
API
HOW	 
TO	  ReST WS-*
API
HOW	 
TO	  ReST ReST   ish

API
HOW	 
TO	  not-soap   HATEOAS
REST
To	 the	 
        Level 0:
        Level 1:
                   Swamp of POX
                   Resources
glory	  Level 2:
        Level 3:
                   Verbs
                   Hypermedia

of	 
REST
> POST /api HTTP/1.1
                         > <SOAP-ENV:Envelope ...>
                           <SOAP-ENV:Body>
                             <m:getAvailableDataSources xmlns:m="




Swamp	 
                               <group xsi:type="xsd:string">ArcWe
                               <service xsi:type="xsd:string">Map
                               <token xsi:type="xsd:string">MyTok
                             </m:getAvailableDataSources>




of	 POX
                           </SOAP-ENV:Body>
                         </SOAP-ENV:Envelope>

                         < HTTP/1.1 200 OK
                         < <?xml version="1.0" encoding="UTF-8"?>
                         <soap:Envelope ...>
                           <soap:Body>
                             <n:getAvailableDataSourcesResponse x
                               <Result href="#id0"/>
                             </n:getAvailableDataSourcesResponse>
All things go over the       <id0 id="id0" soapenc:root="0" xsi:t
                         soapenc:arrayType="ns5:DataSource[21]">
same endpoint as XML           <i href="#id1"/>
                         --snip--
RESOURCES
> GET https://ec2.amazonaws.com/?Action=DeleteVolume&VolumeId=vol-4282672b HTTP/1.1

< HTTP/1.1 200 OK

<DeleteVolumeResponse xmlns="http://ec2.amazonaws.com/doc/2012-08-15/">
  <requestId>59dbff89-35bd-4eac-99ed-be587EXAMPLE</requestId>
  <return>true</return>
</DeleteVolumeResponse>

   --snip--

                         Many URIs, same HTTP method
                          Side-effects are API-specific
VERBS
    > HEAD https://mybucket.s3.amazonaws.com/ HTTP/1.1

    < HTTP/1.1 200 OK




 HTTP verbs mean more than CRUD
    Status codes are meaningful
HYPERMEDIA
    > GET https://vcloud/api/v1.0/catalogItem/1c01defe-1111-42ac-a50f-9dd4e03546
    > Accept: application/vnd.vmware.vcloud.catalogItem+xml

    < HTTP/1.1 200 OK
    < Content-Type: application/vnd.vmware.vcloud.catalogItem+xml;version=1.0

    <CatalogItem xmlns="http://www.vmware.com/vcloud/v1" name="mycatalog" type="
                 href="https://vcloud/api/v1.0/catalogItem/1c01defe-1111-42ac-a5
        <Link rel="up" type="application/vnd.vmware.vcloud.catalog+xml"
              href="https://vcloud/api/v1.0/catalog/7f192dfe-00d1-42f2-9f76-9360
        <Link rel="edit" type="application/vnd.vmware.vcloud.catalogItem+xml"
              href="https://vcloud/api/v1.0/catalogItem/1c01defe-1111-42ac-a50f-
        <Link rel="remove"
             href="https://vcloud/api/v1.0/catalogItem/1c01defe-1111-42ac-a50f-9
    --snip--




Discoverability, Self-documenting
What	 makes	 
it	 HYPER?
      ➡Base Type
      ➡Links
abort

                                                  add

                                                  alternate

                                                  disk:attach




    TRANSITIONS                                   edit

                                                  remove

                                                  task




All	 transitions	 are	 discoverable	 via	 links
CONTENT	 
NEGOTIATION
 ➡   Client supplies representation in
    Accept header
 ➡On change, update mediatype
    name or annotate via ;version=N.N
 ➡On overhaul, bump global version
 Accept: application/vnd.VENDOR.PRODUCT.RESOURCE+xml
Representing	 
HyperMedia
    Extend Atom
    Opaque + Link Headers
    HAL
    ...
EXTEND	 ATOM
      Vendor Type, Link elements
      < HTTP/1.1 200 OK
      < Content-Type: application/vnd.vmware.vcloud.catalogItem+xml;version=1.0

      <CatalogItem xmlns="http://www.vmware.com/vcloud/v1" name="mycatalog" type="
                   href="https://vcloud/api/v1.0/catalogItem/1c01defe-1111-42ac-a5
          <Link rel="up" type="application/vnd.vmware.vcloud.catalog+xml"
                href="https://vcloud/api/v1.0/catalog/7f192dfe-00d1-42f2-9f76-9360
          <Link rel="edit" type="application/vnd.vmware.vcloud.catalogItem+xml"
                href="https://vcloud/api/v1.0/catalogItem/1c01defe-1111-42ac-a50f-
          <Link rel="remove"
               href="https://vcloud/api/v1.0/catalogItem/1c01defe-1111-42ac-a50f-9
      --snip--



domain-specific types
inherits link semantics from Atom
Link	 Headers
      Opaque Type, Link elements
      < HTTP/1.1 200 OK
      < Content-Type: image/jpeg
      Link: </images/foo.png>; rel="alternate"; type=”image/png”

      010101010101010101
      --snip--




supports binary types
facilitates intermediaries
Hypertext	 Application	 Language
     Mix-in hypermedia controls into base type
     embed resources for efficiency
     < HTTP/1.1 200 OK
     < Content-Type: application/hal+json

     {
         _links: {
            self: {
              href: '/example',
            }
         },
         _embedded: {},
         name: 'foo',

     --snip--



domain-specific type agnostic
ELEGENT
clients always
know transitions

self-documenting
                   LETS	 USE
and discoverable

version at
                   HATEOAS
media-type
granularity
Perceived	 
Complexity?
Level	 2	 
optimizes	 
for Coarse Grained Versions
    CRUD++
    Limited Representations
    Today’s Tools
    Simplicity over Elegance
IS	 IT	 ALL	 
JUST	 
PRICKLES	 
&	 GOO?
can	 we	 have	 both?
There	       Domain	 Style
           Base	 Format
is	 no	      State	 Transfer
Level2          App	 Flow
 Design
            plus stuff like errors
REST	 Design	 
tools
       ➡Apiary
       ➡Swagger
       ➡iodocs
GOOD	 API	 DESIGNERS	 
UNDERSTAND
 how it is used, and who will use it

 importance of iterations and feedback

 impacts to design beyond development

 there’s no golden hammer   (not even mongo)
TWITTER	 IS	 NOT	 
HATEOAS
         REST
         SEARCH
         STREAM
AWS	 IS	 NOT	 REST	 
AWS	 IS	 GOOD
api designed to parse quickly

simple extension (add new key)

consistent security model

bulk ops
WebSockets	 	 
ain’t	 even
HTTP! Handshake is HTTPish
      Discoverable like ReST

      Full-Duplex
      Uncode or Binary Messages
      TCP Protocol
GOOD	 REST	 APIs
Are consciously designed

Version at the right scope

Don’t leak implementation details

Use auth models relevant to consumer

Are well documented with examples
What	 now?
 ➡join api-craft
 ➡read The REST API Design Handbook
 ➡read Building Hypermedia APIs...
 ➡socialize your ideas
       Thank	 you!

Mais conteúdo relacionado

Mais procurados

Docker and kubernetes_introduction
Docker and kubernetes_introductionDocker and kubernetes_introduction
Docker and kubernetes_introductionJason Hu
 
Angular Framework présentation PPT LIGHT
Angular Framework présentation PPT LIGHTAngular Framework présentation PPT LIGHT
Angular Framework présentation PPT LIGHTtayebbousfiha1
 
Tadx - Présentation Conteneurisation
Tadx -  Présentation ConteneurisationTadx -  Présentation Conteneurisation
Tadx - Présentation ConteneurisationTADx
 
Docker London: Container Security
Docker London: Container SecurityDocker London: Container Security
Docker London: Container SecurityPhil Estes
 
Présentation docker et kubernetes
Présentation docker et kubernetesPrésentation docker et kubernetes
Présentation docker et kubernetesKiwi Backup
 
Kubernetes internals (Kubernetes 해부하기)
Kubernetes internals (Kubernetes 해부하기)Kubernetes internals (Kubernetes 해부하기)
Kubernetes internals (Kubernetes 해부하기)DongHyeon Kim
 
Kubernetes: A Short Introduction (2019)
Kubernetes: A Short Introduction (2019)Kubernetes: A Short Introduction (2019)
Kubernetes: A Short Introduction (2019)Megan O'Keefe
 
Docker Container Security
Docker Container SecurityDocker Container Security
Docker Container SecuritySuraj Khetani
 
[OPD 2019] Attacking JWT tokens
[OPD 2019] Attacking JWT tokens[OPD 2019] Attacking JWT tokens
[OPD 2019] Attacking JWT tokensOWASP
 
Continuous Integration With Jenkins
Continuous Integration With JenkinsContinuous Integration With Jenkins
Continuous Integration With JenkinsEdureka!
 
2020-02-20 - HashiCorpUserGroup Madring - Integrating HashiCorp Vault and Kub...
2020-02-20 - HashiCorpUserGroup Madring - Integrating HashiCorp Vault and Kub...2020-02-20 - HashiCorpUserGroup Madring - Integrating HashiCorp Vault and Kub...
2020-02-20 - HashiCorpUserGroup Madring - Integrating HashiCorp Vault and Kub...Andrey Devyatkin
 
An intro to Kubernetes operators
An intro to Kubernetes operatorsAn intro to Kubernetes operators
An intro to Kubernetes operatorsJ On The Beach
 
Exactly-once Stream Processing with Kafka Streams
Exactly-once Stream Processing with Kafka StreamsExactly-once Stream Processing with Kafka Streams
Exactly-once Stream Processing with Kafka StreamsGuozhang Wang
 
Introduction and Deep Dive Into Containerd
Introduction and Deep Dive Into ContainerdIntroduction and Deep Dive Into Containerd
Introduction and Deep Dive Into ContainerdKohei Tokunaga
 
Oak, the architecture of Apache Jackrabbit 3
Oak, the architecture of Apache Jackrabbit 3Oak, the architecture of Apache Jackrabbit 3
Oak, the architecture of Apache Jackrabbit 3Jukka Zitting
 
Kubeflow Pipelines (with Tekton)
Kubeflow Pipelines (with Tekton)Kubeflow Pipelines (with Tekton)
Kubeflow Pipelines (with Tekton)Animesh Singh
 
Midi technique - présentation docker
Midi technique - présentation dockerMidi technique - présentation docker
Midi technique - présentation dockerOlivier Eeckhoutte
 

Mais procurados (20)

Docker and kubernetes_introduction
Docker and kubernetes_introductionDocker and kubernetes_introduction
Docker and kubernetes_introduction
 
Angular Framework présentation PPT LIGHT
Angular Framework présentation PPT LIGHTAngular Framework présentation PPT LIGHT
Angular Framework présentation PPT LIGHT
 
Tadx - Présentation Conteneurisation
Tadx -  Présentation ConteneurisationTadx -  Présentation Conteneurisation
Tadx - Présentation Conteneurisation
 
Docker London: Container Security
Docker London: Container SecurityDocker London: Container Security
Docker London: Container Security
 
Présentation docker et kubernetes
Présentation docker et kubernetesPrésentation docker et kubernetes
Présentation docker et kubernetes
 
Kubernetes internals (Kubernetes 해부하기)
Kubernetes internals (Kubernetes 해부하기)Kubernetes internals (Kubernetes 해부하기)
Kubernetes internals (Kubernetes 해부하기)
 
Kubernetes: A Short Introduction (2019)
Kubernetes: A Short Introduction (2019)Kubernetes: A Short Introduction (2019)
Kubernetes: A Short Introduction (2019)
 
Docker Container Security
Docker Container SecurityDocker Container Security
Docker Container Security
 
[OPD 2019] Attacking JWT tokens
[OPD 2019] Attacking JWT tokens[OPD 2019] Attacking JWT tokens
[OPD 2019] Attacking JWT tokens
 
Docker in real life
Docker in real lifeDocker in real life
Docker in real life
 
Continuous Integration With Jenkins
Continuous Integration With JenkinsContinuous Integration With Jenkins
Continuous Integration With Jenkins
 
2020-02-20 - HashiCorpUserGroup Madring - Integrating HashiCorp Vault and Kub...
2020-02-20 - HashiCorpUserGroup Madring - Integrating HashiCorp Vault and Kub...2020-02-20 - HashiCorpUserGroup Madring - Integrating HashiCorp Vault and Kub...
2020-02-20 - HashiCorpUserGroup Madring - Integrating HashiCorp Vault and Kub...
 
An intro to Kubernetes operators
An intro to Kubernetes operatorsAn intro to Kubernetes operators
An intro to Kubernetes operators
 
Intro to docker
Intro to dockerIntro to docker
Intro to docker
 
Exactly-once Stream Processing with Kafka Streams
Exactly-once Stream Processing with Kafka StreamsExactly-once Stream Processing with Kafka Streams
Exactly-once Stream Processing with Kafka Streams
 
Introduction and Deep Dive Into Containerd
Introduction and Deep Dive Into ContainerdIntroduction and Deep Dive Into Containerd
Introduction and Deep Dive Into Containerd
 
Oak, the architecture of Apache Jackrabbit 3
Oak, the architecture of Apache Jackrabbit 3Oak, the architecture of Apache Jackrabbit 3
Oak, the architecture of Apache Jackrabbit 3
 
Spring ioc
Spring iocSpring ioc
Spring ioc
 
Kubeflow Pipelines (with Tekton)
Kubeflow Pipelines (with Tekton)Kubeflow Pipelines (with Tekton)
Kubeflow Pipelines (with Tekton)
 
Midi technique - présentation docker
Midi technique - présentation dockerMidi technique - présentation docker
Midi technique - présentation docker
 

Destaque

VMworld 2013: vCloud Hybrid Service: Enterprise Applications on vCloud Hybrid...
VMworld 2013: vCloud Hybrid Service: Enterprise Applications on vCloud Hybrid...VMworld 2013: vCloud Hybrid Service: Enterprise Applications on vCloud Hybrid...
VMworld 2013: vCloud Hybrid Service: Enterprise Applications on vCloud Hybrid...VMworld
 
Между молотом и наковальней. Production Quality
Между молотом и наковальней. Production QualityМежду молотом и наковальней. Production Quality
Между молотом и наковальней. Production QualitySQALab
 
Что было, что есть, что будет: Current State vs. Common Sense
Что было, что есть, что будет: Current State vs. Common SenseЧто было, что есть, что будет: Current State vs. Common Sense
Что было, что есть, что будет: Current State vs. Common SenseSQALab
 
Аудит команды тестирования в сложном проекте
Аудит команды тестирования в сложном проектеАудит команды тестирования в сложном проекте
Аудит команды тестирования в сложном проектеSQALab
 
Обратная связь и целеполагание, как маяки надежды тестировщика
Обратная связь и целеполагание, как маяки надежды тестировщикаОбратная связь и целеполагание, как маяки надежды тестировщика
Обратная связь и целеполагание, как маяки надежды тестировщикаSQALab
 
Ответственность за качество в разных ИТ-проектах
Ответственность за качество в разных ИТ-проектахОтветственность за качество в разных ИТ-проектах
Ответственность за качество в разных ИТ-проектахSQALab
 
Три инструмента тест-менеджера для работы с людьми
Три инструмента тест-менеджера для работы с людьмиТри инструмента тест-менеджера для работы с людьми
Три инструмента тест-менеджера для работы с людьмиSQALab
 
Управление хаосом, или как жить когда число тестов перевалило за десятки тысяч
Управление хаосом, или как жить когда число тестов перевалило за десятки тысячУправление хаосом, или как жить когда число тестов перевалило за десятки тысяч
Управление хаосом, или как жить когда число тестов перевалило за десятки тысячSQALab
 
Определение pass/fail критериев при тестировании и анализе производительности
Определение pass/fail критериев при тестировании и анализе производительностиОпределение pass/fail критериев при тестировании и анализе производительности
Определение pass/fail критериев при тестировании и анализе производительностиSQALab
 
Пользовательские требования в жизни тестировщика
Пользовательские требования в жизни тестировщикаПользовательские требования в жизни тестировщика
Пользовательские требования в жизни тестировщикаSQALab
 
Пирамида Тестирования через призму ROI калькулятора и прочая геометрия
Пирамида Тестирования через призму ROI калькулятора и прочая геометрияПирамида Тестирования через призму ROI калькулятора и прочая геометрия
Пирамида Тестирования через призму ROI калькулятора и прочая геометрияSQALab
 
Процесс тестирования в условиях неявных требований
Процесс тестирования в условиях неявных требованийПроцесс тестирования в условиях неявных требований
Процесс тестирования в условиях неявных требованийSQALab
 
A New Model for Testing
A New Model for TestingA New Model for Testing
A New Model for TestingSQALab
 
Работа с бизнес-требованиями на стадии выхода продукта
Работа с бизнес-требованиями на стадии выхода продуктаРабота с бизнес-требованиями на стадии выхода продукта
Работа с бизнес-требованиями на стадии выхода продуктаSQALab
 
Psychology and testing
Psychology and testingPsychology and testing
Psychology and testingSQALab
 
Метод No-Test-Cases: избавьтесь от тест-кейсов в тестировании
Метод No-Test-Cases: избавьтесь от тест-кейсов в тестированииМетод No-Test-Cases: избавьтесь от тест-кейсов в тестировании
Метод No-Test-Cases: избавьтесь от тест-кейсов в тестированииSQALab
 
How to reduce your test cases... magically!
How to reduce your test cases... magically!How to reduce your test cases... magically!
How to reduce your test cases... magically!SQALab
 
Advancing Testing Using Axioms
Advancing Testing Using AxiomsAdvancing Testing Using Axioms
Advancing Testing Using AxiomsSQALab
 
Отряд тест-аналитиков
Отряд тест-аналитиковОтряд тест-аналитиков
Отряд тест-аналитиковSQALab
 
Examples how to move towards Zero Defects
Examples how to move towards Zero DefectsExamples how to move towards Zero Defects
Examples how to move towards Zero DefectsSQALab
 

Destaque (20)

VMworld 2013: vCloud Hybrid Service: Enterprise Applications on vCloud Hybrid...
VMworld 2013: vCloud Hybrid Service: Enterprise Applications on vCloud Hybrid...VMworld 2013: vCloud Hybrid Service: Enterprise Applications on vCloud Hybrid...
VMworld 2013: vCloud Hybrid Service: Enterprise Applications on vCloud Hybrid...
 
Между молотом и наковальней. Production Quality
Между молотом и наковальней. Production QualityМежду молотом и наковальней. Production Quality
Между молотом и наковальней. Production Quality
 
Что было, что есть, что будет: Current State vs. Common Sense
Что было, что есть, что будет: Current State vs. Common SenseЧто было, что есть, что будет: Current State vs. Common Sense
Что было, что есть, что будет: Current State vs. Common Sense
 
Аудит команды тестирования в сложном проекте
Аудит команды тестирования в сложном проектеАудит команды тестирования в сложном проекте
Аудит команды тестирования в сложном проекте
 
Обратная связь и целеполагание, как маяки надежды тестировщика
Обратная связь и целеполагание, как маяки надежды тестировщикаОбратная связь и целеполагание, как маяки надежды тестировщика
Обратная связь и целеполагание, как маяки надежды тестировщика
 
Ответственность за качество в разных ИТ-проектах
Ответственность за качество в разных ИТ-проектахОтветственность за качество в разных ИТ-проектах
Ответственность за качество в разных ИТ-проектах
 
Три инструмента тест-менеджера для работы с людьми
Три инструмента тест-менеджера для работы с людьмиТри инструмента тест-менеджера для работы с людьми
Три инструмента тест-менеджера для работы с людьми
 
Управление хаосом, или как жить когда число тестов перевалило за десятки тысяч
Управление хаосом, или как жить когда число тестов перевалило за десятки тысячУправление хаосом, или как жить когда число тестов перевалило за десятки тысяч
Управление хаосом, или как жить когда число тестов перевалило за десятки тысяч
 
Определение pass/fail критериев при тестировании и анализе производительности
Определение pass/fail критериев при тестировании и анализе производительностиОпределение pass/fail критериев при тестировании и анализе производительности
Определение pass/fail критериев при тестировании и анализе производительности
 
Пользовательские требования в жизни тестировщика
Пользовательские требования в жизни тестировщикаПользовательские требования в жизни тестировщика
Пользовательские требования в жизни тестировщика
 
Пирамида Тестирования через призму ROI калькулятора и прочая геометрия
Пирамида Тестирования через призму ROI калькулятора и прочая геометрияПирамида Тестирования через призму ROI калькулятора и прочая геометрия
Пирамида Тестирования через призму ROI калькулятора и прочая геометрия
 
Процесс тестирования в условиях неявных требований
Процесс тестирования в условиях неявных требованийПроцесс тестирования в условиях неявных требований
Процесс тестирования в условиях неявных требований
 
A New Model for Testing
A New Model for TestingA New Model for Testing
A New Model for Testing
 
Работа с бизнес-требованиями на стадии выхода продукта
Работа с бизнес-требованиями на стадии выхода продуктаРабота с бизнес-требованиями на стадии выхода продукта
Работа с бизнес-требованиями на стадии выхода продукта
 
Psychology and testing
Psychology and testingPsychology and testing
Psychology and testing
 
Метод No-Test-Cases: избавьтесь от тест-кейсов в тестировании
Метод No-Test-Cases: избавьтесь от тест-кейсов в тестированииМетод No-Test-Cases: избавьтесь от тест-кейсов в тестировании
Метод No-Test-Cases: избавьтесь от тест-кейсов в тестировании
 
How to reduce your test cases... magically!
How to reduce your test cases... magically!How to reduce your test cases... magically!
How to reduce your test cases... magically!
 
Advancing Testing Using Axioms
Advancing Testing Using AxiomsAdvancing Testing Using Axioms
Advancing Testing Using Axioms
 
Отряд тест-аналитиков
Отряд тест-аналитиковОтряд тест-аналитиков
Отряд тест-аналитиков
 
Examples how to move towards Zero Defects
Examples how to move towards Zero DefectsExamples how to move towards Zero Defects
Examples how to move towards Zero Defects
 

Semelhante a I got 99 problems, but ReST ain't one

Why Integrate using an API? | MuleSoft
Why Integrate using an API? | MuleSoftWhy Integrate using an API? | MuleSoft
Why Integrate using an API? | MuleSoftMuleSoft
 
Progressive web apps
Progressive web appsProgressive web apps
Progressive web appsFastly
 
Service Discovery Like a Pro
Service Discovery Like a ProService Discovery Like a Pro
Service Discovery Like a ProEran Harel
 
Deploy and Destroy: Testing Environments - Michael Arenzon - DevOpsDays Tel A...
Deploy and Destroy: Testing Environments - Michael Arenzon - DevOpsDays Tel A...Deploy and Destroy: Testing Environments - Michael Arenzon - DevOpsDays Tel A...
Deploy and Destroy: Testing Environments - Michael Arenzon - DevOpsDays Tel A...DevOpsDays Tel Aviv
 
Design Summit - RESTful API Overview - John Hardy
Design Summit - RESTful API Overview - John HardyDesign Summit - RESTful API Overview - John Hardy
Design Summit - RESTful API Overview - John HardyManageIQ
 
Using and scaling Rack and Rack-based middleware
Using and scaling Rack and Rack-based middlewareUsing and scaling Rack and Rack-based middleware
Using and scaling Rack and Rack-based middlewareAlona Mekhovova
 
Four Times Microservices - REST, Kubernetes, UI Integration, Async
Four Times Microservices - REST, Kubernetes, UI Integration, AsyncFour Times Microservices - REST, Kubernetes, UI Integration, Async
Four Times Microservices - REST, Kubernetes, UI Integration, AsyncEberhard Wolff
 
Adriano Di Luzio - Davvy - PyconSEI Talk
Adriano Di Luzio - Davvy - PyconSEI TalkAdriano Di Luzio - Davvy - PyconSEI Talk
Adriano Di Luzio - Davvy - PyconSEI Talkaldur999
 
Building Mobile Friendly APIs in Rails
Building Mobile Friendly APIs in RailsBuilding Mobile Friendly APIs in Rails
Building Mobile Friendly APIs in RailsJim Jeffers
 
HTML5 tutorial: canvas, offfline & sockets
HTML5 tutorial: canvas, offfline & socketsHTML5 tutorial: canvas, offfline & sockets
HTML5 tutorial: canvas, offfline & socketsRemy Sharp
 
Node.js Build, Deploy and Scale Webinar
Node.js Build, Deploy and Scale WebinarNode.js Build, Deploy and Scale Webinar
Node.js Build, Deploy and Scale Webinarjguerrero999
 
Integrating with SAP FIX and HL7
Integrating with SAP FIX and HL7Integrating with SAP FIX and HL7
Integrating with SAP FIX and HL7WSO2
 
The Evolving Security Environment For Web Services
The Evolving Security Environment For Web ServicesThe Evolving Security Environment For Web Services
The Evolving Security Environment For Web ServicesQanita Ahmad
 
Building Web Services with Zend Framework (PHP Benelux meeting 20100713 Vliss...
Building Web Services with Zend Framework (PHP Benelux meeting 20100713 Vliss...Building Web Services with Zend Framework (PHP Benelux meeting 20100713 Vliss...
Building Web Services with Zend Framework (PHP Benelux meeting 20100713 Vliss...King Foo
 
Why we choose Symfony2
Why we choose Symfony2Why we choose Symfony2
Why we choose Symfony2Merixstudio
 
Running Microservices and Docker on AWS Elastic Beanstalk - August 2016 Month...
Running Microservices and Docker on AWS Elastic Beanstalk - August 2016 Month...Running Microservices and Docker on AWS Elastic Beanstalk - August 2016 Month...
Running Microservices and Docker on AWS Elastic Beanstalk - August 2016 Month...Amazon Web Services
 

Semelhante a I got 99 problems, but ReST ain't one (20)

Why Integrate using an API? | MuleSoft
Why Integrate using an API? | MuleSoftWhy Integrate using an API? | MuleSoft
Why Integrate using an API? | MuleSoft
 
Progressive web apps
Progressive web appsProgressive web apps
Progressive web apps
 
ASP.NET WEB API Training
ASP.NET WEB API TrainingASP.NET WEB API Training
ASP.NET WEB API Training
 
Service Discovery Like a Pro
Service Discovery Like a ProService Discovery Like a Pro
Service Discovery Like a Pro
 
Deploy and Destroy: Testing Environments - Michael Arenzon - DevOpsDays Tel A...
Deploy and Destroy: Testing Environments - Michael Arenzon - DevOpsDays Tel A...Deploy and Destroy: Testing Environments - Michael Arenzon - DevOpsDays Tel A...
Deploy and Destroy: Testing Environments - Michael Arenzon - DevOpsDays Tel A...
 
Design Summit - RESTful API Overview - John Hardy
Design Summit - RESTful API Overview - John HardyDesign Summit - RESTful API Overview - John Hardy
Design Summit - RESTful API Overview - John Hardy
 
Using and scaling Rack and Rack-based middleware
Using and scaling Rack and Rack-based middlewareUsing and scaling Rack and Rack-based middleware
Using and scaling Rack and Rack-based middleware
 
11 asp.net web api
11 asp.net web api11 asp.net web api
11 asp.net web api
 
Four Times Microservices - REST, Kubernetes, UI Integration, Async
Four Times Microservices - REST, Kubernetes, UI Integration, AsyncFour Times Microservices - REST, Kubernetes, UI Integration, Async
Four Times Microservices - REST, Kubernetes, UI Integration, Async
 
Adriano Di Luzio - Davvy - PyconSEI Talk
Adriano Di Luzio - Davvy - PyconSEI TalkAdriano Di Luzio - Davvy - PyconSEI Talk
Adriano Di Luzio - Davvy - PyconSEI Talk
 
Building Mobile Friendly APIs in Rails
Building Mobile Friendly APIs in RailsBuilding Mobile Friendly APIs in Rails
Building Mobile Friendly APIs in Rails
 
HTML5 tutorial: canvas, offfline & sockets
HTML5 tutorial: canvas, offfline & socketsHTML5 tutorial: canvas, offfline & sockets
HTML5 tutorial: canvas, offfline & sockets
 
Node.js Build, Deploy and Scale Webinar
Node.js Build, Deploy and Scale WebinarNode.js Build, Deploy and Scale Webinar
Node.js Build, Deploy and Scale Webinar
 
About REST & Symfony
About REST & SymfonyAbout REST & Symfony
About REST & Symfony
 
Unit 02: Web Technologies (2/2)
Unit 02: Web Technologies (2/2)Unit 02: Web Technologies (2/2)
Unit 02: Web Technologies (2/2)
 
Integrating with SAP FIX and HL7
Integrating with SAP FIX and HL7Integrating with SAP FIX and HL7
Integrating with SAP FIX and HL7
 
The Evolving Security Environment For Web Services
The Evolving Security Environment For Web ServicesThe Evolving Security Environment For Web Services
The Evolving Security Environment For Web Services
 
Building Web Services with Zend Framework (PHP Benelux meeting 20100713 Vliss...
Building Web Services with Zend Framework (PHP Benelux meeting 20100713 Vliss...Building Web Services with Zend Framework (PHP Benelux meeting 20100713 Vliss...
Building Web Services with Zend Framework (PHP Benelux meeting 20100713 Vliss...
 
Why we choose Symfony2
Why we choose Symfony2Why we choose Symfony2
Why we choose Symfony2
 
Running Microservices and Docker on AWS Elastic Beanstalk - August 2016 Month...
Running Microservices and Docker on AWS Elastic Beanstalk - August 2016 Month...Running Microservices and Docker on AWS Elastic Beanstalk - August 2016 Month...
Running Microservices and Docker on AWS Elastic Beanstalk - August 2016 Month...
 

Mais de Adrian Cole

HTTP/2 What's inside and Why
HTTP/2 What's inside and WhyHTTP/2 What's inside and Why
HTTP/2 What's inside and WhyAdrian Cole
 
Efficient HTTP Apis
Efficient HTTP ApisEfficient HTTP Apis
Efficient HTTP ApisAdrian Cole
 
Using and contributing to the next Guice
Using and contributing to the next GuiceUsing and contributing to the next Guice
Using and contributing to the next GuiceAdrian Cole
 
jclouds overview
jclouds overviewjclouds overview
jclouds overviewAdrian Cole
 
Living on the edge
Living on the edgeLiving on the edge
Living on the edgeAdrian Cole
 
When small problems become big problems
When small problems become big problemsWhen small problems become big problems
When small problems become big problemsAdrian Cole
 

Mais de Adrian Cole (6)

HTTP/2 What's inside and Why
HTTP/2 What's inside and WhyHTTP/2 What's inside and Why
HTTP/2 What's inside and Why
 
Efficient HTTP Apis
Efficient HTTP ApisEfficient HTTP Apis
Efficient HTTP Apis
 
Using and contributing to the next Guice
Using and contributing to the next GuiceUsing and contributing to the next Guice
Using and contributing to the next Guice
 
jclouds overview
jclouds overviewjclouds overview
jclouds overview
 
Living on the edge
Living on the edgeLiving on the edge
Living on the edge
 
When small problems become big problems
When small problems become big problemsWhen small problems become big problems
When small problems become big problems
 

Último

TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
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
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
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
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
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
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024The Digital Insurer
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
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
 
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
 
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
 
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
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Principled Technologies
 

Último (20)

TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
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?
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
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...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
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
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
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...
 
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
 
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
 
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...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 

I got 99 problems, but ReST ain't one

  • 1. > GET /problems/MONEY HTTP/1.1 I GOT 99 PROBLEMS > Host: localhost > Accept: */* < HTTP/1.1 200 OK > GET /problems/POWER HTTP/1.1 > Host: localhost BUT REST AINT ONE > Accept: */* < HTTP/1.1 200 OK > GET /problems/REST HTTP/1.1 > Host: localhost > Accept: */* @adrianfcole < HTTP/1.1 404 Not Found
  • 2. PROBLEMS ➡Why API ➡ReST vs other HTTP APIs? ➡Design Patterns vs Real APIs
  • 3. WHO IS THIS GUY? ๏ @adrianfcole ๏ architect CloudHub at MuleSoft ๏founder jclouds
  • 4. THANKS ★ api-craft ★ mattstep ★ gtcampbell ★ mulies
  • 5. WHY WE API photo copyright 2005 Sony Pictures
  • 7. HOW TO ReST SOAP API
  • 8. HOW TO ReST WS-* API
  • 9. HOW TO ReST ReST ish API
  • 10. HOW TO not-soap HATEOAS REST
  • 11. To the Level 0: Level 1: Swamp of POX Resources glory Level 2: Level 3: Verbs Hypermedia of REST
  • 12. > POST /api HTTP/1.1 > <SOAP-ENV:Envelope ...> <SOAP-ENV:Body> <m:getAvailableDataSources xmlns:m=" Swamp <group xsi:type="xsd:string">ArcWe <service xsi:type="xsd:string">Map <token xsi:type="xsd:string">MyTok </m:getAvailableDataSources> of POX </SOAP-ENV:Body> </SOAP-ENV:Envelope> < HTTP/1.1 200 OK < <?xml version="1.0" encoding="UTF-8"?> <soap:Envelope ...> <soap:Body> <n:getAvailableDataSourcesResponse x <Result href="#id0"/> </n:getAvailableDataSourcesResponse> All things go over the <id0 id="id0" soapenc:root="0" xsi:t soapenc:arrayType="ns5:DataSource[21]"> same endpoint as XML <i href="#id1"/> --snip--
  • 13. RESOURCES > GET https://ec2.amazonaws.com/?Action=DeleteVolume&VolumeId=vol-4282672b HTTP/1.1 < HTTP/1.1 200 OK <DeleteVolumeResponse xmlns="http://ec2.amazonaws.com/doc/2012-08-15/"> <requestId>59dbff89-35bd-4eac-99ed-be587EXAMPLE</requestId> <return>true</return> </DeleteVolumeResponse> --snip-- Many URIs, same HTTP method Side-effects are API-specific
  • 14. VERBS > HEAD https://mybucket.s3.amazonaws.com/ HTTP/1.1 < HTTP/1.1 200 OK HTTP verbs mean more than CRUD Status codes are meaningful
  • 15. HYPERMEDIA > GET https://vcloud/api/v1.0/catalogItem/1c01defe-1111-42ac-a50f-9dd4e03546 > Accept: application/vnd.vmware.vcloud.catalogItem+xml < HTTP/1.1 200 OK < Content-Type: application/vnd.vmware.vcloud.catalogItem+xml;version=1.0 <CatalogItem xmlns="http://www.vmware.com/vcloud/v1" name="mycatalog" type=" href="https://vcloud/api/v1.0/catalogItem/1c01defe-1111-42ac-a5 <Link rel="up" type="application/vnd.vmware.vcloud.catalog+xml" href="https://vcloud/api/v1.0/catalog/7f192dfe-00d1-42f2-9f76-9360 <Link rel="edit" type="application/vnd.vmware.vcloud.catalogItem+xml" href="https://vcloud/api/v1.0/catalogItem/1c01defe-1111-42ac-a50f- <Link rel="remove" href="https://vcloud/api/v1.0/catalogItem/1c01defe-1111-42ac-a50f-9 --snip-- Discoverability, Self-documenting
  • 16. What makes it HYPER? ➡Base Type ➡Links
  • 17. abort add alternate disk:attach TRANSITIONS edit remove task All transitions are discoverable via links
  • 18. CONTENT NEGOTIATION ➡ Client supplies representation in Accept header ➡On change, update mediatype name or annotate via ;version=N.N ➡On overhaul, bump global version Accept: application/vnd.VENDOR.PRODUCT.RESOURCE+xml
  • 19. Representing HyperMedia Extend Atom Opaque + Link Headers HAL ...
  • 20. EXTEND ATOM Vendor Type, Link elements < HTTP/1.1 200 OK < Content-Type: application/vnd.vmware.vcloud.catalogItem+xml;version=1.0 <CatalogItem xmlns="http://www.vmware.com/vcloud/v1" name="mycatalog" type=" href="https://vcloud/api/v1.0/catalogItem/1c01defe-1111-42ac-a5 <Link rel="up" type="application/vnd.vmware.vcloud.catalog+xml" href="https://vcloud/api/v1.0/catalog/7f192dfe-00d1-42f2-9f76-9360 <Link rel="edit" type="application/vnd.vmware.vcloud.catalogItem+xml" href="https://vcloud/api/v1.0/catalogItem/1c01defe-1111-42ac-a50f- <Link rel="remove" href="https://vcloud/api/v1.0/catalogItem/1c01defe-1111-42ac-a50f-9 --snip-- domain-specific types inherits link semantics from Atom
  • 21. Link Headers Opaque Type, Link elements < HTTP/1.1 200 OK < Content-Type: image/jpeg Link: </images/foo.png>; rel="alternate"; type=”image/png” 010101010101010101 --snip-- supports binary types facilitates intermediaries
  • 22. Hypertext Application Language Mix-in hypermedia controls into base type embed resources for efficiency < HTTP/1.1 200 OK < Content-Type: application/hal+json { _links: { self: { href: '/example', } }, _embedded: {}, name: 'foo', --snip-- domain-specific type agnostic
  • 23. ELEGENT clients always know transitions self-documenting LETS USE and discoverable version at HATEOAS media-type granularity
  • 25. Level 2 optimizes for Coarse Grained Versions CRUD++ Limited Representations Today’s Tools Simplicity over Elegance
  • 26. IS IT ALL JUST PRICKLES & GOO?
  • 27. can we have both?
  • 28. There Domain Style Base Format is no State Transfer Level2 App Flow Design plus stuff like errors
  • 29. REST Design tools ➡Apiary ➡Swagger ➡iodocs
  • 30. GOOD API DESIGNERS UNDERSTAND how it is used, and who will use it importance of iterations and feedback impacts to design beyond development there’s no golden hammer (not even mongo)
  • 31. TWITTER IS NOT HATEOAS REST SEARCH STREAM
  • 32. AWS IS NOT REST AWS IS GOOD api designed to parse quickly simple extension (add new key) consistent security model bulk ops
  • 33. WebSockets ain’t even HTTP! Handshake is HTTPish Discoverable like ReST Full-Duplex Uncode or Binary Messages TCP Protocol
  • 34. GOOD REST APIs Are consciously designed Version at the right scope Don’t leak implementation details Use auth models relevant to consumer Are well documented with examples
  • 35. What now? ➡join api-craft ➡read The REST API Design Handbook ➡read Building Hypermedia APIs... ➡socialize your ideas Thank you!

Notas do Editor

  1. \n
  2. we need to define what we are talking about, and then evaluate patterns\n
  3. \n
  4. \n
  5. Now that we are here, we underscore motivations to even bother with.\n
  6. A Web API Study: Hurwitz;\n leads to integration -&gt; stronger ecosystem -&gt; more value\n &gt; devices and applications in the ecosystem\n\n
  7. At first glance, we might think how to present an api is rest vs soap\n
  8. it might really be the aspects of WS-* that would make such a decision, such as WS-Security, AtomicTransaction, ReliableMessaging\n
  9. Say we chose, ReST.. the thing is that ReST means a lot to many people\n
  10. ends up being something between soap and hypertext driven\n
  11. Leonard Richardson circa 2008 Maturity Model\n
  12. Easiest example of POX is tunneling commands over a single http request/response paradigm\n
  13. many uris, but a single invocation method. operations might be encoded in parameters, and resource might be mixed in with them\n
  14. HEAD is metadata; PATCH is for update; PUT is replace; POST -&gt; RPC/create\natomicity underpins idempotence; by spec POST can affect multiple resources, but most others (except notably trace,options) only apply to the resource identified by the href\n
  15. \n
  16. \n
  17. HATEOAS is basically a state machine. Your responsibility is to not attempt any transition undefined in links\n
  18. New resources types can be added without breaking client, as can new fields/links\nabove pattern recommended by: Dan Feist\n\nOther option you can use is link with profile relation.\n
  19. There are other ways, too...\nxlink can decorate in namespace of xml, but doesn&amp;#x2019;t expose representations\ncollection+json is an interesting approach for managing collections (includes its own data format)\n
  20. \n
  21. ex. cache intermediaries http://tools.ietf.org/html/draft-nottingham-linked-cache-inv-03\n
  22. define domain-specific type using type link parameter, or via custom rel or profile link (preferred)\nhttp://tools.ietf.org/id/draft-kelly-json-hal\nalso supports templated urls such as queries\n
  23. \n
  24. sometimes domain models are well defined, so the added value may be lost on the user\n
  25. Leonard Richardson circa 2008 Maturity Model\n
  26. Prickles &amp; Goo: Alan Watts Trey Parker Matt Stone\nIs culture behind adoption of a particular rest approach? Even if the approach is correct, can you persuade devs to adopt something they don&amp;#x2019;t want?\n
  27. we are probably at various intervals on the same plane. more detail == overly complex. not enough == naive.\n
  28. Amundsen, Mike (2011-11-22). Building Hypermedia APIs with HTML5 and Node (p. 20). OReilly Media - A. Kindle Edition. \n
  29. http://apiary.io/ &lt; markdown extension describes behavior, generates mock and tests it\nhttp://swagger.wordnik.com/ &lt;- json describes resource, apis, models, generates many clients\nhttps://github.com/mashery/iodocs &lt;- json describes service, apis, creates javascript client\n
  30. database details such as pagination, etc\n\ntransition to a design that isn&amp;#x2019;t rest (aws)\n
  31. original has been around since 2008, latest update mainly addressed oauth and rate limiting changes; thanks Greg Campbell for insight; api is versioned as 1.1, but includes 3 distinct apis\naside: search can be modeled in HATEOAS, where POST is creation of search results, HEAD returns lifespan, etc\n\n
  32. Many amazon web services do not even follow type 2 classifications, yet they are widely adopted, and successful.. why is that? why do they not use rest?\n\ngurupa is the amazon http server, which is tuned for query parsing. language for extending it is simple (add a key), so parsing it to verify signature is just sort the keys and sign it.\n\nbulk ops like s3 multi-delete help deal with very large problems.\n
  33. Ex. ELB you have to use TCP/SSL as this is not a HTTP compatible protocol\nconsider impact for example lack of origin IP address, sticky session\nnew set of gateway products will emerge to support WebSockets\n
  34. database details such as pagination, etc\n
  35. \n