Planon IoT : Axonize (stand-alone) : Creating an Application – Developer Workflow : Activating the IoT Platform Device SDK : IoT Platform Device SDK ‒ Receiving an Endpoint from the IoT Platform API
IoT Platform Device SDK ‒ Receiving an Endpoint from the IoT Platform API
The IoT Platform Device SDK endpoint hubClient.receive listens for incoming endpoints sent by the IoT Platform API. See hubClient.receive for more details.
To send endpoints to the IoT Platform Device SDK from the IoT Platform REST API, use the sendCommand endpoint.
In the message value sent to the Device by this endpoint, you can enter any free text. This free text should act as a trigger to the Device, so that the Device activates an operation, such as to open a lock, turn on a light and so on.
The developer must program the Device to use this message value in order to activate the relevant operation when the relevant free text is received.
The following shows an example of sending the word turn on to the IoT Platform Device SDK.
HTTP
POST odata/devices/[your device id]/SendCommand HTTP/1.1
Host: stg.api.axonize.com
Content-Type: Application/json
Cache-Control: no-cache
clientId: [enter your Client Id]
clientSecret: [enter your Client Secret]
{“Message”:”turn on“}
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 ‘{“Message”:”testing”}’
https://api.stg.axonize.com/odata/devices/[your Device Id] /SendCommand