HOW TO: Paginate a Data Stream to receive more than 1000 Data Points

Introduction

Remote Manager has proven to be a very useful tool for those who learn to use it to their advantage.  This article will cover the subject of Data Streams, and how to receive more than 1000 Data Points of Data Stream information using the Remote Manager Web Services API.

Problem:

When a Web Services request to read a Data Stream is sent to Remote Manager, the maximum number of Data Points which can be received in one response is 1000.   Many Data Streams being pushed up to Remote Manager today consist of more than 1000 Data Points however.  In today's busy Internet of Things, Smart Energy and Sensor Networking devices by the thousands are reporting new data every moment.

Solution:

The maximum number of Data Points returned per Data Stream call is 1000. However, you can get the next 1000 Data Points in the stream by utilizing <pageCursor>:
 
First call:
 
/ws/DataPoint/dia/channel/00000000-00000000-012345FF-FFABCDEF/sensor0/temperature
 
Returns this:
 
<result>
   <resultSize>1000</resultSize>
   <requestedSize>1000</requestedSize>
   <pageCursor>62f54937-8c67-11e2-8d08-4040e60fa8d8</pageCursor>
   <requestedStartTime>-1</requestedStartTime>
   <requestedEndTime>-1</requestedEndTime>
   <DataPoint>
 
The second call to get the next 1000 Data Points would be:
 
/ws/DataPoint/dia/channel/00000000-00000000-012345FF-FFABCDEF/sensor0/temperature?pageCursor=62f54937-8c67-11e2-8d08-4040e60fa8d8
 
You could then get a third thousand (if additional Data Points exist) by replacing the page cursor with the one returned in the second call, and so on.

Further Reading:
Device Cloud Programming Guide - See the Data Streams chapter

Last updated: Jan 01, 2024

Filed Under

Digi Remote Manager

Recently Viewed

No recently viewed articles

Did you find this article helpful?