Safety — Location Track + Device Alarms
Grouped Device
Safety — Location Track + Device Alarms
Returns GPS location history and device-scoped alarm log in a single response. Triggers two parallel reads (healthData history + alarms filtered by deviceId).
Replaces individual endpoint: /locationtrack
Adds: device-scoped alarm list (previously only available via the global /api/alarms endpoint).
Response shape:
{
"deviceId": "string",
"locationtrack": {
"deviceId": "string",
"date": "YYYY-MM-DD",
"tracks": [{ "lat": number, "lng": number, "time": "string" }],
"lastLocation": { "lat": number, "lng": number } | null
},
"alarms": [{ "id", "nickname", "deviceId", "type", "time", "location", "content" }]
}
Location sub-fields:
| Field | Type | Description |
|---|---|---|
tracks | array | GPS points [{ lat, lng, time, locateType }] (locateType: GPS / WiFi / Base station) |
lastLocation | object|null | Most recent GPS fix, or null |
Alarm fields:
| Field | Type | Description |
|---|---|---|
id | string | Alarm document ID |
type | string | Not worn / Sleep / Heart rate warning / Blood oxygen warning / Blood pressure warning / Temperature warning / Blood sugar warning / Blood potassium warning / Cardiovascular warning / Fall / Sedentary / Low battery / SOS |
time | string | Timestamp (IST, YYYY-MM-DD HH:mm:ss) |
content | string | Human-readable description |