API trigger via Windows Command Prompt


I’m just playing around with API triggers and curl for the first time and have a (probably simple) question.

I’ve created a simple workflow to just send me an email when the trigger fires. I’ve copy\pasted the resulting API command into Postman and it works - the email gets sent and it returns the expected 202 code and ‘null’. I can also see the job log in insightConnect.

When I paste the same API string into a Windows command or powershell prompt (ensuring curl.exe and not just curl), it returns ‘null’ and no errors, but with no code and no resulting emai or job appearing. Other simple curl commands in command prompt work fine (i.e. curl https:\www.google.com).

I’m new to curl so this is probably something simple (i.e. a limitation of curl or command format issue in Windows or something)


PowerShell tends to hide errors.
try something like this:

Try {
     $WebRequestResult = Invoke-RestMethod -Uri $URL -Headers $Headers -Body $BodyJSON -Method $Method -ContentType $ContentType -ErrorAction Stop
} Catch {
    if($_.ErrorDetails.Message) {
        Write-Host $_.ErrorDetails.Message
    } else {
        Write-Host $_

Thanks Brandon, that works although PS requires admin privileges to run for me so isn’t ideal as the time taken to dig out the admin password reduces the benefit of the workflow, so I’ve used this as the trigger to give myself a goal in 2024 to learn Python and do it that way instead!