Skip to main content

Request Network Datapoints

Retrieves list of sensor data (sensor/luminaire) in network identified by network ID and filtered by data type or data keys and time range. Additionally can be filtered by unit id's as well (optional). Requires use of API key and sessionId (Header: X-Casambi-Key, X-Casambi-Session). Filtering parameters from and to are mandatory.

By default time range params and response time values are in UTC timezone. Time range value is given as a date with or without hours, minutes and seconds or as ISO 8601 formatted value. Note that the request URL is expected to be URL encoded. In most queries this doesn't make a difference, but at least when using a timezone offset like "+01:00" then the + character needs to be encoded, or otherwise the query will be considered invalid.

The hasMoreResults response field shall be true if the results were truncated because of an implicit or explicit limit option and more results would be available on the server for the same query with a higher limit, false otherwise.

Note that datapoint data is stored only for 60 days. If given filter values are invalid or mandatory value is missing will return HTTP status code 400 - Bad Request.

HTTP Request:

GET https://door.casambi.com/datapoints/networks/{id}/datapoints?{filterOptions}

Path Parameters:

id: "networkId"

Filter Options:

dataType: one or more of the following separated by a comma: sensors, vendor, control, energy, details, status
keys: one or more of the following separated by a comma: dimmer, lux, presence, battery_level, ...
units: one or more unit identifiers separated by a comma and optionally enclosed in brackets (optional)
from: yyyyMMdd[hh[mm[ss[fff]]]] | ISO 8601 format: yyyy-MM-dd[Thh:mm[:ss[.fff]]][tz]
to: yyyyMMdd[hh[mm[ss[fff]]]] | ISO 8601 format: yyyy-MM-dd[Thh:mm[:ss[.fff]]][tz]
limit: Upper limit on the number of datapoints to return (optional, default is 10000 if omitted, allowed values 1-100000)

Changes

  • 01.12.2022: introduced as a new version of the datapoints query endpoint.
  • 04.09.2024: is now only available datapoint query endpoint.

CURL Example:

curl "https://door.casambi.com/datapoints/networks/NETWORK-ID-HERE/datapoints?dataType=status&from=20210206&to=20210208" \
-H "X-Casambi-Session:SESSION-ID-HERE" \
-H "X-Casambi-Key:API-KEY-HERE"
Response Example
{
"resultCount": 3,
"queryLimit": 10000,
"processingTimeMs": 32,
"hasMoreResults": false,
"errors": "",
"dataPoints": [
{
"unit": 3,
"key": "priority",
"value": "3",
"time": "2022-10-31T08:45:02.685+00:00"
},
{
"unit": 3,
"key": "condition",
"value": "ok",
"time": "2022-10-31T08:45:02.685+00:00"
},
{
"unit": 5,
"key": "priority",
"value": "3",
"time": "2022-10-31T08:45:02.774+00:00"
}
]
}
note

The "time" values within response data are in UTC. Datapoint data is stored only for 60 days, after that it will be deleted.