API Creation and Deployment
Concept
What is an API?
An API (Application Programming Interface) is a set of definitions and protocols that allows software applications to communicate with each other. In the context of APIM (API Management), an API represents a collection of operations that can be invoked by clients, facilitating access to backend services.
Why Create an API?
Creating APIs offers several benefits for both providers and consumers:
For Providers:
- Modularity: Encapsulate functionality into reusable services.
- Scalability: Facilitate the development of scalable applications.
- Security: Implement access controls and monitoring.
- Monetization: Offer APIs as products to external developers or partners.
For Consumers:
- Accessibility: Access services without understanding internal implementations.
- Efficiency: Integrate functionalities quickly into applications.
- Innovation: Build new solutions by combining existing APIs.
Role of APIs in APIM and Kong Gateway
In APIM, APIs serve as the primary interface between clients and backend services. They:
- Define how clients interact with services.
- Enforce policies such as authentication, rate limiting, and transformation.
- Monitor usage and performance metrics.
Each API is associated with a specific Project and is deployed through a Gateway, which acts as the runtime component handling API requests.
Kong Gateway enhances API management by offering:
- Advanced Routing: Direct requests based on various criteria.
- Security: Implement authentication, authorization, and encryption.
- Observability: Monitor API usage and performance.
- Extensibility: Add functionalities through plugins.
Advantages of Creating APIs via APIM
Challenges of Managing APIs Without APIM
In traditional environments, creating APIs directly on gateways like Kong (via CLI, REST API, or configuration files) often comes with several limitations:
- Manual Configuration Overhead: Each API must be defined manually, increasing the risk of human error and inconsistency.
- Lack of Central Visibility: Developers and administrators lack a single view to manage, audit, or review all registered APIs.
- Fragmented Policy Management: Security policies, rate limits, and request/response transformations must be manually applied per API, with no versioning or history.
- Limited Collaboration: Without a shared platform, collaboration between developers, testers, and managers becomes inefficient.
- No Lifecycle Support: Managing API versions, testing before deployment, or tracking changes is cumbersome and requires custom scripting or external tools.
These issues become even more problematic as the number of APIs grows, or when working across multiple teams or environments.
How APIM Solves These Problems
The APIM system offers a powerful management layer on top of Kong Gateway, providing a streamlined and scalable way to manage APIs. Its benefits include:
- Visual Interface: Users can create, configure, and deploy APIs through a user-friendly web console—no need to use CLI or manually edit config files.
- Centralized API Registry: All APIs are managed per project, allowing clear ownership, isolation, and governance.
- Integrated Policy Application: Easily attach security, throttling, logging, and transformation policies during API configuration, with clear version control.
- Seamless Deployment: One-click deployment to project-specific gateways reduces errors and supports staged environments.
- Built-in Versioning & Documentation: APIs can be versioned, tested, and documented in the same environment, improving maintainability.
- Team Collaboration: Through role-based access, different stakeholders (admins, developers, testers) can contribute safely within project boundaries.
Ultimately, APIM transforms the way APIs are built and maintained by combining Kong’s runtime power with a structured management platform, reducing operational burden and enabling faster, safer development workflows.
Steps to Create an API
To create an API in APIM, follow these steps:
Access the APIM Console
Log in with your apim-admin credentials.
Navigate to API Management
Select the appropriate Project and go to the API Management section.
Add a New API
Click on “+ Add API”. Choose the method to define your API
Configure API Settings
- Name: A unique identifier for the API.
- Gateway: Attach to the Project’s Kong Gateway and Gateway URL
- Web Service URL: The backend service endpoint.
- API URL Suffix: The suffix appended to the gateway URL.
- Description: Optional details about the API.
- Define Operations: Add operations (e.g., GET, POST) specifying the URL paths and parameters.
Apply Policies
Implement policies for authentication, rate limiting, transformation, etc.
Write or Update the API Document
Use the built-in Markdown editor to write or update your API documentation.
Preview the content and click “Publish”. The document will then be able to display in API Document menu and become accessible via the Developer Portal for authorized users.
Save the API into API Management
Save the API configuration and view the created APIs in API Management screen.
For detailed instructions and additional options, please refer to the User Guide > APIM Console Guide > API Management
API Deployment
After successfully creating the API, you can click on the created API to access the API configuration screen. From here you can click on the API Deployment button to deploy the API to have it externally accessible.
Each deployment of the API will generate a new version for it. You will be required to input the version description each time you perform deployment for an API.
After the API is deployed, user can monitor the API status and deployment log through the API Deployment menu.
User can also click on each individual API Deployment record to view the details of an API and its versions.
After this step is done, the API is now active on the Gateway and reachable via its public Endpoint URL. You can now proceed to the final step to test the API.