🛠️ IT Sahayata API Testing Dashboard

Complete REST API Testing Interface - Test all 16 endpoints with detailed error handling

0

Total Tests

0

Successful

0

Failed

16

Pending

📌 Setup Instructions:
1. Run the complete SQL schema in phpMyAdmin
2. Install PHPMailer: composer require phpmailer/phpmailer
3. Create upload folders: mkdir -p uploads/tickets uploads/chat && chmod 777 uploads/*
4. Make sure Apache and MySQL are running on localhost
5. Start testing from Registration → Verify OTP → Login → Other APIs
POST 1. Register User with OTP
http://localhost/it-sahayata-api/api/auth/register.php
📧 Sends 6-digit OTP to email for verification
POST 2. Verify OTP
http://localhost/it-sahayata-api/api/auth/verify_otp.php
✅ Verifies email with 6-digit OTP (valid for 10 minutes)
POST 3. Login (Get JWT Token)
http://localhost/it-sahayata-api/api/auth/login.php
🔐 Returns JWT token valid for 30 days
✅ JWT Token Generated!

Copy this token and use it in all protected endpoints:

POST 4. Logout (Invalidate Token)
http://localhost/it-sahayata-api/api/auth/logout.php
🚪 Deletes token from database and invalidates session
POST 5. Create Ticket (Customer Only)
http://localhost/it-sahayata-api/api/tickets/create.php
🎫 Customer creates new support ticket
GET 6. Get All Tickets (Role-Based)
http://localhost/it-sahayata-api/api/tickets/list.php
📋 Customer sees own tickets | Agent sees assigned tickets | Admin sees all
GET 7. Get Ticket Details
http://localhost/it-sahayata-api/api/tickets/detail.php?ticket_id=X
🔍 Get complete details of a specific ticket
PUT 8. Update Ticket Status (Agent/Admin Only)
http://localhost/it-sahayata-api/api/tickets/update_status.php
🔄 Agent/Admin updates ticket status
POST 9. Send Message (Chat)
http://localhost/it-sahayata-api/api/messages/send.php
💬 Send message in ticket chat (Customer ↔️ Agent)
GET 10. Get Messages (Chat History)
http://localhost/it-sahayata-api/api/messages/get_messages.php?ticket_id=X
📜 Get all messages for a ticket
POST 11. Upload File (Image/PDF/Video)
http://localhost/it-sahayata-api/api/messages/upload_file.php
📎 Upload file (Max 10MB - JPG, PNG, PDF, MP4)
POST 12. Submit Feedback (Customer Only)
http://localhost/it-sahayata-api/api/feedback/submit.php
⭐ Customer submits rating for resolved ticket
GET 13. Get Assigned Tickets (Agent Only)
http://localhost/it-sahayata-api/api/agent/assigned_tickets.php
👨‍💼 Agent gets all tickets assigned to them with statistics
POST 14. Update Resolution (Agent Only)
http://localhost/it-sahayata-api/api/agent/update_resolution.php
🔧 Agent adds resolution notes and marks ticket as resolved
🎉 Testing Complete Checklist:
1. ✅ Register a customer and an agent
2. ✅ Verify both emails with OTP
3. ✅ Login as customer → Create 2-3 tickets
4. ✅ Login as agent → Check assigned tickets (Admin needs to assign via web panel)
5. ✅ Test chat → Send messages between customer and agent
6. ✅ Upload files in chat
7. ✅ Agent marks ticket as resolved
8. ✅ Customer submits feedback
9. ✅ Test logout

Once all tests pass, we'll build the Flutter app! 🚀