Menu

SendData

Jim

Send Device Data

Device data are sent in the domain of the owner identified by the apikey. Each data item, called a moment consists of a timestamp and a value. This service allows to send 1..n moments for 1..n attributes of 1..n sensors of a device. Sensornames and attributenames must exist according to the device model of the sending device. Timestamp has to be given in the same time zone as the server time. Get Time should be used to get the server time. If the timestamp is not given the reception time at the server is taken as timestamp.

Path: cs-ws/resources/connector Method: POST

Parameters

  • apikey
  • device_name

Data

<sensor>
   <name>...</name>
   <attribute>
      <name>...</name>
      <moment>
          <timestamp>yyyy-mm-dd hh:hh:ss.SSS</timestamp>
          <value>...</value>
      </moment>
   </attribute>
</sensor>
...

Errors:

  • 401 UNAUTHORIZED if key is invalid or not admin key
  • 404 NOT FOUND if sensor or attributes do not exist

Example

POST http://localhost/cs-ws/resources/connector?apikey=1234&device_name=Device1 HTTP/1.1
<sensor>
   <name>TemperatureSensor</name>
   <attribute>
      <name>Temperature</name>
      <moment>
          <timestamp>2012-08-31 19:55:54.036</timestamp>
          <value>1.1</value>
      </moment>
   </attribute>
</sensor>

HTTP/1.1 200 OK

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.