SlideShare uma empresa Scribd logo
1 de 34
How (not) to write an API

                              Jakub Nešetřil



Wednesday, September 26, 12
apiary.io

Wednesday, September 26, 12
API?




                                                                                  apiary.io
                                source: http://www.flickr.com/photos/21496790@N06/5065834411
Wednesday, September 26, 12
API?




                                                                                   apiary.io
                                     source: http://www.flickr.com/photos/daddo83/3406962115/
Wednesday, September 26, 12
API?




                                                                                       apiary.io
                                     source: http://www.flickr.com/photos/ecstaticist/3570660643/
Wednesday, September 26, 12
RPC




                                                                                  apiary.io
                                source: http://www.flickr.com/photos/jasleen_kaur/5075553223
Wednesday, September 26, 12
<?xml version="1.0"?>
  <methodCall>
    <methodName>examples.getUser</methodName>
    <params>
      <param>
          <value><i4>102</i4></value>
      </param>
    </params>
  </methodCall>



  <?xml version="1.0"?>
  <methodResponse>
    <params>
      <param>
          <value><string>John Doe</string></value>
      </param>
    </params>
  </methodResponse>

                                                     apiary.io

Wednesday, September 26, 12
SOAP




                                                                                   apiary.io
                                 source: http://www.flickr.com/photos/jasleen_kaur/5075553223
Wednesday, September 26, 12
POST /InStock HTTP/1.1
  Host: www.example.org
  Content-Type: application/soap+xml; charset=utf-8
  Content-Length: 299
  SOAPAction: "http://www.w3.org/2003/05/soap-envelope"

  <?xml version="1.0"?>
  <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
    <soap:Header>
    </soap:Header>
    <soap:Body>
      <m:GetUser xmlns:m="http://www.example.org/user">
        <m:Name>John Doe</m:Name>
      </m:GetUser>
    </soap:Body>
  </soap:Envelope>




                                                                 apiary.io

Wednesday, September 26, 12
REST




                                                                                   apiary.io
                                     source: http://www.flickr.com/photos/tambako/6992962266/
Wednesday, September 26, 12
GET /users/?name=John%20Doe HTTP/1.1
  Content-Type: application/json; charset=utf-8




  200 OK

  [{
       name: {
         first: "John",
         last: "Doe"
       }
  }]




                                                  apiary.io

Wednesday, September 26, 12
POPULAR




                                                                                     apiary.io
                                   source: http://www.flickr.com/photos/keithallison/6327068376
Wednesday, September 26, 12
NO PROTOCOL




                                                                                       apiary.io
                                    source: http://www.flickr.com/photos/24298372@N04/3370859327/
Wednesday, September 26, 12
ORTHODOX BELIEVERS




                                                                                  apiary.io
                               source: http://www.flickr.com/photos/45818813@N05/4785640636/
Wednesday, September 26, 12
PURITY WARS




                                                                                       apiary.io
                                    source: http://www.flickr.com/photos/davidkingham/3661515844/
Wednesday, September 26, 12
HOW TO WRITE AN API?




                                                                                 apiary.io
                               source: http://www.flickr.com/photos/21496790@N06/5065834411
Wednesday, September 26, 12
EVERY API IS DIFFERENT



                                                                                 apiary.io
                               source: http://www.flickr.com/photos/marinacast/2255974192/
Wednesday, September 26, 12
Latency?




                                         apiary.io

Wednesday, September 26, 12
Mobile?


                              Latency?




                                            apiary.io

Wednesday, September 26, 12
s?       Mobile?
                         ox ie
                       Pr

                                    Latency?




                                                  apiary.io

Wednesday, September 26, 12
s?       Mobile?
                         ox ie
                       Pr                    Caching
                                                    ?
                                    Latency?




                                                        apiary.io

Wednesday, September 26, 12
s?       Mobile?
                         ox ie
                       Pr                    Caching
                                                    ?
                                    Latency?

                                           Interactive?

                                                          apiary.io

