Developer API

API Dokümantasyonu

e-Sonuç+ REST API ile laboratuvar sonuçlarını programatik olarak yönetin ve analiz edin. Sağlık kuruluşları ve yazılımcılar için.

API Genel Bakış

RESTful API, JSON formatında veri alışverişi, JWT tabanlı kimlik doğrulama

REST API

HTTP metodları (GET, POST, PUT, DELETE) ile standart RESTful mimari

JWT Auth

JSON Web Token bazlı güvenli kimlik doğrulama sistemi

Rate Limiting

1000 istek/saat limiti ile adil kullanım politikası

Başlangıç

Base URL

https://api.e-sonuc.plus/v1

Authentication

Tüm API istekleri JWT token ile doğrulanır. Token'ı Authorization header'ında Bearer token olarak gönderin.

Request Example:

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

{
  "email": "user@example.com",
  "password": "your_password"
}

Response:

{
  "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "token_type": "bearer",
  "expires_in": 86400
}

Authenticated Request:

GET /test-results
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...

API Endpoints

Authentication

POST
/auth/login

Kullanıcı girişi ve JWT token alımı

Request Body:

{
  "email": "string",
  "password": "string"
}

Response (200 OK):

{
  "access_token": "string",
  "refresh_token": "string",
  "token_type": "bearer",
  "expires_in": 86400
}
POST
/auth/register

Yeni kullanıcı kaydı

Request Body:

{
  "email": "string",
  "password": "string",
  "full_name": "string",
  "date_of_birth": "YYYY-MM-DD",
  "gender": "male|female|other",
  "kvkk_consent": true,
  "medical_disclaimer_consent": true,
  "explicit_consent": true
}

Test Results

GET
/test-results

Kullanıcının tüm tahlil sonuçlarını listeler

Query Parameters:

  • limit - Sayfa başına kayıt (default: 10)
  • offset - Sayfalama offset (default: 0)
  • status - Durum filtresi (completed, processing, failed)

Response (200 OK):

{
  "total": 15,
  "results": [
    {
      "id": "uuid",
      "test_date": "2026-02-05",
      "hospital_name": "ABC Lab",
      "parameters_count": 12,
      "risk_score": 85,
      "risk_level": "LOW",
      "status": "completed"
    }
  ]
}
POST
/test-results/upload

Yeni tahlil sonucu yükleme (multipart/form-data)

Request Body:

Content-Type: multipart/form-data

file: <binary>
test_date: "2026-02-05" (optional)
hospital_name: "ABC Lab" (optional)

Response (201 Created):

{
  "id": "uuid",
  "status": "processing",
  "message": "File uploaded successfully"
}
GET
/test-results/:id

Belirli bir tahlil sonucunun detaylarını getirir

Response (200 OK):

{
  "id": "uuid",
  "test_date": "2026-02-05",
  "hospital_name": "ABC Lab",
  "risk_score": 85,
  "risk_level": "LOW",
  "parameters": [
    {
      "loinc_code": "718-7",
      "name": "Hemoglobin",
      "value": 14.2,
      "unit": "g/dL",
      "reference_min": 12.0,
      "reference_max": 16.0,
      "status": "NORMAL"
    }
  ],
  "ai_summary": "string",
  "correlations": []
}

Dashboard & Analytics

GET
/dashboard/summary

Genel sağlık skoru ve özet bilgiler

Response (200 OK):

{
  "overall_health_score": 85,
  "normal_parameters": 12,
  "concerning_parameters": 3,
  "total_tests": 5,
  "latest_test_date": "2026-02-05",
  "active_correlations": []
}
GET
/trends/:loinc_code

Belirli bir parametre için trend analizi

Response (200 OK):

{
  "loinc_code": "718-7",
  "parameter_name": "Hemoglobin",
  "timeline": [
    {
      "date": "2026-02-05",
      "value": 14.2,
      "status": "NORMAL"
    }
  ],
  "trend_direction": "IMPROVING",
  "velocity": 0.5,
  "percent_change": 12.5,
  "is_significant": true
}

HTTP Status Codes

200

OK

İstek başarılı

201

Created

Kaynak başarıyla oluşturuldu

400

Bad Request

Geçersiz request formatı veya parametreler

401

Unauthorized

Kimlik doğrulama gerekli veya token geçersiz

403

Forbidden

Erişim izni yok

404

Not Found

Kaynak bulunamadı

500

Internal Server Error

Sunucu hatası

Rate Limiting

API istekleri saat başına 1000 istek ile sınırlandırılmıştır. Her response'da rate limit bilgileri header'da döner:

X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 995
X-RateLimit-Reset: 1643923200

Limit aşıldığında 429 Too Many Requests hatası döner.

API Erişimi İçin Başvurun

Sağlık kuruluşları ve kurumsal müşteriler için özel API anahtarı ve destek.

Enterprise destek ve özel rate limit paketleri için iletişime geçin.

Yasal Uyarı: Bu sistem tıbbi bir teşhis aracı değildir. Tüm analiz sonuçları bilgilendirme amaçlıdır ve bir sağlık profesyoneli tarafından değerlendirilmelidir.