Searching:0 results found
The SendCommand endpoint can be used to send a command to a Device that activates operations on the Device. These commands contain free text that represents the method to be executed on the Device.
The Axonize Device SDK hubClient.receive on the Device listens for the arrival of this command, and then executes this free text in order to activate the relevant operation on the Device.
Alternatively, instead of using the hubClient.receive on the Device that listens, Axonize can use its command gateway to send commands to Devices using various IoT protocols that are not supported by the Axonize Device SDK that is installed on the device.
See the following for request and response details:
The requests and their properties are defined for the Product of the Device to which this request is to be sent. See the Command property in Request ‒ Products/Post.
|commandId||String||Use the relevant commandId. The commandId is defined in the Product’s command property.|
|deviceIds||Array of Strings||Specify one or more Device IDs to which to send the command. The deviceId is the identifier property of Device.|
|message||String||Enter any free text that will trigger the Device to activate an operation, such as to open a lock, turn on a light and so on.
The Device must be programmed to use this message value to activate the relevant operation (as described above).
Example JSON Commands/SendCommand Request
Status 200 OK
A Json object will be sent to the device that will include the following:
|deviceId||String||The device’s custom Id|
|payload||String||The message from the command request|
|appId||String||The device’s application Id|
|appDeviceId||String||The device id|
|value||String||The command value|
|properties||Key value dictionary||The additional properties of the device|
|Device||Device Object||The device object|