Forum Discussion
Go_Ozeki
Oct 22, 2021Copper Contributor
How do I get multiple records in target period?
Hi all, I would like to retrieve multiple records within a period of time from a Device in IoT Central. Ex) Get the data of 100 records from the latest in Json format. Obtain the data with...
- Oct 22, 2021Hi,
You can't use the APIs at this point to get the historical telemetry data directly from IoT Central (you can get the history for commands and properties only). Furthermore, Azure IoT Central retains data on a rolling 30-days basis, which means you can't access data that is older than 30 days by default directly from IoT Central.
The recommend way to implement the scenario you are looking for is to use the continuous data export feature (https://docs.microsoft.com/azure/iot-central/core/howto-export-data) and then depending on where you send the data (Event Hub, Blob, ...) you can use these services API to revtreive the data you need
OlivierBloch
Oct 28, 2021Iron Contributor
Well, I should have waited a couple days before answering this one as I have good news that contradict my previous response :-). The IoT Central team just released an update to the APIs and now you can query devices data! https://docs.microsoft.com/en-us/azure/iot-central/core/howto-query-with-rest-api
- Go_OzekiOct 29, 2021Copper Contributor
Hi OlivierBloch,
That's very exciting news for me!
I'll try the API as soon as possible.Thanks for letting me know!