AI_APIS_POSTMAN_GUIDE.txt- Complete testing guide with examplesDevOverflow_AI_Postman_Collection.json- Importable Postman collection
cd backend
npm start# Login to get token
curl -X POST http://localhost:3000/api/auth/login \
-H "Content-Type: application/json" \
-d '{"email":"admin@example.com","password":"your_admin_password"}'- Open Postman
- Click "Import" → "File"
- Select
DevOverflow_AI_Postman_Collection.json - Set environment variables:
base_url:http://localhost:3000/api/aijwt_token: Your JWT token from Step 2
- AI Status (Public) - Check if AI is configured
- Similar Questions (Public) - Test basic AI functionality
- Answer Suggestion (Protected) - Test authenticated AI
- Tag Suggestions (Protected) - Test tag generation
- Chatbot (Protected) - Test conversational AI
- Question Improvements (Protected) - Test question enhancement
- Create Flowchart (Protected) - Test diagram generation
- Get Flowchart (Protected) - Test diagram retrieval
- Public endpoints: No auth needed
- Protected endpoints: Add
Authorization: Bearer YOUR_JWT_TOKENheader - Get token from:
POST /api/auth/login
✅ AI Status: Shows Gemini API configuration status ✅ Similar Questions: Returns 3-5 related question titles ✅ Answer Suggestion: Provides detailed coding solution ✅ Tag Suggestions: Returns relevant tags array ✅ Chatbot: Conversational AI responses ✅ Question Improvements: Constructive feedback ✅ Flowchart: Mermaid diagram code + rendered images
❌ "AI service not configured" → Check GEMINI_API_KEY in .env ❌ "Not authorized" → Add JWT token to headers ❌ Connection refused → Make sure backend is running on port 3000
See docs/AI_APIS_POSTMAN_GUIDE.txt for complete examples and error handling.
Happy Testing! 🎉