Collaborated APIs in Kong Insomnia: Fostering Team Productivity

Mert Simsek
Beyn Technology
Published in
7 min readDec 22, 2023

Kong Insomnia is a powerful tool designed to streamline and enhance the API development and management process. As an integral part of the Kong API platform, Insomnia provides developers with robust features for designing, testing, and debugging APIs. With a user-friendly interface, Insomnia offers an intuitive environment for crafting requests, viewing responses, and collaborating on API development projects. Its versatility makes it an invaluable asset for beginners and experienced developers, ensuring a seamless API development experience.

With Insomnia you can:

  • Debug APIs using the most popular protocols and formats.
  • Design APIs using the native OpenAPI editor and visual preview.
  • Test APIs using native test suites.
  • Mock APIs will be coming soon.
  • Build CI/CD pipelines using the native Insomnia CLI for linting and testing.
  • Collaborate with others using the many collaboration features to share your projects.

For the application to be installed, the link below will be the starting point for its operating system.

https://docs.insomnia.rest/insomnia/install

API Design:

  • Efficiency and Consistency: Kong Insomnia provides a user-friendly interface for designing APIs, ensuring that developers can efficiently create API specifications and maintain consistency across projects.
  • Collaboration: With built-in features, team members can seamlessly work together on API design, fostering a collaborative and iterative design process.

API Testing:

  • Comprehensive Testing: Insomnia allows developers to conduct comprehensive testing of APIs, including unit tests, integration tests, and load tests, ensuring the reliability and functionality of the APIs.
  • Automation Support: The platform supports automation, enabling developers to automate the testing process and integrate it into their continuous integration/continuous deployment (CI/CD) pipelines.

API Debugging:

  • Real-time Debugging: Developers can debug APIs in real-time, identify issues promptly, and make necessary adjustments, streamlining the debugging process.
  • Interactive Debugging: Insomnia offers interactive debugging tools, allowing developers to interact with APIs during the debugging phase and gain insights into their behavior.

API Documentation:

  • Automatic Documentation: Kong Insomnia automatically generates documentation based on the API design, reducing the manual effort required for documentation creation.
  • Readability and Accessibility: The generated documentation is well-structured, enhancing readability, and it is easily accessible for both developers and API consumers.

Spec, Collection, Tests

Let’s take a quick look at what we have in the application. We are currently in the SPEC section, where we define API-related specifications. As you can see in the picture, there are “SPEC”, “COLLECTION”, “TESTS” sections and we will use each of them together to enrich and strengthen the API. The Specs section serves as a central hub for creating detailed API documentation. Developers can provide clear descriptions for each endpoint, specify the expected data format, and document any required authentication methods. This documentation not only aids developers working on the project but also becomes a valuable resource for external developers or team members interacting with the API.

I found the Swagger Petstore file online and imported it into the Insomnia tool. On the right, we see the preview area of the yaml file. Insomnia instantly displays errors and warnings in the interface. For example, if some fields are missing or their types are wrong, I fix them immediately.

After fixing the errors here, let’s meet a great feature; “Generate Collection”. From the specifications and documents we have created, we can instantly execute our requests with the HTTP client.

Now we see our automatically created list where we can make HTTP requests. Whatever we just wrote in the Swagger specification, we can run it live here. The “Collections” section in Insomnia is a powerful feature that streamlines the organization and execution of API requests. It serves as a container for grouping related requests, making it easier for developers to manage and test different API endpoints within a project. Collections allow developers to categorize and organize API requests based on their functionality or purpose. This hierarchical structure enhances project clarity, providing a logical order to the various API calls required for a specific task. Collections can be exported and shared among team members, promoting collaboration and consistency across the development team. This feature is especially valuable when working on projects with distributed teams or when transitioning between different development environments.

Collections support using environment variables, enabling developers to parameterize requests and create dynamic workflows. This flexibility is particularly useful when working with different environments, such as development, staging, and production.

Now let’s look at the TESTS section. It is a critical component for ensuring the reliability of APIs through automated testing. This section allows developers to define and execute test scenarios for API requests, validating that the responses meet expected criteria and ensuring consistent functionality. In the Tests section, developers can define various scenarios to validate the correctness of API responses. This includes assertions to check response status codes, response body content, headers, and other relevant parameters. By articulating specific test cases, developers ensure that the API behaves as intended under different conditions. Tests in Insomnia can be automated to run with each API request, providing immediate feedback on the health of the API. Automation helps catch issues early in the development process, preventing potential problems from progressing to later stages. Insomnia allows the integration of tests into continuous integration workflows, enabling developers to incorporate API testing seamlessly into their CI/CD pipelines. This ensures that tests are executed consistently and that API changes are thoroughly validated before deployment. Developers can use the Tests section not only for response validation but also for performance testing. By defining benchmarks and measuring response times, developers gain insights into the API’s performance under various conditions, helping identify and address potential bottlenecks.

Another test case is where I added scenarios such as whether the returned response content is an object or an array or whether it contains an “id” value.

Collaboration with Git

Insomnia’s integrated Git support is a powerful tool for enhancing collaboration among teams and managing API development processes more effectively. This feature allows storing all documentation and configuration of API projects in a Git repository. Team members can utilize Insomnia’s Git integration to review the project’s history, track changes, and revert to previous versions when necessary. Moreover, it facilitates seamless integration of changes between different team members, making concurrent work more organized and conflict-free. Insomnia’s Git integration empowers teams to manage their API development projects more efficiently, providing developers with a significant advantage in understanding project history and collaborating effectively. Consequently, transparency and cohesion in project processes contribute to team members working more productively.

Note: Sync with Git applies to users subscribed to Team plan and above, refer to pricing.

Kong for Kubernetes

Kong for Kubernetes integration in Insomnia leverages the powerful capabilities of Kong, an open-source API gateway, within Kubernetes environments. This integration allows developers to seamlessly manage and secure their APIs by combining the flexibility of Kong with the orchestration capabilities of Kubernetes.

Kong, known for its robust features like load balancing, authentication, rate limiting, and more, can be seamlessly deployed in Kubernetes clusters. Insomnia provides a dedicated set of features and configurations to interact with Kong for Kubernetes, making it easier for developers to set up and manage Kong instances within their Kubernetes infrastructure.

To Sum Up

Insomnia has become more than just a powerful tool for API developers; it has become a key element in accelerating your workflow and managing API projects more effectively. With its user-friendly interface, comprehensive API documentation, and testing and debugging features, Insomnia saves developers time and helps detect errors in the early stages of development. Furthermore, its robust collection and testing capabilities enhance collaboration among teams, ensuring projects progress in a more organized and reliable manner. If you aim to develop and manage APIs effectively, using Insomnia is inevitable. Catering to a wide audience, from beginners to expert users, this tool provides an environment that makes your API development process more efficient and enjoyable. It’s time to say “hello” to faster, more reliable, and more user-friendly API projects!

--

--

Mert Simsek
Beyn Technology

I’m a software developer who wants to learn more. First of all, I’m interested in building, testing, and deploying automatically and autonomously.