Unable to create a new change through PowerShell/Samanage API.

Discussion created by 7631723 on Jul 9, 2015
Latest reply on Jul 10, 2015 by 7631723
Hello all,

I've been working on some change ticket automation, and have been unable to create a new change using PowerShell and the Samanage API. My script has been included below. I have tried via .json and xml, but have been unsuccessful in both cases and have been receiving an "error: (422) Unprocessable Entity."

Does anyone have any insight into how to potentially resolve this issue?

$creds = Get-Credential EMAIL@DOMAIN.COM
$xmlfile = [xml] @"
<state>Closed Completed</state>
$headers = @{"Accept"="application/vnd.samanage.v1.1+xml"}

Invoke-WebRequest -Uri "https://api.samanage.com/changes.xml" -Body $xmlfile -Credential $creds -ContentType "text/xml" -Headers $headers -Method Post