Public/set-AllegisIDNIdentityProfile.ps1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
function set-AllegisIDNIdentityProfile ($orgname,$profileid,$accesstoken,$attributeTransforms) { if (($attributeTransforms | gm).TypeName[0] -eq 'System.Management.Automation.PSCustomObject'){$jsoninput=$attributeTransforms | ConvertTo-Json -Depth 100}else{$jsoninput=$attributeTransforms} $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 $_ } } |