Edit Request using Rest API

Edit Request using Rest API

I'm unable to edit requests using the Rest API and Im not sure what Im doing wrong.
I have some custom fields Im trying to update. I'm using the below Powershell code to process it.

function Edit-Request
{
[CmdletBinding()]
param
(
[Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true, Position=0)]
[alias ("id")]
[Int32]
$RequestID,
[Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true, Position=2)]
[String]
$ApiKey,
[Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true, Position=3)]
[String]
$SdpUri,
[Parameter(Mandatory=$false, ValueFromPipelineByPropertyName=$false)]
[String]
$RequestFor,
[Parameter(Mandatory=$false, ValueFromPipelineByPropertyName=$true)]
[Int32]
$OracleID
)
begin
{
if ($SdpUri[$SdpUri.Length -1] -eq "/") { $Uri = $SdpUri + "sdpapi/request/$RequestID/" }
}

process
{
$Parameters = @{
"operation" = @{
"details" = @{
"Person request is for" = $RequestFor;
"Oracle ID # / TBA Employee ID #" = $OracleID
}
}
}
$input_data = $Parameters | ConvertTo-Json -Depth 50
$Uri = $Uri + "?format=json&OPERATION_NAME=EDIT_REQUEST&INPUT_DATA=$input_data&TECHNICIAN_KEY=$ApiKey"
$result = Invoke-RestMethod -Method POST -Uri $Uri
$result
}
}

                  New to ADSelfService Plus?