Adding a Device ‒ Developer Workflow
A Device can be added either in the
IoT Platform Portal (as described in
Adding a Device) or using the API, as described below.
To a add a Device using the IoT Platform REST API:
1. Use the IoT Platform REST API Devices/Post endpoint. To see a description of the APIs, access .
2. Expand the Devices/Products/Post endpoint to see its details.
For example:
HTTP
POST /odata/devices HTTP/1.1
Host:api.stg.axonize.com
Content-Type: Application/json
Cache-Control: no-cache
clientId: [enter your Client Id]
clientSecret: [enter your Client Secret]
{“name”:”[the device name]”,”ProductId”:”[enter your Product Id]”}
Curl
curl -X POST -H “Content-Type: Application/json” -H “clientId: [enter your Client Id]” -H “clientSecret: [enter your Client Secret]” -H “Cache-Control: no-cache” -d ‘{“name”:”[the device name]”,”ProductId”:”[enter your Product Id]”}’
3. Fill in the Devices/Post properties. The following describes the mandatory properties. For more details, see Devices/Post.
◦ name (string): Specify any free-text name for the Device, which is shown in the IoT Platform Portal.
◦ ProductId (string): Specify the Product ID (Device type) of this Device. This string was received as a response to the Products/Post endpoint.
4. The response to the Devices/Post provides the unique access credentials that enable the Device to connect to the IoT Platform server. These access credentials must be loaded onto the Device, as described in the next steps below.