Functions/Get-SchoolUserExtended.ps1
function Get-SchoolUserExtended { <# .LINK https://github.com/Sekers/SKYAPI/wiki .LINK Endpoint: https://developer.sky.blackbaud.com/docs/services/school/operations/V1UsersExtendedByUser_idGet .SYNOPSIS Education Management School API - Get extended user details (telephones, occupations, relationships, etc.) for one or more user IDs. .DESCRIPTION Education Management School API - Get extended user details (telephones, occupations, relationships, etc.) for one or more user IDs. .PARAMETER User_ID Required. Array of user IDs for each user you want returned. .EXAMPLE Get-SchoolUserExtended -User_ID 2230332,3243114 #> [cmdletbinding()] Param( [Parameter( Position=0, Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] [int[]]$User_ID # Array as we loop through submitted IDs ) # Get the SKY API subscription key $sky_api_config = Get-SKYAPIConfig -ConfigPath $sky_api_config_file_path $sky_api_subscription_key = $sky_api_config.api_subscription_key # Grab the security tokens $AuthTokensFromFile = Get-SKYAPIAuthTokensFromFile # Set the endpoints $endpoint = 'https://api.sky.blackbaud.com/school/v1/users/extended/' # Get data for one or more IDs foreach ($uid in $User_ID) { $response = Get-SKYAPIUnpagedEntity -uid $uid -url $endpoint -api_key $sky_api_subscription_key -authorisation $AuthTokensFromFile $response } } |