IoT Stadium

API Documentation

History

History - POST History Telemetry List

Retrieves historical telemetry data for a specific device or telemetry key over time. Useful for audits, reports, or analysis.

Post
https://api.iotstadium.com/ext/devices/:deviceId/history-telemetry-table/:telemetryKeyId?page=1&limit=10&sorts[0][times]=desc
    {
      "key": "Content-Type",
      "value": "application/json"
    },
    {
      "key": "Authorization",
      "value": "Bearer {{token}}"
    }

Parameter

Field Type Description
last_time Array

range of time for your data history (contain: day, hour, minute, second)

curl --location --globoff 'https://api.iotstadium.com/ext/devices/610/history-telemetry-table/27406035?page=1&limit=10&sorts[0][times]=desc' \
--data '{
    "last_time": { // last time for filter data relation inside telemetry_key data
        "d": 30, // day
        "h": null, // hour
        "m": null,    // minute
        "s": null  // second
    }

}'                                            
{
    "message": "success",
    "code": 200,
    "data": {
        "widgets": [
            {
                "telemetry_key": "Distance_8dbe1356-aa20-448e-9d8a-7c58c680815f",
                "data_source_id": 27406035,
                "key_raw": null,
                "key_wording": null,
                "friendly_name": "",
                "unit": "",
                "data": [
                    {
                        "times": "2024-06-07T08:00:00Z",
                        "val": 1.22
                    }
                ]
            }
        ],
        "total": 1,
        "page": 1,
        "total_page": 1
    }
}
{
    "message": "Invalid Message",
    "code": 400,
    "errors": [
        {
            "field": "last_time",
            "message": "The last time field is required when time start / time end is not present."
        },
        {
            "field": "time_start",
            "message": "The time start field is required when last time is not present."
        },
        {
            "field": "time_end",
            "message": "The time end field is required when last time is not present."
        }
    ]
}