I have a script like this listed on the device:
{
"type": "SCRIPT",
"id": 67,
"name": "script.run_application",
"language": "native",
"architecture": [
"64",
"32"
],
"categoryId": 3
},
I assume I can run msiexec/cmd via an API, so did a request like this:
curl --request POST
--url https://app.ninjarmm.com/v2/device/228/script/run
--header 'Accept: */*'
--header 'Authorization: Bearer <mytoken>'
--header 'Content-Type: application/json'
--data '{
"type": "SCRIPT",
"id": 67,
"parameters": "C:\Windows\System32\cmd.exe",
"runAs": "NT AUTHORITY\SYSTEM"
}'
But I get an error:
{ "resultCode": "FAILURE", "errorMessage": "NullPointerException", "incidentId": "WEB_MGMT_SERVICE-<some long letter>" }
I assume I messed up the parameters? Can someone explain how to correctly use this script via API?