Command APIs

Save and trigger a command

This API endpoint allows for the creation and saving of a new command. It takes a Command object as the request body which includes the execution condition as set in the reference trigger and returns the unique identifier (commandID) of the newly created command.

post/rest/manager/command/save

Request

  • Base URL
    https://masonconsole.com
  • Auth
    HTTP bearer

Request body

idstring

The unique identifier for the command.

creationTimestring date-time

The date and time when the command was created.

ownerUserNamestring

The username of the owner of the command.

domainstring

The domain associated with the command.

descriptionstring

A description of the command.

filterIdstring

The ID of the filter associated with the command.

currentDevicesstring[]

The list of devices currently targeted by the command.

statestring

The state of the command.

notifiedUsersstring[]

A set of usernames representing users who have been notified about the command.

notifyDirtyboolean

Flag indicating whether the command has unsaved changes.

lastChangestring date-time

The date and time of the last change to the command.

failureCountinteger

The count of failures associated with the command.

successCountinteger

The count of successful executions of the command.

sentCountinteger

The count of times the command has been sent.

executedCountinteger

The count of times the command has been executed.

readyCountinteger

The count of devices ready to receive the command.

persistboolean

Flag indicating whether the command should be persisted for future reference.

persistentGroupIDstring

The ID of the persistent group associated with the command.

persistentGroupNamestring

The name of the persistent group associated with the command.

propsobject

Additional properties associated with the command.

Example request

{
  "id": "command123",
  "ownerUserName": "john_doe",
  "domain": "example.com",
  "commandData": {
    "intentAction": "com.example.MY_ACTION",
    "packageName": "com.receiverapp.package",
    "componentName": "com.receiverapp.package.YourReceiver",
    "declaredPermission": "com.yourapp.CUSTOM_BROADCAST_PERMISSION",
    "intentExtras": {
      "key1": "value1",
      "key2": "value2"
    },
    "waitForResponse": true
  },
  "description": "Activate Emergency Alert",
  "filterId": "filter123",
  "currentDevices": [
    "device_id_1",
    "device_id_2"
  ],
  "state": "Pending",
  "notifiedUsers": [
    "user1",
    "user2"
  ],
  "notifyDirty": true,
  "failureCount": 3,
  "successCount": 10,
  "sentCount": 5,
  "executedCount": 7,
  "readyCount": 8,
  "persist": true,
  "persistentGroupID": "group123",
  "persistentGroupName": "EmergencyAlertGroup",
  "props": {
    "property1": "value1",
    "property2": "value2"
  },
  "lastCommandStatus": {
    "status": "EXECUTED",
    "note": "Uninstall apps is disallowed"
  }
}

Response

Successful response

resultstring

The result of the login operation. Should be either 'SUCCESS' or 'FAILURE'.

messagestring

The message associated with the login response (applicable in case of 'FAILURE').

@classstring required

Example response

{
  "data": {
    "commandid": "command123"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.