Skip to content

Live API Testing Interface

Execute Real API Calls • Add JWT Tokens • Test GET/POST/PUT/DELETE Methods

This page provides a fully interactive API testing interface where you can execute live API calls against MAHATI services.

🚀 Interactive API Tester

📋 How to Execute API Calls

Step 1: Authenticate with JWT Token

  1. Click the 🔒 Authorize button above
  2. In the "bearerAuth" field, enter your JWT token:
    Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
    
  3. Click Authorize and then Close

Step 2: Select API Service & Endpoint

  • Choose from 14 available microservices
  • Click on any endpoint (GET, POST, PUT, DELETE)
  • The endpoint will expand showing parameters

Step 3: Execute API Call

  1. Click "Try it out" button
  2. Fill in required parameters
  3. Add request body (for POST/PUT)
  4. Click "Execute" button
  5. View the live response below!

🔧 Available API Services

Service Base URL Test Methods
Admin http://localhost:3033/api/admin GET, POST, PUT, DELETE
Auth http://localhost:3023/prisma/api/auth POST (login), GET (validate)
Application http://localhost:3020/api GET, POST, PUT
Billing http://localhost:3025/api GET, POST, PUT
Claims http://localhost:3026/api GET, POST, PUT, DELETE
Document http://localhost:3005/api POST (upload), GET, DELETE
Policy http://localhost:3028/api GET, POST, PUT, DELETE
+ 7 more Various ports All HTTP methods

💡 Quick Testing Examples

1. Test Login (POST Method)

POST /prisma/api/auth/login
Content-Type: application/json

{
  "username": "user@example.com",
  "password": "yourpassword"
}

2. Get User Data (GET Method)

GET /api/admin/users
Authorization: Bearer your-jwt-token

3. Upload Document (POST with File)

POST /api/documents/upload
Authorization: Bearer your-jwt-token
Content-Type: multipart/form-data

4. Process Payment (POST Method)

POST /api/billing/process
Authorization: Bearer your-jwt-token
Content-Type: application/json

{
  "amount": 100.00,
  "currency": "USD"
}

🎯 Testing Features

✅ Real API Execution

  • Execute actual HTTP requests to running services
  • See real response data and status codes
  • Test with live authentication tokens
  • Handle file uploads and downloads

✅ Interactive Interface

  • Click-to-test any endpoint
  • Auto-populated parameter forms
  • JSON request body editor
  • Response viewer with syntax highlighting

✅ Authentication Support

  • JWT Bearer token authentication
  • Automatic token inclusion in requests
  • Token validation and error handling
  • Secure credential management

✅ Request/Response Inspection

  • View complete HTTP headers
  • See request/response timing
  • Copy cURL commands
  • Download response data

🔐 Authentication Guide

Get JWT Token

First, get your authentication token:

  1. Using the API Tester above:
  2. Find "Auth Service" section
  3. Click on POST /prisma/api/auth/login
  4. Click "Try it out"
  5. Enter your credentials:
    {
      "username": "your-email@example.com",
      "password": "your-password"
    }
    
  6. Click "Execute"
  7. Copy the token from the response

  8. Using cURL:

    curl -X POST "http://localhost:3023/prisma/api/auth/login" \
         -H "Content-Type: application/json" \
         -d '{"username":"user@example.com","password":"password"}'
    

Use JWT Token

  1. Click the 🔒 Authorize button
  2. Enter: Bearer your-jwt-token-here
  3. All subsequent API calls will include this token

🛠️ Troubleshooting

Common Issues

❌ "401 Unauthorized" - Check JWT token format: Bearer token-here - Ensure token hasn't expired - Verify credentials are correct

❌ "CORS Error" - API services need CORS headers enabled - Add your domain to CORS whitelist - Contact API team for configuration

❌ "Network Error" - Verify API services are running - Check correct ports (3005, 3020, 3023, etc.) - Ensure no firewall blocking

❌ "Invalid Request" - Check required parameters are filled - Validate JSON request body syntax - Review parameter types and formats

Success Indicators

  • 200-299 status codes = Success
  • JSON response data = API working
  • Response time shown = Connection good
  • No CORS errors = Properly configured

🎉 Ready to Test APIs!

This interactive interface allows you to:

  • ✅ Execute real API calls with live responses
  • ✅ Test authentication with JWT tokens
  • ✅ Try GET, POST, PUT, DELETE methods
  • ✅ Upload files and handle binary data
  • ✅ Debug API issues with detailed responses
  • ✅ Copy working cURL commands

Start testing by clicking any endpoint above!