IoT
IoT cihaz entegrasyonu için endpoint'ler.
POST
/iot/v1/veri
Veri Gönder
IoT cihazından sensör verisi gönderir.
Kimlik doğrulama gerektirir
Parametreler
| Parametre | Tip | Zorunlu | Açıklama |
|---|---|---|---|
cihaz_id |
string | Zorunlu | Cihaz tanımlayıcısı |
veri |
object | Zorunlu | Sensör verisi JSON objesi |
timestamp |
datetime | Opsiyonel | Veri zamanı (ISO 8601) |
Request Body
{
"cihaz_id": "SENS-001",
"veri": {
"sicaklik": 23.5,
"nem": 65
},
"timestamp": "2026-02-22T14:30:00Z"
}
Response
201
{
"success": true,
"message": "Veri kaydedildi."
}
GET
/iot/v1/cihazlar
Cihaz Listesi
Kayıtlı IoT cihazlarını listeler.
Kimlik doğrulama gerektirir
Response
200
{
"success": true,
"data": [
{
"cihaz_id": "SENS-001",
"ad": "Depo Sensörü",
"durum": "aktif",
"son_veri": "2026-02-22T14:30:00Z"
}
]
}
cURL Örneği
POST /iot/v1/veri
curl -X POST https://api.pratikesnaf.com/iot/v1/veri \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"cihaz_id": "SENS-001", "veri": {"sicaklik": 23.5, "nem": 65}, "timestamp": "2026-02-22T14:30:00Z"}'