$JSON = @"
{
"operation": {
"details": {
"stagename": "Close",
"statusname": "Closed - Completed",
"statuscomments" : "Closed via API",
}
}
}
"@
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$postparams = @{OPERATION_NAME = 'update'; TECHNICIAN_KEY = $apikey; INPUT_DATA = $JSON; FORMAT = 'JSON'}
$JSONresult = Invoke-WebRequest -Uri $URI -Method POST -Body $postparams -UseBasicParsing | ConvertFrom-Json