Share E-Book
Scan to open this page

Scan with your phone to open this page

AuthorArnaud Lauret

Summary The Design of Web APIs is a practical, example-packed guide to crafting extraordinary web APIs. Author Arnaud Lauret demonstrates fantastic design principles and techniques you can apply to both public and private web APIs. Foreword by Kin Lane, The API Evangelist. About the Technology An API frees developers to integrate with an application without knowing its code-level details. Whether you're using established standards like REST and OpenAPI or more recent approaches like GraphQL or gRPC, mastering API design is a superskill. It will make your web-facing services easier to consume and your clients—internal and external—happier. About the Book Drawing on author Arnaud Lauret's many years of API design experience, this book teaches you how to gather requirements, how to balance business and technical goals, and how to adopt a consumer-first mindset. It teaches effective practices using numerous interesting examples. What's inside • Characteristics of a well-designed API • User-oriented and real-world APIs • Secure APIs by design • Evolving, documenting, and reviewing API designs About the Reader Written for developers with minimal experience building and consuming APIs. About the Author A software architect with extensive experience in the banking industry, Arnaud Lauret has spent 10 years using, designing, and building APIs. He blogs under the name of API Handyman and has created the API Stylebook website.

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

AI guide
# The Design of Web APIs — Reading Guide ## 【One-Line Pitch】 A practical, example-driven handbook for developers who want to design web APIs that consumers actually enjoy using—covering everything from gathering requirements to designing REST interfaces, securing APIs, and evolving them over time. If you build or consume APIs and want to move beyond "it works" to "it's a pleasure to use," this book is for you. ## 【Book Arc】 - **Opening (~0%–9%)**: Establishes why API design matters—APIs are the foundation of connected software systems, and poor design leads to underused, misused, or insecure interfaces. Introduces the restaurant analogy: APIs hide implementation details, just as waiters hide kitchen operations from diners. - **Early (~9%–25%)**: Introduces the core mindset shift—designing APIs from the consumer's perspective, not the provider's. Uses the "Kitchen Radar 3000" vs. "Microwave Oven" example to show how exposing inner workings (like magnetron controls) creates painful APIs, while focusing on user goals (like "heat food") creates simple ones. - **Early (~25%–34%)**: Presents the API goals canvas—a structured method for identifying what users can do with your API, including inputs, outputs, and all user types. Warns against provider-perspective pitfalls: exposing data models, business logic, software architecture, or organizational structures through the API. - **Middle (~34%–47%)**: Transposes API goals into REST interfaces using a four-step method: identify resources and relationships, identify actions with parameters and returns, design resource paths, and represent actions with HTTP methods. Covers designing API data—concepts, responses, and parameters—with a consumer-first lens. - **Middle (~47%–end of excerpts)**: Addresses design trade-offs and challenges, acknowledging that real-world API design requires balancing user-friendliness with compliance and other constraints. The book continues into security, evolution, documentation, and review practices (not fully covered in these excerpts). ## 【Key Takeaways】 - **API design is a superskill that determines system success** (Opening): Well-designed APIs make software reusable and consumable; poorly designed ones get underused, misused, or become security risks. Design matters for both public and private APIs. - **APIs are interfaces that hide implementation** (Early): Like a restaurant menu and waiter, APIs let consumers interact with software without knowing code-level details. The design must conceal what happens behind the scenes. - **Focus on what users can do, not what the system does** (Early): The "Microwave Oven API" (single `heat food` command) beats the "Kitchen Radar 3000 API" (magnetron on/off cycles) because it's designed from the consumer's perspective. Simple interfaces come from user-focused thinking. - **Use the API goals canvas to identify requirements** (Early): Systematically investigate what users do, how they do it, what they need, what they get back, and how results are used. This produces an exhaustive, accurate goal list that becomes your functional blueprint. - **Avoid the provider's perspective at all costs** (Early): Don't expose your data model, business logic, software architecture, or team structure through the API. These leak implementation details that confuse consumers and make APIs hard to use. - **Transpose goals to REST using a four-step method** (Middle): Identify resources and relationships → identify actions with parameters and returns → design resource paths → represent actions with HTTP methods. This structured approach turns functional goals into concrete API design. - **Design data with the consumer in mind** (Middle): When designing concepts, responses, and parameters, ask: What properties does this concept have? Do users need them all? Can consumers understand them? Hide inner workings and keep names consumer-friendly. ## 【Reading Tips】 - **Deep-read Chapters 1–2** (roughly the first third): The consumer-first mindset and API goals canvas are the foundation for everything else. The restaurant and microwave examples make these concepts stick—don't skim them. - **Work through the Shopping API example actively**: The book walks through a complete example (search products, add to cart, check out, list orders). Try applying the goals canvas to your own API idea as you read. - **Pay special attention to the four-step REST transposition method** (Chapter 3): This is the practical core. Draw the diagrams yourself—resource identification, action mapping, path design, and HTTP method selection. - **Skim the foreword and early history** (~0–9%): Kin Lane's foreword gives context on OpenAPI's evolution, but the real value starts with Chapter 1's API design fundamentals. - **Treat this as a handbook, not a one-time read**: The foreword advises reading, building an API, then returning to the book. The design principles reward revisiting as you gain practical experience. ## 【Coverage Limits】 This guide covers the book's opening through the middle sections (approximately 47% of the book), focusing on API design fundamentals, the goals canvas, and REST interface design. The excerpts do not cover the book's later sections on security, API evolution, documentation, and design review processes. ##
Excerpt 1
It will make your web-facing building blocks of API design services easier to consume and your clients—internal and in an easy-to-access way, and external—ha...
View in text
Excerpt 2
Let me use a real-life analogy to explain this. Restaurant Don‛t know how to Only interact Say you decide to go to a restaurant. What about a French one? Whe...
View in text
Excerpt 3
ders. orders list. List orders They check an order‛s status. They need an order. They get the Check order order‛s status. to get itsstatus Figure 2.12 Shoppi...
View in text
Excerpt 4
we start designing the data just like any programmable rep- resentation of a concept— just like a database table, a structure, or an object. We simply list t...
View in text
Excerpt 5
download or copy and paste the edited fle to actually save or open it. I personally use the Microsoft Visual Studio Code editor along with the Swag- ger View...
View in text
Excerpt 6
ong data type or format can hinder understanding and usage. But that’s for an everyday object used by human beings. With APIs, data is simply processed by th...
View in text
Excerpt 7
gregations must only be done if the resulting goals really make sense for the consumer from a functional perspective. Also be warned that such aggregations c...
View in text
Excerpt 8
amount in descending order and by date in ascending order. Note that this is only one way of providing sorting parameters; it can be done in other ways too....
View in text
Tags
AI categories
ProgrammingBackendWeb Technology
ISBN: 1617295108
Publish Year: 2019
Language: English
Pages: 392
File Format: PDF
File Size: 11.5 MB
Text Preview (First 20 pages)
Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

Generating text preview…