Discover our knowledge. Read our blogs!

Learn more

We build all our solutions with WSO2 and we are proud that we are Platinum Value-Added Reseller of WSO.

Learn more

How to create API categories in WSO2 API Manager 3.1.0

5 min read

How to create API categories in WSO2 API Manager 3.1WSO2 API Manager is a fully open-source solution for end to end API management in the cloud and on-premise environments. It is a complete solution that allows API developers to design, publish, and manage the lifecycle of APIs. It hosts an application developer portal which helps in building and managing a developer community for our APIs. API Manager is now integrated with a variety of services and presents more features to developers and consumers for API management use-cases.

The latest version of WSO2 API Manager v 3.1.0 is equipped with many useful features and improvements such as - Integration with AWS Lambda, a recommendation system for API store by analyzing the behavior of the developer application, Graphical tryout Console for Developer Portal, API security Audit integration and an API categories feature to enable API providers to categorize their APIs and many more. For the purpose of this blog, we will focus on API categories feature.

In WSO2 API Manager 3.1.0, you can define and use API categories to group APIs belonging to the same category in terms of functionality / usage / teams, et cetera for improved user experience. First, you need to define API categories in the Admin portal, and they will be made available in the Publisher for assigning them to APIs as part of the design configuration.  Once the categorized API gets published to the Developer Portal, they appear as a clickable link to users, which makes it easy for consumers to consume APIs by checking the category of their interest.

Note: In the previous version of WSO2 API Manager 3.0.0, the grouping of APIs was a bit cumbersome using tag-wise groups. API tags had naming constraints where tags need to be defined with the suffix '-group' in order for them to be treated as tag-wise groups in the developer portal, and tag-wise mode had to be enabled in order to display APIs in a grouped manner on the developer portal.

Below are steps to define the API category and associate API to categories.

Step 1: Add an API Category

Admins can add an API category by using the Admin Portal UI or the Admin REST API.

Add an API category using the Admin Portal UI

  1. Sign in to the Admin Portal: https://localhost:9443/admin
  2. Click API Category and then click API Categories.
  3. Click Add New Category.
  4. Enter a name and a description for the category.
  5. Click Save.

Step 1: Add an API Category

You can also use the curl command to add API category to Admin portal:

curl -k -X POST -H "Authorization: Bearer <ACCESS_TOKEN>" \ 
-H "Content-Type: application/json" \ 
https://localhost:9443/api/am/admin/v0.16/api-categories \ 
-d @category-data.json

Sample payload

{ "name":"Sales", "description":"Sales Category" }

Step 2- Attach the API Category to an API

  1. Sign in to the Publisher: https://localhost:9443/publisher
  2. Click on an API.
  3. Click Design Configurations.
  4. Select the API category.
  5. Click Save.

Step 2- Attach the API Category to an API

Step 3 – List APIs in Developer Portal

  1. Sign in to the Developer Portal:https://localhost:9443/devportal
  2. Expand the Tag Cloud menu.
  3. Click on the specific API category under API Categories to display APIs belonging the selected category

Step 3 – List APIs in Developer Portal

Summary

WSO2 APIM 3.1.0 provides the feature for grouping APIs into categories. API categories are helpful for users and developers as well for improved user experience and for a better organization, specifically when you have a large number of APIs to manage. You can now create API categories and apply them to APIs in a few simple steps. Try it out and let us know how it's working for you.

If you have any questions on this feature or on any other topic of WSO2 API management, please leave a comment below or contact us.

Download your copy of Yenlo's Advanced API Management Guide

Care to share?
   
Picture of Kalpana Yella
Published June 4, 2020

Kalpana Yella

Kalpana is an Integration Consultant from Seattle. She is passionate about new trends in IT and digital technologies. She is an expert in the implementation of WSO2's full product stack. She enjoys developing integration solutions with WSO2 and other open source tools / technologies for different industrial and business needs.

Responses

Stay up to date with the latest articles