View all history of channel REST API


#1

Dear,
I’m developing an app and would like to list the entire history of a channel via the REST API.

How should I do this?

My app today, only query using date range like this:

https://platform.mydevices.com/v1.1/telemetry/xxxx/sensors/yyyy/summaries?type=custom&startDate= “+ String.valueOf (startdate) +” & endDate = "+ String.valueOf (enddate);

But I need to get all the history.

Thanks!


#2

tagging @asanchezdelc for this.
@rosibertosantos Do not create multiple posts on the same topic.


#3

@shramiksalgaonkar

ok! :+1:

but you know how to tell me how?

Thanks!


#4

Hi @rosibertosantos,

For all data, you’ll have to perform multiple requests and combine all the data in your application. We do not have an API that would return all the data at once.


#5

thanks for answering @asanchezdelc!

has no parameter for the “type” that would return all the data of a sensor?

so far as I have seen, the paramenters are:
latest - I get the last die
custom - step an interval

would not it have an “all” parameter that would return the history of a single channel?


#6

type is the summarization rollup. Here’s a list of types: hour, day, week, 1month, custom. You can also use ?endDateLatest=true&type=week for last week worth of data.


#7

In my experience, you can get 10,000 samples in a query - 10,000 minute summaries give you about a week, or 10,000 15-second samples is about a day. So you just have to iterate through the days or weeks … without exceeding your query limits. :grinning:


#8

Is there a way to get a “week” of hour summaries that is not the last week (most recent week), like

endDateLatest=false&type=week&startdate=xxx

I know I can get a week of minutes from a month ago (~10,000 data points) with the v1.1/?type=custom& … and calculate my own hour summaries, but a week of hours (~150 datapoints) is often all I need and less work if they are already sitting in the database.