Enroll new Thing

Enroll a Production Thing

The following HTTP request method is used to enroll and activate a Production Thing that connects to the platform for the first time. The Thing must have a valid serial number that was previously registered in its Production Template.  The response will contain the Plug-ID and Auth Key or Connection password for the authentication headers ( X-Plug-Id and X-Plug-Auth ).

Once enrolled, a device will be able to read and write data to the CloudPlugs platform.

Request

Method

POST

Base Url

http://api.cloudplugs.com/iot/device

Headers

// No Auth HTTP Headers

Body

 {
   "model"     : [PLUG_ID],  // the Production template Plug-ID of this device
   "hwid"      : [String] ,  // the Serial Number of Thing
   "pass"      : [String] ,  // Enroll password of the serial number Thing
   "props"     : [JSON] ,   // optional, to create static Additional Properties for the Thing
   "prop_links": [PROP_LINKS]  // optional, to create linked Additional properties for the Thing
 }

Response

Status

200 OK   // if request was successful

Body

 {
   "id"  : [PLUG_ID] , // you must use these credentials for http headers (X-Plug-Id ; X-Plug-Auth) authentication.
   "auth": [String] 
 }

The Plug-ID and activation/connection password can also be received from the platform using the following command line instruction:

curl -H "Content-Type: application/json" -X POST -d '{"model":"mod-xxxxxxxxxxxxxxxx", "hwid":"your-serial-number","pass":"your-password"}' 
Still need help? Get in touch!
Last updated on 26th Mar 2019