Open In App

Use of Folders and Sub-folders in Postman Collections

Last Updated : 28 Dec, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

In API testing and development, it’s crucial to keep things organized for smooth workflows. Postman Collections, a handy feature in the Postman tool, help you stay organized by grouping API requests. They go a step further by allowing you to use folders and subfolders for even better organization. In this article, we’ll dive into how folders and subfolders in Postman Collections can help you keep your requests neat, making your development work more efficient.

Prerequisites

  • Postman should be installed.
  • Knowledge of terms like GET, and request.

What are Postman Collections:

Postman Collections serve as containers for grouping and organizing related API requests. They act like folders, providing a structured approach to managing your requests. Within Collections, the introduction of folders and subfolders takes this organizational capability to the next level.

The Power of Folders in Collections:

1. Grouping Related Requests:

Folders allow you to group related requests together within a Collection. This is particularly useful when dealing with complex APIs that have multiple functionalities.

For example, in an e-commerce API, you might have requests related to user authentication, product management, and order processing. By creating folders for each of these categories, you can maintain a clear separation and easily locate specific requests.

Collection Name: E-Commerce API

  • Folder: User Authentication
    • Login
    • Logout
  • Folder: Product Management
    • Get Products
    • Add Product
  • Folder: Order Processing
    • Place Order
    • Track Order

Example: Below is the representation of the collection name, folder and request.

Screenshot-2566-12-26-at-101859

2. Sequencing Requests Within Folders:(Image)

Folders not only group requests logically but also allow you to sequence them. This is beneficial when you have a sequence of API calls that need to be executed in a specific order. For instance, in the “Order Processing” folder mentioned above, you can define the sequence of requests for placing and tracking an order.

Folder: Order Processing

  • Place Order
  • Track Order

Introducing Subfolders for Granular Organization:

Creating Subcategories: In scenarios where you need an additional layer of organization, subfolders come into play. They allow you to create subcategories within folders, providing a more granular structure. For example, within the “Product Management” folder, you might want to further categorize requests into “Electronics” and “Clothing.”

Folder: Product Management

Subfolder:Electronics

  • Get Electronic Products
  • Add Electronic Product

Subfolder: Clothing

  • Get Clothing Products
  • Add Clothing Product

Example: Below is the proper representation of the folder and subfolders in postman.

Screenshot-2566-12-26-at-102507

Conclusion

Postman Collections make organizing API requests easy. Use folders and subfolders for clear and efficient development, whether it’s a small project or a big API. It’s a simple way to keep things neat and enjoyable while testing and developing.


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads