SlideShare a Scribd company logo
1 of 108
Download to read offline
API Design Methodology
Mike Amundsen,
CA / Layer7
@mamund
Introduction
Actually, we have a
methodology already...
Design Guidelines
● Craft [good/pretty/usable/stable] URIs
Design Guidelines
● Craft [good/pretty/usable/stable] URIs
● Map domain actions to HTTP methods (CRUD)
Design Guidelines
● Craft [good/pretty/usable/stable] URIs
● Map domain actions to HTTP methods (CRUD)
● Use the proper HTTP Status Codes
Design Guidelines
● Craft [good/pretty/usable/stable] URIs
● Map domain actions to HTTP methods (CRUD)
● Use the proper HTTP Status Codes
● Document serialized objects as HTTP bodies
Design Guidelines
● Craft [good/pretty/usable/stable] URIs
● Map domain actions to HTTP methods (CRUD)
● Use the proper HTTP Status Codes
● Document serialized objects as HTTP bodies
● Use HTTP headers responsibly
Design Guidelines
● Craft [good/pretty/usable/stable] URIs
● Map domain actions to HTTP methods (CRUD)
● Use the proper HTTP Status Codes
● Document serialized objects as HTTP bodies
● Use HTTP headers responsibly
● Describe edge cases (async, errors, authN/Z)
But there's a problem here...
Those are not design guidelines..
They are implementation guidelines!
Ok, so what is a design
methodology, then?
Here's a simple seven-step
procedure...
Here's a simple seven-step
procedure...
Let's design a Maze game API
1. List the Semantic Descriptors
1. List the Semantic Descriptors
(the what?)
1. List the Semantic Descriptors
(the what?)
You know, the stuff!
1. List the Semantic Descriptors
● A maze
● A maze cell
● A switch
● Switch position ("up" or "down")
● The title of a maze cell
● A doorway connecting to cells
● An exit from the maze
● A list of mazes
2. Draw a State Diagram
3. Reconcile Names
3. Reconcile Names
● IANA Link Relation Values
● schema.org
● microformats
● Dublin Core
● Activity Streams
3. Reconcile Names
● maze
● start
● current
● exit
● north, south, east, west
● switch
● flip
3. Reconcile Names
● maze
● start (IANA)
● current (IANA)
● exit
● north, south, east, west
● switch
● flip
3. Reconcile Names
● maze
● start (IANA)
● current (IANA)
● exit (microformats)
● north, south, east, west (microformats)
● switch
● flip
3. Reconcile Names
● maze
● start (IANA)
● current (IANA)
● exit (microformats)
● north, south, east, west (microformats)
● switch
● flip edit (IANA)
3. Reconcile Names
● http://mamund.com/rels/maze (RFC5988)
● start (IANA)
● current (IANA)
● exit (microformats)
● north, south, east, west (microformats)
● http://mamund.com.rels/switch (RFC5988)
● flip edit (IANA)
3. Reconcile Names
● IANA
o edit
o start
o current
● microformats
o exit
o north, south, east, west
● RFC5988
o http://mamund.com/rels/switch
o http://mamund.com/rels/maze
OK, that was the design part...
But I still need to implement it,
right?
4. Choose a Media Type
4. Choose a Media Type
● Use application/json, application/xml
● Collection type: Atom, OData, Collection+JSON
● Free-form: HTML, Siren, HAL, JSON-LD
● Invent your own semantic type
4. Choose a Media Type
● Use application/json, application/xml
● Collection type: Atom, OData, Collection+JSON
● Free-form: HTML, Siren, HAL, JSON-LD
● Invent your own semantic type
4. Choose a Media Type
● Use application/json, application/xml
● Collection type: Atom, OData, Collection+JSON
● Free-form: HTML, Siren, HAL, JSON-LD
● Invent your own semantic type
4. Choose a Media Type
● Use application/json, application/xml
● Collection type: Atom, OData, Collection+JSON
● Free-form: HTML, Siren, HAL, JSON-LD
● Invent your own semantic type
4. Choose a Media Type
● Use application/json, application/xml
● Collection type: Atom, OData, Collection+JSON
● Free-form: HTML, Siren, HAL, JSON-LD
● Invent your own semantic type
Collection+JSON
UBER+xml
MAZE+xml
5. Write a Profile
6. Implementation
6. Implementation
ta-da!
And now we have running code!
Wait, what's step seven?
7. Publication
7. Publication
● Publish your "billboard" URL
● Publish your profile
● Register new rel values and/or media types
● Publish the documentation
● Consider "well-known" URIs
Now, you're done!
Seven Simple Steps
1. List the Semantic Descriptors
2. Draw a State Diagram
3. Reconcile Names
4. Write a Profile
5. Select a Media Type
6. Implementation
7. Publication
Some Final Advice
Resources are an
implementation detail
Don't fall into the collection trap
Don't start with the
representation format
URL design doesn't matter
Standard names are probably better
than yours.
Don't keep all the hypermedia
in one place
Some Final Advice
● Resources are implementation details
● Don't fall into the collection trap
● Don't start w/ the representation format
● URL design doesn't matter
● Standard names are probably better than
yours
● Don't keep all the hypermedia in one place
In Conclusion...
In Conclusion...
● Don't confuse implementation w/ design
● Design is the hard part (high value)
● Implementation is the easy part (high speed)
● Avoid common design mistakes
● Go out and make lots of APIs!
API Design Methodology
Mike Amundsen,
CA / Layer7
@mamund

