Safety — Location Track + Device Alarms
curl --request GET \
--url https://api.stealthera.in/api/device/{deviceId}/safety \
--header 'X-API-Key: <api-key>'const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.stealthera.in/api/device/{deviceId}/safety', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.stealthera.in/api/device/{deviceId}/safety', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.stealthera.in/api/device/{deviceId}/safety"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text){
"deviceId": "<string>",
"locationtrack": {},
"alarms": [
{}
]
}{
"error": "<string>"
}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 |
GET
/
api
/
device
/
{deviceId}
/
safety
Safety — Location Track + Device Alarms
curl --request GET \
--url https://api.stealthera.in/api/device/{deviceId}/safety \
--header 'X-API-Key: <api-key>'const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.stealthera.in/api/device/{deviceId}/safety', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.stealthera.in/api/device/{deviceId}/safety', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.stealthera.in/api/device/{deviceId}/safety"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text){
"deviceId": "<string>",
"locationtrack": {},
"alarms": [
{}
]
}{
"error": "<string>"
}