API Collections and Organization
Learn how to organize your API requests into collections and maintain a well-structured API testing workspace in Maeris.
What are API Collections?
API Collections are containers that group related API requests together. They help you organize your tests, share common settings like authentication and base URLs, and manage your API testing workflow more effectively.
Benefits of Collections
- Organization: Group related endpoints together logically
- Shared Settings: Configure authentication and base URLs once for all requests
- Reusability: Share collections with team members
- Version Control: Export and version control entire collections
- Environment Management: Apply environments to entire collections
Creating Collections
- Navigate to API Section: Open Terminal > API in Maeris
- Create New Collection: Click "New Collection" button
- Name Your Collection: Give it a descriptive name that reflects its purpose
Examples: "User Management API", "Payment API", "Authentication API"
- Set Base URL: Configure the base URL for all requests in this collection
This can be overridden in individual requests if needed.
- Configure Authentication: Set up authentication at the collection level
All requests in the collection will inherit this authentication.
- Add Description: Add a description to document the collection's purpose
Organizing Requests Within Collections
Once you have a collection, you can organize requests within it using folders or a clear naming convention.
Organization Strategies
- By Resource: Group requests by the resource they interact with
Example: All user-related requests together, all order-related requests together
- By Functionality: Group requests by feature or functionality
Example: Authentication, User Management, Payment Processing
- By Workflow: Organize requests in the order they're typically executed
Example: Setup requests, main workflow requests, cleanup requests
- By HTTP Method: Group requests by their HTTP method
Example: All GET requests, all POST requests, etc.
Naming Conventions
Using consistent naming conventions makes your collections easier to navigate and understand.
Request Naming Best Practices
- Use descriptive names that indicate the action and resource
- Include HTTP method in the name: "GET User by ID", "POST Create User"
- Use consistent formatting across all requests
- Avoid abbreviations unless they're widely understood
- Include version numbers if testing multiple API versions
Collection Settings
Collections have settings that apply to all requests within them. These settings can be overridden at the request level if needed.
Common Collection Settings
- Base URL: The base URL for all requests in the collection
- Authentication: Default authentication method and credentials
- Headers: Default headers applied to all requests
- Pre-request Scripts: Scripts that run before each request
- Test Scripts: Scripts that run after each request
- Environment Variables: Variables available to all requests
Sharing Collections
You can share collections with your team members to collaborate on API testing. Shared collections ensure everyone uses the same API definitions and settings.
- Export collections to share with team members
- Import collections from other team members
- Use version control to track changes to collections
- Document collections with descriptions and examples
Best Practices
- One Collection Per Service: Create separate collections for different services or microservices
- Logical Grouping: Group related endpoints together within collections
- Consistent Naming: Use consistent naming conventions across all collections
- Documentation: Add descriptions to collections and requests
- Version Control: Export and version control your collections
- Environment Separation: Use different collections or environments for dev/staging/prod
- Regular Cleanup: Remove unused requests and collections periodically
Next Steps
- API Flows – Chaining Multiple APIs - Create complex API workflows
- API Assertions and Validations - Add validations to your requests
- Working with Environments - Manage environment variables