
3 Observing operations from the REST angle
This chapter covers
- The basics of HTTP and REST APIs
- Identifying resources and their relations
- Identifying resources' actions and their inputs and outputs
Now that we have analyzed users’ needs and identified the API capabilities required to fulfill them, especially the operations, we can start turning their plain English (or any other language) descriptions into the programming interface. In the context of this book, this means designing a REST web API. It requires knowing the basics of HTTP and REST APIs, which the sample without explanation in section 1.1.2 didn’t teach us. We still have no clue how an operation like “Send a message” can be turned into a POST
/status
, POST
/message
, or POST
/messages
HTTP request. Additionally, designing such a programming interface covers different aspects we must know and separate to simplify our learning and work while ensuring that our API design is accurate and versatile.
This chapter examines the “Design the programming interface” step of the API design process by explaining the basics of HTTP and REST APIs and how to design a REST API. Then we focus on our first task within this step: observing the operations we identified from the REST perspective. This consists of identifying the business concepts with which the API deals, called resources in REST APIs, how they relate, the actions that apply to them, and their inputs and outputs.