Wednesday, September 26, 12
s?       Mobile?
                         ox ie
                       Pr                    Caching
                                                    ?
                                    Latency?

                                           Interactive?
                   Data size?

                                                          apiary.io

Wednesday, September 26, 12
apiary.io
                              source: http://www.flickr.com/photos/freeflyer09/7460144118
Wednesday, September 26, 12
EXPERIMENT




                                                                                   apiary.io
                                     source: http://www.flickr.com/photos/samipii/7590121284/
Wednesday, September 26, 12
apiary.io
                              source: http://www.flickr.com/photos/samipii/7590121284/
Wednesday, September 26, 12
RESULTS




                                                                                    apiary.io
                                  source: http://www.flickr.com/photos/eisenbahner/3697448759/
Wednesday, September 26, 12
Mock > Use > Implement




                                                       apiary.io

Wednesday, September 26, 12
Mock > Use > Implement




                                                       apiary.io

Wednesday, September 26, 12
apiary.io

Wednesday, September 26, 12
Mock > Use > Implement




                                                       apiary.io

Wednesday, September 26, 12
Documentation
      Automated Testing


                              Mock > Use > Implement




                                                       apiary.io

Wednesday, September 26, 12
source: http://www.flickr.com/photos/lorenia/3464878271/
Wednesday, September 26, 12
Q&A
                              E-MAIL   jakub@apiary.io   TWITTER   @apiaryio




Wednesday, September 26, 12

Mais conteúdo relacionado

Mais de WebExpo

Ameya Kanitkar: Using Hadoop and HBase to Personalize Web, Mobile and Email E...
Ameya Kanitkar: Using Hadoop and HBase to Personalize Web, Mobile and Email E...Ameya Kanitkar: Using Hadoop and HBase to Personalize Web, Mobile and Email E...
Ameya Kanitkar: Using Hadoop and HBase to Personalize Web, Mobile and Email E...WebExpo
 
Marli Mesibov - What's in a Story?
Marli Mesibov - What's in a Story?Marli Mesibov - What's in a Story?
Marli Mesibov - What's in a Story?WebExpo
 
Tomáš Procházka: Moje zápisky z designu
Tomáš Procházka: Moje zápisky z designuTomáš Procházka: Moje zápisky z designu
Tomáš Procházka: Moje zápisky z designuWebExpo
 
Jiří Knesl: Souboj frameworků
Jiří Knesl: Souboj frameworkůJiří Knesl: Souboj frameworků
Jiří Knesl: Souboj frameworkůWebExpo
 
Richard Fridrich: Buď punkový konzument!
Richard Fridrich: Buď punkový konzument!Richard Fridrich: Buď punkový konzument!
Richard Fridrich: Buď punkový konzument!WebExpo
 
Michal Blažej: Zbavte sa account managementu
Michal Blažej: Zbavte sa account managementuMichal Blažej: Zbavte sa account managementu
Michal Blažej: Zbavte sa account managementuWebExpo
 
Denisa Lorencová: UX Designer - Anděl s ďáblem v těle
Denisa Lorencová: UX Designer - Anděl s ďáblem v těleDenisa Lorencová: UX Designer - Anděl s ďáblem v těle
Denisa Lorencová: UX Designer - Anděl s ďáblem v těleWebExpo
 
Petr Ludwig: Jak bojovat s prokrastinací?
Petr Ludwig: Jak bojovat s prokrastinací?Petr Ludwig: Jak bojovat s prokrastinací?
Petr Ludwig: Jak bojovat s prokrastinací?WebExpo
 
Jan Vlček: Gamifikace 101
Jan Vlček: Gamifikace 101Jan Vlček: Gamifikace 101
Jan Vlček: Gamifikace 101WebExpo
 
Luke Wroblewski: Mobile First
Luke Wroblewski: Mobile FirstLuke Wroblewski: Mobile First
Luke Wroblewski: Mobile FirstWebExpo
 
