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
- Log in and open the dashboard.
- Create an API client or generate a new key for an existing client.
- Store the shown X-API-Key. It is shown once.
- Send a stable external_user_id for each end user.
- Call an endpoint with JSON and the X-API-Key header.
- For now, one default chat is stored per user, so conversation_id is optional.
- 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
Purpose
POST
Consultant Recommendation - FastAPI
https://adrfapi.analyticabd.xyz/api/v1/consultants/recommend
Gemini-powered consultant, package, and service recommendations.
POST
Consultant Recommendation - ADRF
https://adrfapi.analyticabd.xyz/adrf-api/v1/consultants/recommend/
The same recommendation workflow implemented under Django/ADRF.
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.