This project demonstrates an end-to-end Postman API testing workflow for an internal AI agent that generates code snippets and DevOps configuration suggestions via an MCP server.
It uses Google Gemini (free API) for dynamic AI responses and provides endpoints to simulate session handling, AI prompts, MCP operations, and validation.
-
Live AI responses from Gemini
-
Session management (
start,end) -
AI prompt handling (
/api/query) -
MCP workflow simulation (
/api/generate,/api/validate) -
Reusable Postman collection for future automation & regression testing
-
Includes schema-based Postman tests and error-handling cases
- Node.js + Express β REST API mock server
- Axios β external Gemini API calls
- uuid β unique session handling (for creating session id)
- dotenv β environment variable management
- Postman β API testing & automation
- Install Node.js
- Sign up for Google AI Studio
- Create a Gemini API key β
https://aistudio.google.com/app/apikey
# Clone repository
git clone https://github.com/diviam021-bit/Postman-API-Testing-Collection.git
cd Postman-API-Testing-Collection
# Install dependencies
npm install
Create a .env file in the root directory:
GEMINI_API_KEY=your_gemini_api_key_here
PORT=4000
Start the server:
node server.js
π§© How to Import in Postman
1οΈβ£ Import Collection
-- Open Postman
-- Click Import
-- Select
postman/Agent-Api-Workflow-Collection-With-Testcases.postman_collection.json
2οΈβ£ Import Environment
-- Open Postman
-- Click Environments β Import
-- Select
postman/Local Environment.postman_environment.json
3οΈβ£ Select Environment
-- Click Top-Right Environment dropdown
-- Choose: Local Environment
π API Documentation in Postman
-- Each request inside the collection already includes:
β
Request descriptions
-- Explain:
-- Purpose of the request
-- Inputs required (e.g., session_id, prompt, task)
-- Expected behavior
You can view this via:
Click a request β Right side panel β Documentation
β
Example request bodies
- - To help you quickly run and test.
β
Response examples
- - Shows what the API should return.
β
Test scripts
- - Every request has automated Postman tests including:
- - HTTP status validation
- - JSON schema validation
- - Field checks (session_id, output, message)
- - Error handling tests (invalid/missing session ID)