WSO2 API Manager is a fundamental product for the management of APIs in a modern company. It provides us with multiple management features for our APIs and also group APIs together making them easily configurable. Today, we are going to take a look at one that isn’t quite as well known: API Products.
The creation and management of an API Product is a feature that WSO2 API Manager has had since version 3.X and now with its version 4.X it has been given more visibility. This feature allows the virtual creation of APIs based on the grouping of resources from other existing ones. This provides us with a high capacity of management and generation of APIs according to the needs of our company.
We will now take a look at its application by means of a practical example.
Practical example: How to group APIs in WSO2
Imagine that your company has 3 different APIs for ordering, invoicing and customer management, and you want to create a user portal that makes use of them via a separate REST API.
Figure 1. Different management APIs
But obviously, you don’t want to create a new service that bundles together methods that other services already have. That will increase maintenance and reduce adaptability. To resolve this issue, we have the API Product through which we will create a new virtual API that will group together the resources that we want to use in our user portal.
Figure 2. Virtual API
Steps to create a virtual API
The first step to create it, assuming that the rest of the APIs are already created, is to go to the API Product section of the API Manager and indicate the name of our API and its context.
Figure 3. First step to create virtual API
The next step is to select the existing resources that we want to be part of our new API.
Figure 4. Selection of existing resources
Once selected, we can click on ‘Create and Publish’ if we already want to make it available to consumers. Or click on ‘Create’ and continue configuring the API Product, before deploying it.
If we access the Developer Portal we will be able to see our 4 APIs.
Figure 5. The 4 APIS
And by accessing the API ‘User Portal’, we will see that it contains the resources that we have previously selected.
Figure 6. Selected resources
As we can see, an API Product is can be easily managed via the WSO2 API Manager and offers us a high versatility when creating APIs. We can follow the same example if we want to create APIs with different backends, apply specific security to certain resources, make a certain part of our API visible, etc.
This and many other API management features can be implemented thanks to WSO2 API Manager. And with Chakray Consulting you will have professional support and development of all of them. Do not hesitate to contact us, here.