My main goal with this is to be able to add a new request (which I've already tested successfully) and then add a reply to it. So far I'm having trouble with the reply part. In digging through the API v3, it doesn't appear that there is a reply function (and I don't think that Update Request is the appropriate one unless I'm mistaken) built into v3, so I think I'll have to use V1. However I'm not quite sure how to.
Here's the code I have, which I think is a mash of V1 and V3:
$ApiKey = "My key goes here"
$SdpUri = "https://servicedesk.mydomain.com"
$RequestID = "111111"
$input = @"
{
"operation": {
"details": {
"to": "name@email.com",
"subject": "Reply Test",
"description": "This is a reply test from Powershell"
}
}
}
"@
$header = @{TECHNICIAN_KEY=$ApiKey;OPERATION_NAME='REPLY_REQUEST'}
$params = @{input_data=$input;format='json';}
#$Uri = $SdpUri + "/api/v3/requests"
$Uri = $SdpUri + "/sdpapi/request/$RequestID"
$result = Invoke-RestMethod -Method POST -Uri $Uri -Headers $header -Body $params -ContentType "application/x-www-form-urlencoded"
$result
If someone could point me in the right direction, I would greatly appreciate it.