Adam Hrubý: Evoluce designéra
Adam Hrubý: Evoluce designéraAdam Hrubý: Evoluce designéra
Adam Hrubý: Evoluce designéraWebExpo
 
Jan Sotorník: Grafika e-shopu jako sexy a chytrá prodavačka
Jan Sotorník: Grafika e-shopu jako sexy a chytrá prodavačkaJan Sotorník: Grafika e-shopu jako sexy a chytrá prodavačka
Jan Sotorník: Grafika e-shopu jako sexy a chytrá prodavačkaWebExpo
 
Jana Štěpánová: Neziskovky Goes Web
Jana Štěpánová: Neziskovky Goes WebJana Štěpánová: Neziskovky Goes Web
Jana Štěpánová: Neziskovky Goes WebWebExpo
 
Douglas Crockford: Serversideness
Douglas Crockford: ServersidenessDouglas Crockford: Serversideness
Douglas Crockford: ServersidenessWebExpo
 
Richard Fridrich: 5 x *, * a */5
Richard Fridrich: 5 x *, * a */5Richard Fridrich: 5 x *, * a */5
Richard Fridrich: 5 x *, * a */5WebExpo
 
Jiří Močička: Design as Storytelling
Jiří Močička: Design as StorytellingJiří Močička: Design as Storytelling
Jiří Močička: Design as StorytellingWebExpo
 
David Hussman - Products and People over Process and Dogma
David Hussman - Products and People over Process and DogmaDavid Hussman - Products and People over Process and Dogma
David Hussman - Products and People over Process and DogmaWebExpo
 
Petr Dvořák: Mobilní webové služby pohledem iPhone developera
Petr Dvořák: Mobilní webové služby pohledem iPhone developeraPetr Dvořák: Mobilní webové služby pohledem iPhone developera
Petr Dvořák: Mobilní webové služby pohledem iPhone developeraWebExpo
 
Martin Hujer: PHP ve Windows Azure cloudu
Martin Hujer: PHP ve Windows Azure clouduMartin Hujer: PHP ve Windows Azure cloudu
Martin Hujer: PHP ve Windows Azure clouduWebExpo
 
Lukáš Zaplatílek: Kašlete na uživatele
Lukáš Zaplatílek: Kašlete na uživateleLukáš Zaplatílek: Kašlete na uživatele
Lukáš Zaplatílek: Kašlete na uživateleWebExpo
 

Mais de WebExpo (20)

Ameya Kanitkar: Using Hadoop and HBase to Personalize Web, Mobile and Email E...
Ameya Kanitkar: Using Hadoop and HBase to Personalize Web, Mobile and Email E...Ameya Kanitkar: Using Hadoop and HBase to Personalize Web, Mobile and Email E...
Ameya Kanitkar: Using Hadoop and HBase to Personalize Web, Mobile and Email E...
 
Marli Mesibov - What's in a Story?
Marli Mesibov - What's in a Story?Marli Mesibov - What's in a Story?
Marli Mesibov - What's in a Story?
 
Tomáš Procházka: Moje zápisky z designu
Tomáš Procházka: Moje zápisky z designuTomáš Procházka: Moje zápisky z designu
Tomáš Procházka: Moje zápisky z designu
 
Jiří Knesl: Souboj frameworků
Jiří Knesl: Souboj frameworkůJiří Knesl: Souboj frameworků
Jiří Knesl: Souboj frameworků
 
Richard Fridrich: Buď punkový konzument!
Richard Fridrich: Buď punkový konzument!Richard Fridrich: Buď punkový konzument!
Richard Fridrich: Buď punkový konzument!
 
Michal Blažej: Zbavte sa account managementu
Michal Blažej: Zbavte sa account managementuMichal Blažej: Zbavte sa account managementu
Michal Blažej: Zbavte sa account managementu
 
