Public/set-AllegisIDNIdentityProfile.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
function set-AllegisIDNIdentityProfile ($orgname,$profileid,$accesstoken,$jsoninput)
{
    $opening = "{""id"":""$profileid"",""attributeConfig"":{""attributeTransforms"":$($jsoninput)}}"
    try
    {
        $results=Invoke-WebRequest -uri "https://$orgname.api.identitynow.com/cc/api/profile/update/$profileid" -Method post -UseBasicParsing -Headers (get-AllegisIDNprivateHeader -accessToken $accesstoken) -ContentType "application/json" -Body $opening
        return ($results.content | ConvertFrom-Json)
    }
    catch
    {
        Write-error $_.exception.message
        return $_
    } 
}