How-Tos

Retrieve Offline Devices

When managing large-scale devices, it's crucial to monitor device connectivity to ensure everything is functioning correctly. Devices going offline can indicate issues like network failures, device malfunctions, or power outages. By using this API, you can:

  • Identify devices that are offline
  • Gain insights into the last time each device was online
  • Integrate this data into dashboards for real-time monitoring or periodic reporting

Example API


  • Ensure you have a valid access token, if you do not, please referrer to the authentication section.
  • The devices API provides a filter for device status, it can be accessed with the following example:
curl --request GET \
     --url https://api.securithings.com/v1/assets/devices?status=offline&limit=100 \
     -H "Accept: application/json" \
     -H "Authorization: Bearer {token}"
bash
  • The response will contain up to 100 offline devices, key fields to note are lastSeen and status.
{
  "devices": [
    {
    "id": "....",
    "name": "...",
    "vendor": "...",
    "model": "...",
    "firmwareVersion": "....",
    "deviceType": "...",
    "compliance": {...},
    "network": {...},
    "status": "offline",
    "lastSeen": "2024-12-31T23:59:59Z",
    "deviceSources": [...],
    "sites": [...]
    },
    ...
  ],
  "total": 100
}
json

Notes and Limitations


  • Data Refresh Rate: The "last seen" data is updated every X minutes. Devices that reconnect within this interval may still appear as offline.
  • Rate Limiting: The API has a rate limit of 1 requests per second. Exceeding this limit will result in a 429 Too Many Requests error.
  • Time Zone: All timestamps are in UTC. Ensure your application adjusts for local time zones if necessary.