More Related Content

What's hot

What's hot (20)

gRPC Overview
gRPC OverviewgRPC Overview
gRPC Overview
 
Microservices Docker Kubernetes Istio Kanban DevOps SRE
Microservices Docker Kubernetes Istio Kanban DevOps SREMicroservices Docker Kubernetes Istio Kanban DevOps SRE
Microservices Docker Kubernetes Istio Kanban DevOps SRE
 
Deployment Patterns in WSO2 Enterprise Integrator
Deployment Patterns in WSO2 Enterprise IntegratorDeployment Patterns in WSO2 Enterprise Integrator
Deployment Patterns in WSO2 Enterprise Integrator
 
The Patterns of Distributed Logging and Containers
The Patterns of Distributed Logging and ContainersThe Patterns of Distributed Logging and Containers
The Patterns of Distributed Logging and Containers
 
Google Cloud and Data Pipeline Patterns
Google Cloud and Data Pipeline PatternsGoogle Cloud and Data Pipeline Patterns
Google Cloud and Data Pipeline Patterns
 
Event Sourcing & CQRS, Kafka, Rabbit MQ
Event Sourcing & CQRS, Kafka, Rabbit MQEvent Sourcing & CQRS, Kafka, Rabbit MQ
Event Sourcing & CQRS, Kafka, Rabbit MQ
 
The basics of fluentd
The basics of fluentdThe basics of fluentd
The basics of fluentd
 
gRPC - RPC rebirth?
gRPC - RPC rebirth?gRPC - RPC rebirth?
gRPC - RPC rebirth?
 
D2 domain driven-design
D2 domain driven-designD2 domain driven-design
D2 domain driven-design
 
