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 URLhttps://masonconsole.com
- AuthHTTP bearer
Request body
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
Example response
{
"data": {
"commandid": "command123"
}
}Changes
No recorded changes to this operation across all 1 revision of this API.