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

FieldTypeRequiredDescription
deviceUidstringrequiredDevice unique identification
appletUidstringrequiredApplet unique identification

Request Body

{"command"=>{"type"=>"<string>"}}

HEADERS

KeyDatatypeRequiredDescription
x-authstringAuthorization key and token
Content-Typestring
Content-Typestring
Acceptstring