Intro to open source observability with grafana, prometheus, loki, and tempo(...
Intro to open source observability with grafana, prometheus, loki, and tempo(...Intro to open source observability with grafana, prometheus, loki, and tempo(...
Intro to open source observability with grafana, prometheus, loki, and tempo(...
 
Spring Native and Spring AOT
Spring Native and Spring AOTSpring Native and Spring AOT
Spring Native and Spring AOT
 
High Performance Systems in Go - GopherCon 2014
High Performance Systems in Go - GopherCon 2014High Performance Systems in Go - GopherCon 2014
High Performance Systems in Go - GopherCon 2014
 
Kafka + Uber- The World’s Realtime Transit Infrastructure, Aaron Schildkrout
Kafka + Uber- The World’s Realtime Transit Infrastructure, Aaron SchildkroutKafka + Uber- The World’s Realtime Transit Infrastructure, Aaron Schildkrout
Kafka + Uber- The World’s Realtime Transit Infrastructure, Aaron Schildkrout
 
Microservices Architecture Part 2 Event Sourcing and Saga
Microservices Architecture Part 2 Event Sourcing and SagaMicroservices Architecture Part 2 Event Sourcing and Saga
Microservices Architecture Part 2 Event Sourcing and Saga
 
gRPC and Microservices
gRPC and MicroservicesgRPC and Microservices
gRPC and Microservices
 
CQRS and Event Sourcing, An Alternative Architecture for DDD
CQRS and Event Sourcing, An Alternative Architecture for DDDCQRS and Event Sourcing, An Alternative Architecture for DDD
CQRS and Event Sourcing, An Alternative Architecture for DDD
 
OpenAPI and gRPC Side by-Side
OpenAPI and gRPC Side by-SideOpenAPI and gRPC Side by-Side
OpenAPI and gRPC Side by-Side
 
Big Data Architecture
Big Data ArchitectureBig Data Architecture
Big Data Architecture
 
Kubernetes Architecture - beyond a black box - Part 1
Kubernetes Architecture - beyond a black box - Part 1Kubernetes Architecture - beyond a black box - Part 1
Kubernetes Architecture - beyond a black box - Part 1
 
From airflow to google cloud composer
From airflow to google cloud composerFrom airflow to google cloud composer
From airflow to google cloud composer
 

Viewers also liked

Onion Architecture
Onion ArchitectureOnion Architecture
Onion Architecture
matthidinger
 

Viewers also liked (9)

Domain Driven Design Through Onion Architecture
Domain Driven Design Through Onion ArchitectureDomain Driven Design Through Onion Architecture
Domain Driven Design Through Onion Architecture
 
Applying Domain-Driven Design to APIs and Microservices - Austin API Meetup
Applying Domain-Driven Design to APIs and Microservices  - Austin API MeetupApplying Domain-Driven Design to APIs and Microservices  - Austin API Meetup
Applying Domain-Driven Design to APIs and Microservices - Austin API Meetup
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
Onion Architecture
Onion ArchitectureOnion Architecture
Onion Architecture
 
The Architecture of an API Platform
The Architecture of an API PlatformThe Architecture of an API Platform
The Architecture of an API Platform
 
Api architectures for the modern enterprise
Api architectures for the modern enterpriseApi architectures for the modern enterprise
Api architectures for the modern enterprise
 
Domain Driven Design using Laravel
Domain Driven Design using LaravelDomain Driven Design using Laravel
Domain Driven Design using Laravel
 
Designing APIs and Microservices Using Domain-Driven Design
Designing APIs and Microservices Using Domain-Driven DesignDesigning APIs and Microservices Using Domain-Driven Design
Designing APIs and Microservices Using Domain-Driven Design
 
Software Design Patterns in Laravel by Phill Sparks
Software Design Patterns in Laravel by Phill SparksSoftware Design Patterns in Laravel by Phill Sparks
Software Design Patterns in Laravel by Phill Sparks
 

Similar to API Design Methodology - Mike Amundsen, Director of API Architecture, API Academy @ APIdays Sydney

Document Object Model
Document Object ModelDocument Object Model
Document Object Model
chomas kandar
 

Similar to API Design Methodology - Mike Amundsen, Director of API Architecture, API Academy @ APIdays Sydney (20)

01 html-introduction
01 html-introduction01 html-introduction
01 html-introduction
 
Asynchronous single page applications without a line of HTML or Javascript, o...
Asynchronous single page applications without a line of HTML or Javascript, o...Asynchronous single page applications without a line of HTML or Javascript, o...
Asynchronous single page applications without a line of HTML or Javascript, o...
 
Dust.js
Dust.jsDust.js
Dust.js
 
Web development basics (Part-3)
Web development basics (Part-3)Web development basics (Part-3)
Web development basics (Part-3)
 
Your First Scala Web Application using Play 2.1
Your First Scala Web Application using Play 2.1Your First Scala Web Application using Play 2.1
Your First Scala Web Application using Play 2.1
 
Performance (browser)
Performance (browser)Performance (browser)
Performance (browser)
 
Dart the Better JavaScript
Dart the Better JavaScriptDart the Better JavaScript
Dart the Better JavaScript
 
Document Object Model
Document Object ModelDocument Object Model
Document Object Model
 
Document Object Model
Document Object ModelDocument Object Model
Document Object Model
 
RoR 101: Session 1
RoR 101: Session 1RoR 101: Session 1
RoR 101: Session 1
 
Getting Started with Rails
Getting Started with RailsGetting Started with Rails
Getting Started with Rails
 
Scraping the web with Laravel, Dusk, Docker, and PHP
Scraping the web with Laravel, Dusk, Docker, and PHPScraping the web with Laravel, Dusk, Docker, and PHP
Scraping the web with Laravel, Dusk, Docker, and PHP
 
Node.js streams talk
Node.js streams talkNode.js streams talk
Node.js streams talk
 
Intro to web scraping with Python
Intro to web scraping with PythonIntro to web scraping with Python
Intro to web scraping with Python
 
Killing the Angle Bracket
Killing the Angle BracketKilling the Angle Bracket
Killing the Angle Bracket
 
django
djangodjango
django
 
Python ScrapingPresentation for dummy.pptx
Python ScrapingPresentation for dummy.pptxPython ScrapingPresentation for dummy.pptx
Python ScrapingPresentation for dummy.pptx
 
Microservices in Scala: Spray
Microservices in Scala: SprayMicroservices in Scala: Spray
Microservices in Scala: Spray
 
Scio - A Scala API for Google Cloud Dataflow & Apache Beam
Scio - A Scala API for Google Cloud Dataflow & Apache BeamScio - A Scala API for Google Cloud Dataflow & Apache Beam
Scio - A Scala API for Google Cloud Dataflow & Apache Beam
 
Sinatra and JSONQuery Web Service
Sinatra and JSONQuery Web ServiceSinatra and JSONQuery Web Service
Sinatra and JSONQuery Web Service
 

More from CA API Management

5 steps end to end security consumer apps
5 steps end to end security consumer apps5 steps end to end security consumer apps
5 steps end to end security consumer apps
CA API Management
 

More from CA API Management (20)

Mastering Digital Channels with APIs
Mastering Digital Channels with APIsMastering Digital Channels with APIs
Mastering Digital Channels with APIs
 
Takeaways from API Security Breaches Webinar
Takeaways from API Security Breaches WebinarTakeaways from API Security Breaches Webinar
Takeaways from API Security Breaches Webinar
 
Liberating the API Economy with Scale-Free Networks - Mike Amundsen, Director...
Liberating the API Economy with Scale-Free Networks - Mike Amundsen, Director...Liberating the API Economy with Scale-Free Networks - Mike Amundsen, Director...
Liberating the API Economy with Scale-Free Networks - Mike Amundsen, Director...
 
API360 – A How-To Guide for Enterprise APIs - Learn how to position your ente...
API360 – A How-To Guide for Enterprise APIs - Learn how to position your ente...API360 – A How-To Guide for Enterprise APIs - Learn how to position your ente...
API360 – A How-To Guide for Enterprise APIs - Learn how to position your ente...
 
API Monetization: Unlock the Value of Your Data
API Monetization: Unlock the Value of Your DataAPI Monetization: Unlock the Value of Your Data
API Monetization: Unlock the Value of Your Data
 
Revisiting Geddes' Outlook Tower - Mike Amundsen, Director of API Architectur...
Revisiting Geddes' Outlook Tower - Mike Amundsen, Director of API Architectur...Revisiting Geddes' Outlook Tower - Mike Amundsen, Director of API Architectur...
Revisiting Geddes' Outlook Tower - Mike Amundsen, Director of API Architectur...
 
Managing Identity by Giving Up Control - Scott Morrison, SVP & Distinguished ...
Managing Identity by Giving Up Control - Scott Morrison, SVP & Distinguished ...Managing Identity by Giving Up Control - Scott Morrison, SVP & Distinguished ...
Managing Identity by Giving Up Control - Scott Morrison, SVP & Distinguished ...
 
Enabling the Multi-Device Universe
Enabling the Multi-Device UniverseEnabling the Multi-Device Universe
Enabling the Multi-Device Universe
 
Building APIs That Last for Decades - Irakli Nadareishvili, Director of API S...
Building APIs That Last for Decades - Irakli Nadareishvili, Director of API S...Building APIs That Last for Decades - Irakli Nadareishvili, Director of API S...
Building APIs That Last for Decades - Irakli Nadareishvili, Director of API S...
 
The Art of API Design - Ronnie Mitra, Director of API Design, API Academy at ...
The Art of API Design - Ronnie Mitra, Director of API Design, API Academy at ...The Art of API Design - Ronnie Mitra, Director of API Design, API Academy at ...
The Art of API Design - Ronnie Mitra, Director of API Design, API Academy at ...
 
APIs Fueling the Connected Car Opportunity - Scott Morrison, SVP & Distinguis...
APIs Fueling the Connected Car Opportunity - Scott Morrison, SVP & Distinguis...APIs Fueling the Connected Car Opportunity - Scott Morrison, SVP & Distinguis...
APIs Fueling the Connected Car Opportunity - Scott Morrison, SVP & Distinguis...
 
Adapting to Digital Change: Use APIs to Delight Customers & Win
Adapting to Digital Change: Use APIs to Delight Customers & WinAdapting to Digital Change: Use APIs to Delight Customers & Win
Adapting to Digital Change: Use APIs to Delight Customers & Win
 
Balancing Security & Developer Enablement in Enterprise Mobility - Jaime Ryan...
Balancing Security & Developer Enablement in Enterprise Mobility - Jaime Ryan...Balancing Security & Developer Enablement in Enterprise Mobility - Jaime Ryan...
Balancing Security & Developer Enablement in Enterprise Mobility - Jaime Ryan...
 
5 steps end to end security consumer apps
5 steps end to end security consumer apps5 steps end to end security consumer apps
5 steps end to end security consumer apps
 
Best Practices You Must Apply to Secure Your APIs - Scott Morrison, SVP & Dis...
Best Practices You Must Apply to Secure Your APIs - Scott Morrison, SVP & Dis...Best Practices You Must Apply to Secure Your APIs - Scott Morrison, SVP & Dis...
Best Practices You Must Apply to Secure Your APIs - Scott Morrison, SVP & Dis...
 
Drones, Phones & Pwns the Promise & Dangers of IoT APIs: Use APIs to Securely...
Drones, Phones & Pwns the Promise & Dangers of IoT APIs: Use APIs to Securely...Drones, Phones & Pwns the Promise & Dangers of IoT APIs: Use APIs to Securely...
Drones, Phones & Pwns the Promise & Dangers of IoT APIs: Use APIs to Securely...
 
Gartner AADI Summit Sydney 2014 Implementing the Layer 7 API Management Pla...
Gartner AADI Summit Sydney 2014   Implementing the Layer 7 API Management Pla...Gartner AADI Summit Sydney 2014   Implementing the Layer 7 API Management Pla...
Gartner AADI Summit Sydney 2014 Implementing the Layer 7 API Management Pla...
 
Using APIs to Create an Omni-Channel Retail Experience
Using APIs to Create an Omni-Channel Retail ExperienceUsing APIs to Create an Omni-Channel Retail Experience
Using APIs to Create an Omni-Channel Retail Experience
 
Panel Session: Security & Privacy for Connected Cars w/ Scott Morrison, SVP ...
 Panel Session: Security & Privacy for Connected Cars w/ Scott Morrison, SVP ... Panel Session: Security & Privacy for Connected Cars w/ Scott Morrison, SVP ...
Panel Session: Security & Privacy for Connected Cars w/ Scott Morrison, SVP ...
 
Clients Matter, Services Don't - Mike Amundsen's talk from QCon New York 2014
Clients Matter, Services Don't - Mike Amundsen's talk from QCon New York 2014Clients Matter, Services Don't - Mike Amundsen's talk from QCon New York 2014
Clients Matter, Services Don't - Mike Amundsen's talk from QCon New York 2014
 

Recently uploaded

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Recently uploaded (20)

Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
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 New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
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 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
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
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 

API Design Methodology - Mike Amundsen, Director of API Architecture, API Academy @ APIdays Sydney

  • 1. API Design Methodology Mike Amundsen, CA / Layer7 @mamund
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12. Actually, we have a methodology already...
  • 13. Design Guidelines ● Craft [good/pretty/usable/stable] URIs
  • 14.
  • 15. Design Guidelines ● Craft [good/pretty/usable/stable] URIs ● Map domain actions to HTTP methods (CRUD)
  • 16.
  • 17. Design Guidelines ● Craft [good/pretty/usable/stable] URIs ● Map domain actions to HTTP methods (CRUD) ● Use the proper HTTP Status Codes
  • 18.
  • 19. Design Guidelines ● Craft [good/pretty/usable/stable] URIs ● Map domain actions to HTTP methods (CRUD) ● Use the proper HTTP Status Codes ● Document serialized objects as HTTP bodies
  • 20.
  • 21. Design Guidelines ● Craft [good/pretty/usable/stable] URIs ● Map domain actions to HTTP methods (CRUD) ● Use the proper HTTP Status Codes ● Document serialized objects as HTTP bodies ● Use HTTP headers responsibly
  • 22.
  • 23. Design Guidelines ● Craft [good/pretty/usable/stable] URIs ● Map domain actions to HTTP methods (CRUD) ● Use the proper HTTP Status Codes ● Document serialized objects as HTTP bodies ● Use HTTP headers responsibly ● Describe edge cases (async, errors, authN/Z)
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29. But there's a problem here...
  • 30. Those are not design guidelines..
  • 31. They are implementation guidelines!
  • 32.
  • 33. Ok, so what is a design methodology, then?
  • 34.
  • 35.
  • 36. Here's a simple seven-step procedure...
  • 37. Here's a simple seven-step procedure...
  • 38. Let's design a Maze game API
  • 39.
  • 40. 1. List the Semantic Descriptors
  • 41. 1. List the Semantic Descriptors (the what?)
  • 42. 1. List the Semantic Descriptors (the what?) You know, the stuff!
  • 43. 1. List the Semantic Descriptors ● A maze ● A maze cell ● A switch ● Switch position ("up" or "down") ● The title of a maze cell ● A doorway connecting to cells ● An exit from the maze ● A list of mazes
  • 44.
  • 45. 2. Draw a State Diagram
  • 46.
  • 48. 3. Reconcile Names ● IANA Link Relation Values ● schema.org ● microformats ● Dublin Core ● Activity Streams
  • 49. 3. Reconcile Names ● maze ● start ● current ● exit ● north, south, east, west ● switch ● flip
  • 50. 3. Reconcile Names ● maze ● start (IANA) ● current (IANA) ● exit ● north, south, east, west ● switch ● flip
  • 51. 3. Reconcile Names ● maze ● start (IANA) ● current (IANA) ● exit (microformats) ● north, south, east, west (microformats) ● switch ● flip
  • 52. 3. Reconcile Names ● maze ● start (IANA) ● current (IANA) ● exit (microformats) ● north, south, east, west (microformats) ● switch ● flip edit (IANA)
  • 53. 3. Reconcile Names ● http://mamund.com/rels/maze (RFC5988) ● start (IANA) ● current (IANA) ● exit (microformats) ● north, south, east, west (microformats) ● http://mamund.com.rels/switch (RFC5988) ● flip edit (IANA)
  • 54. 3. Reconcile Names ● IANA o edit o start o current ● microformats o exit o north, south, east, west ● RFC5988 o http://mamund.com/rels/switch o http://mamund.com/rels/maze
  • 55.
  • 56. OK, that was the design part...
  • 57. But I still need to implement it, right?
  • 58. 4. Choose a Media Type
  • 59. 4. Choose a Media Type ● Use application/json, application/xml ● Collection type: Atom, OData, Collection+JSON ● Free-form: HTML, Siren, HAL, JSON-LD ● Invent your own semantic type
  • 60. 4. Choose a Media Type ● Use application/json, application/xml ● Collection type: Atom, OData, Collection+JSON ● Free-form: HTML, Siren, HAL, JSON-LD ● Invent your own semantic type
  • 61. 4. Choose a Media Type ● Use application/json, application/xml ● Collection type: Atom, OData, Collection+JSON ● Free-form: HTML, Siren, HAL, JSON-LD ● Invent your own semantic type
  • 62. 4. Choose a Media Type ● Use application/json, application/xml ● Collection type: Atom, OData, Collection+JSON ● Free-form: HTML, Siren, HAL, JSON-LD ● Invent your own semantic type
  • 63. 4. Choose a Media Type ● Use application/json, application/xml ● Collection type: Atom, OData, Collection+JSON ● Free-form: HTML, Siren, HAL, JSON-LD ● Invent your own semantic type
  • 64.
  • 65.
  • 69. 5. Write a Profile
  • 70.
  • 71.
  • 74.
  • 75.
  • 76.
  • 77.
  • 78.
  • 79.
  • 80. And now we have running code!
  • 83. 7. Publication ● Publish your "billboard" URL ● Publish your profile ● Register new rel values and/or media types ● Publish the documentation ● Consider "well-known" URIs
  • 85. Seven Simple Steps 1. List the Semantic Descriptors 2. Draw a State Diagram 3. Reconcile Names 4. Write a Profile 5. Select a Media Type 6. Implementation 7. Publication
  • 88.
  • 89. Don't fall into the collection trap
  • 90.
  • 91. Don't start with the representation format
  • 92.
  • 94.
  • 95. Standard names are probably better than yours.
  • 96.
  • 97. Don't keep all the hypermedia in one place
  • 98.
  • 99.
  • 100. Some Final Advice ● Resources are implementation details ● Don't fall into the collection trap ● Don't start w/ the representation format ● URL design doesn't matter ● Standard names are probably better than yours ● Don't keep all the hypermedia in one place
  • 102.
  • 103.
  • 104.
  • 105.
  • 106.
  • 107. In Conclusion... ● Don't confuse implementation w/ design ● Design is the hard part (high value) ● Implementation is the easy part (high speed) ● Avoid common design mistakes ● Go out and make lots of APIs!
  • 108. API Design Methodology Mike Amundsen, CA / Layer7 @mamund