Developer guide

Third-party API Integration

Use an API client from the dashboard, send its key with each request, and test the same payloads from the browser test hub.

Base URL: https://adrfapi.analyticabd.xyz

Quick Start

  1. Log in and open the dashboard.
  2. Create an API client or generate a new key for an existing client.
  3. Store the shown X-API-Key. It is shown once.
  4. Send a stable external_user_id for each end user.
  5. Call an endpoint with JSON and the X-API-Key header.
  6. For now, one default chat is stored per user, so conversation_id is optional.
  7. Use the browser test hub to compare FastAPI and ADRF behavior with the same request.

Authentication

Third-party requests authenticate with an API key header. The raw key is never stored by the server; only a SHA-256 hash is saved.

X-API-Key: abd_your_generated_key_here
Content-Type: application/json

Available Endpoints

Method Endpoint
POST Consultant Recommendation - FastAPI https://adrfapi.analyticabd.xyz/api/v1/consultants/recommend
POST Consultant Recommendation - ADRF https://adrfapi.analyticabd.xyz/adrf-api/v1/consultants/recommend/

Request Payload

{
  "query": "I have chest pain and shortness of breath for two days.",
  "age": 45,
  "gender": "male",
  "external_user_id": "user-123",
  "remember_context": true,
  "max_recommendations": 3,
  "include_packages": true,
  "include_services": true
}

Example cURL

curl -X POST https://adrfapi.analyticabd.xyz/adrf-api/v1/consultants/recommend/ \
  -H "Content-Type: application/json" \
  -H "X-API-Key: abd_your_generated_key_here" \
  -d "{\"query\":\"I have chest pain and shortness of breath for two days.\",\"external_user_id\":\"user-123\",\"remember_context\":true}"

Response Shape

{
  "conversation_id": "default",
  "intent": "doctor_consultation",
  "urgency": "soon",
  "disclaimer": "This guidance helps route you to suitable hospital services and is not medical diagnosis or treatment.",
  "emergency_warning": null,
  "clarifying_questions": [],
  "recommended_consultants": [
    {
      "id": 39,
      "name": "Doctor name",
      "department": "Cardiology",
      "designation": "Senior Consultant",
      "reason": "Matched symptom text to specialty.",
      "confidence": "medium"
    }
  ],
  "recommended_packages": [],
  "recommended_services": [],
  "next_step": "Please contact the hospital to book or confirm the right service."
}

Common Errors

Status Meaning
401 Missing, invalid, or inactive X-API-Key.
404 No hospital context records are available.
422 Request validation failed. Check required fields and length limits.
502/503 Gemini response/API-key configuration issue on the server side.