Hands-On RESTful Web Services with TypeScript 3
上QQ阅读APP看书,第一时间看更新

Capability-based APIs

An interesting way to expose APIs is through capabilities, which is a common strategy that's adopted by huge enterprises like B2B. Enterprises often adopt business architecture to develop strategies that converge to align across technology and business. One of the most common techniques that's used in business architecture is business capability modeling. This technique can be used to represent an organization's business anchor model. Such representations are independent of structures or people.

It is quite easy for organizations to leverage business capability modeling as a way to express and explore what the organization does. Based on that, people can make decisions regarding planning. These accomplishments are intrinsic and related to business leaders. They have to work closely, in that they have to cooperate and collaborate, considering that this strategy should be driven by business units, rather than IT.

An example of this would be a company that wants to expose their order process as an API, like so:

[GET] /stores/products/<id>/items --> for the store to find items
[GET] /procuts/<id>/items--> the quantity of an item among the stores