Home/Support/Support Forum/How to retrieve all data from curl request
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

How to retrieve all data from curl request

0 votes
Programming Language: PHP

I am trying to retrieve all data from Digi Cloud, but it returns only one data set(Current Data set).

Used URL: http://devicecloud.digi.com/ws/DataStream
Stream Id: dia/channel/*********/****/*****

What are the parameters I should have to use to get all data.(all past data).

Can someone please help me, thank you...
asked Oct 8, 2016 in Web Services by garysmith New to the Community (0 points)

Please log in or register to answer this question.

2 Answers

0 votes
In my case, I went into Device Cloud account and selected Documentation > API Explorer > Examples > v1/streams > List streams.

This gave me a list of all data streams and the syntax to use to see the history for a stream. For example:

/ws/v1/streams/history/dia/channel/00000000-00000000-00409DFF-FFXXXXXX/Sensor1/temperature
answered Oct 13, 2016 by userid0 Veteran of the Digi Community (2,158 points)
0 votes
You cannot get all datapoints from a data stream in a single API call unless there are less than 1000 points in the stream.

The maximum points you can retrieve per call is 1000. To collect all data points you would need to call the same API call multiple times but add the appropriate unique cursor from the previous result to retrieve the next 1000. You would loop this until until the result size is 0.
answered Oct 13, 2016 by NicholasWilson Veteran of the Digi Community (1,001 points)
...