Public/new-AllegisIDNsourceSchemaImportAttribute.ps1

function new-AllegisIDNsourceSchemaImportAttribute ($orgName, $sourceid, $accessToken, $name, $type, $description, $multi){
    $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"
    if ($multi -ne $true){
        $body="name=$name&description=$description&type=$type&objectType=account"
    }else{
        $body="name=$name&description=$description&type=$type&multi=true&objectType=account"
    }
    $response=Invoke-WebRequest -Uri $url -Method Post -UseBasicParsing -Headers $header -Body $body
    $sourceSchema=$response.Content | ConvertFrom-Json
    return $sourceSchema
}