Part 6. Safety and security

 

It’s easy to forget that users will occasionally make mistakes when using an API. Since these mistakes are unfortunately inevitable, it’s important to design an API that allows users to help minimize the damage when they happen. In the next several chapters we’ll look at design patterns aimed at doing just that.

In chapter 24, we’ll explore the high-level concepts of versioning and compatibility and the strategies available for versioning an API. In chapter 25, we’ll look at the idea of an API recycle bin of sorts to prevent accidental deletion. In chapters 26 through 28, we’ll look at various strategies for preventing duplicate work, testing requests before executing work, and keeping a history of changes to resources in case users ever need to undo their changes.

In chapter 29, we’ll explore when and how to safely retry requests in the event of network failures or other issues. And finally, in chapter 30, we’ll explore how an API service can safely authenticate requests.