Create Applet Command
POST {{baseUrl}}/v1/device/:deviceUid/applet/:appletUid/command
Create device applet command by deviceUid
& appletUid
which will be delivered to device current active applet.
Command may contain any number of custom properties. The only required one is type
which is used to identify the command.
Originally the command was sent using the commandPayload
field, which is now deprecated. The command
field should be used instead.
Once the command is sent, it can be received inside the applet using the following customField:
sos.command.onCommand((commandEvent) => {
if (commandEvent.command.type === 'TestCommand') {
console.log(commandEvent.command.customField)
}
});
For more information, refer to the JS API documentation.
Parameters
Field | Type | Required | Description |
---|---|---|---|
deviceUid | string | required | Device unique identification |
appletUid | string | required | Applet unique identification |
Request Body
{"command"=>{"type"=>"<string>"}}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
x-auth | string | Authorization key and token | |
Content-Type | string | ||
Content-Type | string | ||
Accept | string |