Cloud API - Get Historical Data - Time Series

I'd like to download the historical values for a thing variable via the cloud API.

Would devicesV2Timeseries be the correct command?

I have attempted something like this:
https://api2.arduino.cc/iot/v2/devices/ed2037a3-30d6-4218-b0d8-9d2ac3be46dc/properties/4e45eb91-b235-4fe8-81af-91ee6012f97a?limit=100&start=2021-05-07T02:00:00.000Z

But my response is always this:
{"id":"ed2037a3-30d6-4218-b0d8-9d2ac3be46dc","last_evaluated_key":null,"name":"4e45eb91-b235-4fe8-81af-91ee6012f97a","values":}

Maybe I'm using the wrong command?

Thanks!

1 Like

I'm getting the exact same response. I don't think this function is working or the documentation is wrong. Frustrating.

Looking at the documentation, there is a need for the 'ctx' value in the URL?

DevicesV2Timeseries timeseries devices_v2
GET device properties values in a range of time
 * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
 * @param id The id of the device
 * @param pid The id of the property
 * @param optional nil or *DevicesV2TimeseriesOpts - Optional Parameters:
 * @param "Limit" (optional.Int32) -  The number of properties to select
 * @param "Start" (optional.String) -  The time at which to start selecting properties
@return ArduinoDevicev2propertyvalues

When I look at the on-line documentation: Arduino IoT Cloud API

I am not seeing any need for a "ctx" parameter.

But what is concerning to me is that you seem to be looking at a different set of documentation.

Yeah, not sure. The documentation for the IoT Cloud I've found is quite lacking or non-existent.

Where I got the info from is here: GitHub - arduino/iot-client-go: Go client for Arduino IoT API

Which is linked to the Arduino IoT Cloud API documentation you've linked too.

I think you are looking at the GO code and I was looking at the Python code. Since both versions are seeing the same behavior I guess we can assume it is a basic problem with the libraries.

I've started looking into alternatives...none of which are real good. I've been forced to manually download the data for now.

Yes, would be good to hear from Arduino IoT team. Good luck.