Menu

RetrieveByDeviceModel

Jim

Retrieve Data by Device Model

Returns stored device data for all sensors of all devices of a certain device model

Path: cs-ws/resources/retrieval/devicelist/{devicemodel_name} Method: GET

Parameters

  • apikey
  • devicemodel_name
  • from ... timestamp as yyyy-mm-dd hh:hh:ss.SSS
  • to ... timestamp as yyyy-mm-dd hh:hh:ss.SSS
  • direction ...=asc|desc: controls whether timestamped data are retrieved in ascending or descending order, ascending is default
  • count ...=true: retrieves only the number of retrieved moments, not the moments themselves
  • limit ...=nnn: only up to nnn moments are retrieved. If a limit is reached for a moment series the response contains an element <next_timestamp> which can be used in a continuation of the retrieval for this time series

Errors:

  • 401 UNAUTHORIZED if key is invalid
  • 404 NOT FOUND if the of the devices is not found

Example

GET http://localhost/cs-ws/resources/retrieval/devicelist/TemperatureDevice?direction=asc&
count=false&to=2012-09-01%2001%3A00%3A00.000&from=2012-08-31%2001%3A00%3A00.000&limit=-1&
apikey=1234 HTTP/1.1

HTTP/1.1 200 OK
<devices>
   <device>
      <name>Dev999</name>
      <sensor>
         <attribute>
            <name>Temperature</name>
            <result>
               <count>0</count>
               <limit_reached>false</limit_reached>
               <next_timestamp/>
            </result>
         </attribute>
         <name>TemperatureSensor</name>
      </sensor>
   </device>
   <device>
      <name>TempDev2</name>
      <sensor>
         <attribute>
            <moment>
               <timestamp>2012-08-31 19:55:54.036</timestamp>
               <value>1.1</value>
            </moment>
            <moment>
               <timestamp>2012-08-31 19:58:54.036</timestamp>
               <value>1.1</value>
            </moment>
            <name>Temperature</name>
            <result>
               <count>2</count>
               <limit_reached>false</limit_reached>
               <next_timestamp/>
            </result>
         </attribute>
         <name>TemperatureSensor</name>
      </sensor>
   </device>
</devices>

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.