Chapter 2

Advanced API Design

7 Pillars 7 Pillars

COMING SOON! Stay Tuned as we begin our journey in designing exquisite RESTful APIs that consumers love and developers can maintain.

Introducing the Seven Pillars of Advanced API Design

API design can be broken down into seven essential pillars. These pillars provide a comprehensive framework for designing robust, scalable, and maintainable APIs.

The seven pillars of API design are:

  1. URL Design: As humans are still involved in API consumption, well-structured URLs are the foundation of a well-designed API. This pillar focuses on creating consistent, readable, and scalable URL structures.
  2. Representations: This pillar deals with the structure and format of the data being exchanged between clients and the API, including JSON data and nuances of the payload design.
  3. Requests: API requests define how clients interact with the API, including HTTP methods, query parameters, and working with collections of data.
  4. Responses: Covers the structure and content of API responses, including asynchronous vs syncronous behavior, response codes, error handling and caching.
  5. Content-Type Negotiation: This pillar is about use of standard content-types like application/json, different data formats on single resources, and bulk operations.
  6. Relationships: API relationships define how resources are connected and the concept of clients being able to “follow their nose” to navigate an API.
  7. Security: The final pillar focuses on ensuring the security and integrity of the API, including authentication, authorization, and data encryption.
  8. *BONUS* Documentation: This forgotten pillar encompasses them all by wrapping it all up in a neat package complete with bow! In fact, tools like OpenAPI enable documentation- or design-first for all of these concepts.

By understanding and implementing these seven pillars, you’ll be well on your way to designing a robust, scalable, and maintainable API that makes consumers happy.