Document the new /summary endpoint for sensors.

This commit is contained in:
Michael Stenta 2020-08-26 17:00:10 -04:00
parent f0d8e9903d
commit f03a090f58
1 changed files with 26 additions and 0 deletions

View File

@ -105,6 +105,32 @@ multiple requests should be made using the `offset` parameter. Setting `limit`
to a value greater than the max will result in a response code of
`422 Unprocessable Entity: exceeds max limit of 100000`.
**Data summary info**
It's also possible to retrieve summary information about the data stored for a
particular sensor by adding `/summary` to the end of the sensor's URL. This will
list each unique `name` used in the data, along with the total `count` of values
and the `first` and `last` timestamp for each. For example:
`https://myfarm.farmos.net/farm/sensor/listener/xxxxxx/summary?private_key=yyyyyy`
Example JSON response:
```
{
"humid": {
"count": 100,
"first": "1541117473",
"last": "1594911898"
},
"temp": {
"count": 100,
"first":"1541117473",
"last":"1594911898"
}
}
```
**Allowing public API read access**
Data in farmOS is private by default. A private key is required to push data to