Denisa Lorencová: UX Designer - Anděl s ďáblem v těle
Denisa Lorencová: UX Designer - Anděl s ďáblem v těleDenisa Lorencová: UX Designer - Anděl s ďáblem v těle
Denisa Lorencová: UX Designer - Anděl s ďáblem v těle
 
Petr Ludwig: Jak bojovat s prokrastinací?
Petr Ludwig: Jak bojovat s prokrastinací?Petr Ludwig: Jak bojovat s prokrastinací?
Petr Ludwig: Jak bojovat s prokrastinací?
 
Jan Vlček: Gamifikace 101
Jan Vlček: Gamifikace 101Jan Vlček: Gamifikace 101
Jan Vlček: Gamifikace 101
 
Luke Wroblewski: Mobile First
Luke Wroblewski: Mobile FirstLuke Wroblewski: Mobile First
Luke Wroblewski: Mobile First
 
Adam Hrubý: Evoluce designéra
Adam Hrubý: Evoluce designéraAdam Hrubý: Evoluce designéra
Adam Hrubý: Evoluce designéra
 
Jan Sotorník: Grafika e-shopu jako sexy a chytrá prodavačka
Jan Sotorník: Grafika e-shopu jako sexy a chytrá prodavačkaJan Sotorník: Grafika e-shopu jako sexy a chytrá prodavačka
Jan Sotorník: Grafika e-shopu jako sexy a chytrá prodavačka
 
Jana Štěpánová: Neziskovky Goes Web
Jana Štěpánová: Neziskovky Goes WebJana Štěpánová: Neziskovky Goes Web
Jana Štěpánová: Neziskovky Goes Web
 
Douglas Crockford: Serversideness
Douglas Crockford: ServersidenessDouglas Crockford: Serversideness
Douglas Crockford: Serversideness
 
Richard Fridrich: 5 x *, * a */5
Richard Fridrich: 5 x *, * a */5Richard Fridrich: 5 x *, * a */5
Richard Fridrich: 5 x *, * a */5
 
Jiří Močička: Design as Storytelling
Jiří Močička: Design as StorytellingJiří Močička: Design as Storytelling
Jiří Močička: Design as Storytelling
 
David Hussman - Products and People over Process and Dogma
David Hussman - Products and People over Process and DogmaDavid Hussman - Products and People over Process and Dogma
David Hussman - Products and People over Process and Dogma
 
Petr Dvořák: Mobilní webové služby pohledem iPhone developera
Petr Dvořák: Mobilní webové služby pohledem iPhone developeraPetr Dvořák: Mobilní webové služby pohledem iPhone developera
Petr Dvořák: Mobilní webové služby pohledem iPhone developera
 
Martin Hujer: PHP ve Windows Azure cloudu
Martin Hujer: PHP ve Windows Azure clouduMartin Hujer: PHP ve Windows Azure cloudu
Martin Hujer: PHP ve Windows Azure cloudu
 
Lukáš Zaplatílek: Kašlete na uživatele
Lukáš Zaplatílek: Kašlete na uživateleLukáš Zaplatílek: Kašlete na uživatele
Lukáš Zaplatílek: Kašlete na uživatele
 

Último

Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructureitnewsafrica
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxfnnc6jmgwh
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 

Último (20)

Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 

