Card 07/ 07

RecapDifficulty: Advanced1 min

Recap: API Design

From nouns to paths, from methods to codes, from errors to versions: one checklist for an API clients can trust.

Designing an API is a sequence of decisions, each one resting on the last, and a review that checks them all.

  • From requirements: nouns become resources, then paths, methods, codes and errors, then the contract.
  • Request ids and trace context carry one id through every service and back to the client.
  • Documentation: a reference generated from the contract, guides and examples written by hand.
  • The review checklist: twelve questions, run against the contract before any client is built.
  • A review finds what single-user tests miss: the user in the query, exposed fields, duplicate writes.
The checklist's groups, and the topic in this subject that teaches each
GroupTaught in
Paths and resourcesREST and resource-oriented design
Methods and retriesHTTP methods, and idempotency keys
Status codes and errorsStatus codes, and error responses
CollectionsREST and resource-oriented design
Caching and concurrencyHTTP caching
SecurityAuthentication, OAuth and OpenID Connect, and protecting an API
ContractRequest and response contracts
EvolutionVersioning and evolving an API