First off, I love the SDK, and I think that the work @tyler_mairose, @colin_mckibben, @christina_gagnon, and gang have done over there is outstanding. However, it is not uncommon for me to run into challenges when using a new cmdlet. This has been the case for the Update-V2025Account cmdlet. I am trying to construct the JSON needed for the request body, and I am just at a loss as to why it is not working. The examples I find use a “here-string” for the JSON body, and I prefer to be a little more structured by creating custom objects and converting them to JSON.
Can someone tell me I am doing wrong?
$orphan = the result from the Get-Accounts cmdlet. It will contain the uncorrellated account.
$identity = result from Search-Post where I find the identity of the person that the $orphan account belongs to.
$operations = @()
$operations += [pscustomobject]@{"op"="replace";"path"="/identityId";"value"=$identity.id}
$operations += [pscustomobject]@{"op"="replace";"path"="/manuallyCorrelated";"value"="true"}
$body = $operations | ConvertTo-Json -AsArray
$result = Update-V2025Account -Id $orphan.id -RequestBody $body
This creates a body of:
[
{
"op": "replace",
"path": "/identityId",
"value": "7ab852162c684f40a673908b532bab9c"
},
{
"op": "replace",
"path": "/manuallyCorrelated",
"value": "true"
}
]
I have tried it without the “manuallyCorrelated” operation, and I get the same error.
Invoke-WebRequest: C:\Program Files\PowerShell\Modules\PSSailpoint.V2025\1.6.1\Private\V2025ApiClient.ps1:194:25
Line |
194 | $Response = Invoke-WebRequest -Uri $UriBuilder.Uri `
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| { "detailCode": "400.0 Bad request syntax", "trackingId": "10a9951f34aa4eb4a7c61600a165b9fd", "messages": [ { "locale": "und", "localeOrigin": "REQUEST", "text": "The request could
| not be parsed." }, { "locale": "en-US", "localeOrigin": "DEFAULT", "text": "The request could not be parsed." } ], "causes": [] }
Any suggestions as to what is wrong with my request body?