Jakub Nešetřil: Jak (ne)dělat API

  • 1. How (not) to write an API Jakub Nešetřil Wednesday, September 26, 12
  • 3. API? apiary.io source: http://www.flickr.com/photos/21496790@N06/5065834411 Wednesday, September 26, 12
  • 4. API? apiary.io source: http://www.flickr.com/photos/daddo83/3406962115/ Wednesday, September 26, 12
  • 5. API? apiary.io source: http://www.flickr.com/photos/ecstaticist/3570660643/ Wednesday, September 26, 12
  • 6. RPC apiary.io source: http://www.flickr.com/photos/jasleen_kaur/5075553223 Wednesday, September 26, 12
  • 7. <?xml version="1.0"?> <methodCall> <methodName>examples.getUser</methodName> <params> <param> <value><i4>102</i4></value> </param> </params> </methodCall> <?xml version="1.0"?> <methodResponse> <params> <param> <value><string>John Doe</string></value> </param> </params> </methodResponse> apiary.io Wednesday, September 26, 12
  • 8. SOAP apiary.io source: http://www.flickr.com/photos/jasleen_kaur/5075553223 Wednesday, September 26, 12
  • 9. POST /InStock HTTP/1.1 Host: www.example.org Content-Type: application/soap+xml; charset=utf-8 Content-Length: 299 SOAPAction: "http://www.w3.org/2003/05/soap-envelope" <?xml version="1.0"?> <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"> <soap:Header> </soap:Header> <soap:Body> <m:GetUser xmlns:m="http://www.example.org/user"> <m:Name>John Doe</m:Name> </m:GetUser> </soap:Body> </soap:Envelope> apiary.io Wednesday, September 26, 12
  • 10. REST apiary.io source: http://www.flickr.com/photos/tambako/6992962266/ Wednesday, September 26, 12
  • 11. GET /users/?name=John%20Doe HTTP/1.1 Content-Type: application/json; charset=utf-8 200 OK [{ name: { first: "John", last: "Doe" } }] apiary.io Wednesday, September 26, 12
  • 12. POPULAR apiary.io source: http://www.flickr.com/photos/keithallison/6327068376 Wednesday, September 26, 12
  • 13. NO PROTOCOL apiary.io source: http://www.flickr.com/photos/24298372@N04/3370859327/ Wednesday, September 26, 12
  • 14. ORTHODOX BELIEVERS apiary.io source: http://www.flickr.com/photos/45818813@N05/4785640636/ Wednesday, September 26, 12
  • 15. PURITY WARS apiary.io source: http://www.flickr.com/photos/davidkingham/3661515844/ Wednesday, September 26, 12
  • 16. HOW TO WRITE AN API? apiary.io source: http://www.flickr.com/photos/21496790@N06/5065834411 Wednesday, September 26, 12
  • 17. EVERY API IS DIFFERENT apiary.io source: http://www.flickr.com/photos/marinacast/2255974192/ Wednesday, September 26, 12
  • 18. Latency? apiary.io Wednesday, September 26, 12
  • 19. Mobile? Latency? apiary.io Wednesday, September 26, 12
  • 20. s? Mobile? ox ie Pr Latency? apiary.io Wednesday, September 26, 12
  • 21. s? Mobile? ox ie Pr Caching ? Latency? apiary.io Wednesday, September 26, 12
  • 22. s? Mobile? ox ie Pr Caching ? Latency? Interactive? apiary.io Wednesday, September 26, 12
  • 23. s? Mobile? ox ie Pr Caching ? Latency? Interactive? Data size? apiary.io Wednesday, September 26, 12
  • 24. apiary.io source: http://www.flickr.com/photos/freeflyer09/7460144118 Wednesday, September 26, 12
  • 25. EXPERIMENT apiary.io source: http://www.flickr.com/photos/samipii/7590121284/ Wednesday, September 26, 12
  • 26. apiary.io source: http://www.flickr.com/photos/samipii/7590121284/ Wednesday, September 26, 12
  • 27. RESULTS apiary.io source: http://www.flickr.com/photos/eisenbahner/3697448759/ Wednesday, September 26, 12
  • 28. Mock > Use > Implement apiary.io Wednesday, September 26, 12
  • 29. Mock > Use > Implement apiary.io Wednesday, September 26, 12
  • 31. Mock > Use > Implement apiary.io Wednesday, September 26, 12
  • 32. Documentation Automated Testing Mock > Use > Implement apiary.io Wednesday, September 26, 12
  • 34. Q&A E-MAIL jakub@apiary.io TWITTER @apiaryio Wednesday, September 26, 12