Searching:
0 results foundCommands/SendCommand
POST /api/Commands/SendCommand
Description
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:
See Also
Request ‒ Commands/SendCommand
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.
Property | Type | Description | Mandatory |
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
{“commandId”:”561a530f1382732e34619b32″,”deviceIds”:[“5a79a53edc7cde163c30f95f”],”Message”: “Test1”}
Response ‒ Commands/SendCommand
Status 200 OK
{
“successful”: true,
“information”: “Success”
}
Command Output
A Json object will be sent to the device that will include the following:
Property | Type | Description |
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 |