Ulusal Afet Ağı - RESTful API ve WebSocket entegrasyon kılavuzu
/api/v1/auth/loginKullanıcı girişi ve JWT token alma
{
"email": "user@example.com",
"password": "password123",
"device_info": {
"user_agent": "Mozilla/5.0...",
"ip_address": "192.168.1.1"
}
}{
"success": true,
"data": {
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"user": {
"id": "usr_1234567890",
"email": "user@example.com",
"role": "operator",
"permissions": [
"devices:read",
"devices:write",
"incidents:read"
]
}
}
}curl -X POST http://localhost:8080/api/v1/auth/login \
-H "Content-Type: application/json" \
-d '{
"email": "user@example.com",
"password": "password123"
}'/api/v1/auth/logoutAuth RequiredOturumu kapat ve token iptal et
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}{
"success": true,
"message": "Başarıyla çıkış yapıldı"
}curl -X POST http://localhost:8080/api/v1/auth/logout \
-H "Authorization: Bearer YOUR_TOKEN"/api/v1/auth/meAuth RequiredMevcut kullanıcı bilgilerini getir
{
"success": true,
"data": {
"id": "usr_1234567890",
"email": "user@example.com",
"role": "operator",
"permissions": [
"devices:read",
"devices:write"
],
"created_at": "2025-01-31T10:00:00Z",
"last_login": "2025-01-31T12:30:00Z"
}
}curl -X GET http://localhost:8080/api/v1/auth/me \
-H "Authorization: Bearer YOUR_TOKEN"Authorization: Bearer YOUR_TOKEN_HERE