Design and Build Great Web APIs

Book description

APIs are transforming the business world at an increasing pace. Gain the essential skills needed to quickly design, build, and deploy quality web APIs that are robust, reliable, and resilient. Go from initial design through prototyping and implementation to deployment of mission-critical APIs for your organization. Test, secure, and deploy your API with confidence and avoid the "release into production" panic. Tackle just about any API challenge with more than a dozen open-source utilities and common programming patterns you can apply right away.

Good API design means starting with the API-First principle - understanding who is using the API and what they want to do with it - and applying basic design skills to match customers' needs while solving business-critical problems. Use the Sketch-Design-Build method to create reliable and scalable web APIs quickly and easily without a lot of risk to the day-to-day business operations. Create clear sequence diagrams, accurate specifications, and machine-readable API descriptions all reviewed, tested, and ready to turn into fully-functional NodeJS code.

Create reliable test collections with Postman and implement proper identity and access control security with AuthO-without added cost or risk to the company. Deploy all of this to Heroku using a continuous delivery approach that pushes secure, well-tested code to your public servers ready for use by both internal and external developers.

From design to code to test to deployment, unlock hidden business value and release stable and scalable web APIs that meet customer needs and solve important business problems in a consistent and reliable manner.

Publisher resources

View/Submit Errata

Table of contents

  1.  Acknowledgments
  2.  Preface
    1. Your API Journey
    2. Who Should Read This Book
    3. How This Book Is Organized
    4. What’s Covered (And What’s Not)
    5. About the BigCo, Inc., Sample Project
    6. Online Resources
  3. Part I. Getting Started
    1. 1. Getting Started with API First
      1. Adopting the API-First Principle
      2. Exploring APIs with curl
      3. What’s Next?
      4. Chapter Exercise
    2. 2. Understanding HTTP, REST, and APIs
      1. Understanding Web API Protocols, Practices, and Styles
      2. Managing Files with Git
      3. What’s Next?
      4. Chapter Exercise
  4. Part II. The Design Phase
    1. 3. Modeling APIs
      1. Understanding Norman’s Action Lifecycle
      2. Modeling Our Onboarding API Lifecycle
      3. Managing Your Project with npm
      4. What’s Next?
      5. Chapter Exercise
    2. 4. Designing APIs
      1. The Power of Design
      2. The API Design Method
      3. Identifying Your API Descriptors
      4. Creating Your Sequence Diagram
      5. What’s Next?
      6. Chapter Exercise
    3. 5. Describing APIs
      1. Learning the Role of Description Formats
      2. Describing Your API with ALPS
      3. Updating Your API Project
      4. What’s Next?
      5. Chapter Exercise
  5. Part III. The Build Phase
    1. 6. Sketching APIs
      1. Learning from Frank Gehry’s Sketches
      2. API Sketching Example
      3. The Advantages of Sketching
      4. Sketching APIs with Apiary Blueprint
      5. API Sketching Tips and Tricks
      6. What’s Next?
      7. Chapter Exercise
    2. 7. Prototyping APIs
      1. What Is an API Prototype?
      2. API Prototyping with OpenAPI
      3. Translating Your API Design into HTTP
      4. Creating Your OpenAPI Document with SwaggerHub
      5. Saving and Exporting Your API
      6. Mocking Your API
      7. Generating Your API Documentation
      8. What’s Next?
      9. Chapter Exercise
    3. 8. Building APIs
      1. Defining the API Build Process
      2. Relying on a Repeatable Process
      3. Coding APIs with NodeJS and DARRT
      4. Putting It All Together
      5. What’s Next?
      6. Chapter Exercise
  6. Part IV. The Release Phase
    1. 9. Testing APIs
      1. The Goals of API Testing
      2. Testing with SRTs
      3. Using Postman for API Testing
      4. Running Tests Locally with Newman
      5. What’s Next?
      6. Chapter Exercise
    2. 10. Securing APIs
      1. Understanding Security Basics
      2. Implementing API Security with Auth0
      3. Supporting Machine-to-Machine Security
      4. What’s Next
      5. Chapter Exercise
    3. 11. Deploying APIs
      1. The Basics of Deployment Pipelines
      2. The Role of DevOps
      3. Deploying with Heroku
      4. What’s Next?
      5. Chapter Exercise
    4. 12. Modifying APIs
      1. Going Beyond Versioning
      2. The Three Rules for Safely Modifying APIs
      3. The Recommended Pattern for Testing for API Changes
      4. The Process for Safely Deploying APIs
      5. Shutting Down an Existing API
      6. What’s Next?
    5. 13. Some Parting Thoughts
      1. Getting Started
      2. The Design Phase
      3. The Build Phase
      4. The Release Phase
      5. What’s Next?
  7. Part V. Appendixes
    1. A1. Installation Hints
      1. curl
      2. Git
      3. GitHub and SSH
      4. NodeJS and npm
      5. Postman
      6. Newman
      7. Heroku Client
      8. Installing the Local Utiltities
    2. A2. Exercise Solutions
      1. Where’s the Code?
      2. Solution for Chapter 1: Getting Started with API First
      3. Solution for Chapter 2: Understanding HTTP, REST, and APIs
      4. Solution for Chapter 3: Modeling APIs
      5. Solution for Chapter 4: Designing APIs
      6. Solution for Chapter 5: Describing APIs
      7. Solution for Chapter 6: Sketching APIs
      8. Solution for Chapter 7: Prototyping APIs
      9. Solution for Chapter 8: Building APIs
      10. Solution for Chapter 9: Testing APIs
      11. Solution for Chapter 10: Securing APIs
      12. Solution for Chapter 11: Deploying APIs
    3. A3. API Project Assets Checklist
      1. Using the API Project Assets Checklist
      2. Notes on the Assets Checklist
      3. Your API Project Assets Checklist

Product information

  • Title: Design and Build Great Web APIs
  • Author(s): Mike Amundsen
  • Release date: October 2020
  • Publisher(s): Pragmatic Bookshelf
  • ISBN: 9781680506808