Menu

CreateDevice

Jim

Create new Device

Creates a new device in the domain of the owner identified by the apikey. This service is called either by an admin application or by the device to create itself in the platform.

Path: cs-ws/resources/admin/device Method: POST

Parameters

  • apikey

Data

<device>
   <name>...</name>
   <model>..</model>
   <config>                optional device configuration parameters
      <name>...</name>
      <value>...</value>
   </config>
   ...
   <sensor>                optional if sensor configuration parameters are set
      <name>...</name>     
      <config>             
         <name>...</name>
         <value>...</value>
      </config>
      ...
   </sensor>
   ...
   <actor>                 optional if actor configuration parameters are set
      <name>...</name>     
      <config>             
         <name>...</name>
         <value>...</value>
      </config>
      ...
   </actor>
   ...
</device>

Errors:

  • 401 UNAUTHORIZED if key is invalid or not admin key
  • 409 CONFLICT if device already exists

Example

POST http://localhost/cs-ws/resources/admin/device?apikey=1234 HTTP/1.1
<device>
   <name>MyTempDev</name>
   <model>MyTemperatureDeviceModel</model>
   <actor>
      <name>position</name>
      <config>
         <name>max</name>
         <value>100</value>
      </config>
   </actor>
   <config>
      <name>maxpos</name>
      <value>1000</value>
   </config>
</device>

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.