Public/new-AllegisIDNsourceSchemaImportAttribute.ps1

1
2
3
4
5
6
7
8
9
10
11
function new-AllegisIDNsourceSchemaImportAttribute ($orgName, $sourceid, $accessToken, $name, $type, $description){
    $header=get-AllegisIDNprivateHeader $accessToken
    $header+=@{'Content-Type'='application/x-www-form-urlencoded'}
    $header+=@{'charset'='UTF-8'}
    $privateuribase="https://$orgname.api.identitynow.com"
    $url="$privateuribase/cc/api/source/createSchemaAttribute/$sourceid"
    $body="name=$name&description=$description&type=$type&objectType=account"
    $response=Invoke-WebRequest -Uri $url -Method Post -UseBasicParsing -Headers $header -Body $body
    $sourceSchema=$response.Content | ConvertFrom-Json
    return $sourceSchema
}