This topic is a theoretical discussion.
At the end of the day, an API is an API is an API, it’s what you do with the API that counts.
Best practice is to ALWAYS design APIs from an Outside-in perspective, meaning you look at what your customers need, and then work inwards to build that “experience” for them. A more formal definition of outside in is:
A design and development philosophy that focuses on the overall digital experience of customers starting with how they view products and services on the outside of a company before flowing inward to connect with business processes and data systems.
I highlighted 3 words in this: experience, processes, and systems. In API design, we typically see 3 types of APIs.
- Experience APIs - APIs that innovate and target user experience (loyalty programs, profiles)
- Process APIs - APIs that help orchestrate, improve processes, agility (interconnecting service)
- Systems APIs - APIs that unlock data, decentralize access (sso, legacy modernization)
All of these APIs should still be designed within a RESTful format, and be easily consumable by developers, whether those developers are building applications for external customers, internal employees, 3rd party partners, B2B, and so on. The API Consumer, must understand what the API does. This is why best practice is to build API Products, that identify what their specific use is.
- GET v1/products ---- I know this is about your products
- GET v1/products/shirts ---- I know this is about your products that are shirts
- GET v1/products/shirts/1234 ---- I know this is about a specific shirt.
The backend, database tables, logic, policies, are all hidden from the API Consumer. None of it matters to them. Your job is to create understandable APIs that can easily be used, no matter what their specific use case is.
My PERSONAL view on this: ALL APIs should be looked at as EXPERIENCE APIs. You would not need an API if you were not trying to improve an experience for someone. More so, in each example I outlined above, there is an opportunity for creating, delivering or improving user experiences.
- Experience - innovate and target user experiences = create user experiences.
- Process - help orchestrate, improve processes = get to market faster, improves user experience.
- System - unlock data, decentralize access = meet user demands, delivers expected experience.
But as I said at the beginning, an API is an API is an API. Design it in an easy to understand way, from an outside-in perspective, and you’ll always be able to keep up with the expectations of your users.