Organizing API endpoints
The first important thing that you need to know about organizing API endpoints is that a resource is any information that can be named, which means that a URI should be an entity-based order and not datatype-based current-order-items.
It is good practice to separate internal/private APIs from external/public APIs, for example, by keeping private APIs in the same VPC or making them available only to the company or a specific domain, and making public ones available to any consumer, and sometimes over the internet. It is really common to expose business capabilities externally and foundation capabilities internally. It is important to organize and expose APIs properly, since they will always be used—and they will be used properly. Taking advantage of the business capabilities and creating business-oriented APIs allows an organization to get the most value out of those APIs.
There are three categories of APIs, which allows organizations to create business-oriented APIs:
- Resource-based APIs
- Experience-based APIs
- Capability-based APIs
We will discuss these in more detail in the following sections.