I'm using the API v3 to start a predefined task on one system. The correct task does indeed start on the correct system and produce the correct results (writes to a file). But Pulseway never detects that the task has actually completed. Neither the API nor web app ever detects that this task is completed - but it really has! Since webhooks are optional for the "Run Task" endpoint, I'm not using them.
Interesting thing is when this task is run manually through the Web App it complete fine in 2 seconds. Has anyone else used this successfully? I'm thinking something is broken.
For those who really want to see some PowerShell code:
I'm using the API v3 to start a predefined task on one system. The correct task does indeed start on the correct system and produce the correct results (writes to a file). But Pulseway never detects that the task has actually completed. Neither the API nor web app ever detects that this task is completed - but it really has! Since webhooks are optional for the "Run Task" endpoint, I'm not using them.
Interesting thing is when this task is run manually through the Web App it complete fine in 2 seconds. Has anyone else used this successfully? I'm thinking something is broken.
For those who really want to see some PowerShell code:
$TaskResp = Invoke-WebRequest -Uri $RunTaskUrl -UseBasicParsing `
-Headers $Headers `
-Method POST `
-ContentType 'application/json' `
-Body "$RunTaskBody"
where
$RunTaskBody = {"DeviceIdentifiers":["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"]} # edited for privacy
$RunTaskUrl = https://my_domain.pulseway.com/api/v3/automation/tasks/148/run # editied for privacy