diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f47621..4500e91 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,25 @@ # Changelog for SKYAPI PowerShell Module +## [0.3.10](https://github.com/Sekers/SKYAPI/tree/0.3.10) - (2023-03-21) + +### Fixes + +- Resolved bug where Get-SchoolScheduleMeeting returned an error after DST begins in timezones that practice advancing clocks during warmer months. + +### Features + +- New Endpoint: [Get-SchoolUserAddressType](https://developer.sky.blackbaud.com/docs/services/school/operations/V1UsersAddresstypesGet) +- New Endpoint: [Get-SchoolUserAddress](https://developer.sky.blackbaud.com/docs/services/school/operations/V1UsersByUser_idAddressesGet) +- New Endpoint: [New-SchoolUserAddress](https://developer.sky.blackbaud.com/docs/services/school/operations/V1UsersByUser_idAddressesPost) + +### Other +- Updated links in README to Blackbaud API documentation as the documentation website had slightly changed structure. +- A few minor example and built-in help updates, clarifications, and typo fixes. +- Removed the 'links' parameter from New-SchoolUserPhone as Blackbaud never actually implemented this feature in the endpoint and updated their documentation. See the [February 28, 2023 Education Management API changelog](https://developer.blackbaud.com/skyapi/support/changelog/bbem) for further information. + +Author: [**@Sekers**](https://github.com/Sekers) + +--- ## [0.3.9](https://github.com/Sekers/SKYAPI/tree/0.3.9) - (2023-03-06) ### Features diff --git a/README.md b/README.md index 3374920..494ee10 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ See [CHANGELOG.md](./CHANGELOG.md) for information on the latest updates, as wel ## Current API Support -This module started out with a focus on working with the Blackbaud SKY API [Education Management School API](https://developer.blackbaud.com/skyapi/bbem/school) but [SKY API endpoints](https://developer.blackbaud.com/skyapi/products) for [Raiser's Edge NXT](https://developer.blackbaud.com/skyapi/products/renxt), [Financial Edge NXT](https://developer.blackbaud.com/skyapi/products/fenxt), [Church Management](https://developer.blackbaud.com/skyapi/products/bbcm), etc. are being added in. It is designed so that additional endpoints can be added in quickly & easily. +This module started out with a focus on working with the Blackbaud SKY API [Education Management School API](https://developer.blackbaud.com/skyapi/bbem/school) but [SKY API endpoints](https://developer.blackbaud.com/skyapi/products) for [Raiser's Edge NXT](https://developer.blackbaud.com/skyapi/renxt), [Financial Edge NXT](https://developer.blackbaud.com/skyapi/fenxt), [Church Management]https://developer.blackbaud.com/skyapi/bbcm), etc. are being added in. It is designed so that additional endpoints can be added in quickly & easily. See the [SKYAPI Wiki](https://github.com/Sekers/SKYAPI/wiki) for a list of the [endpoints currently supported](https://github.com/Sekers/SKYAPI/wiki#api-endpoints). diff --git a/SKYAPI/Functions/Get-SchoolScheduleMeeting.ps1 b/SKYAPI/Functions/Get-SchoolScheduleMeeting.ps1 index e8b9451..1b35f6a 100644 --- a/SKYAPI/Functions/Get-SchoolScheduleMeeting.ps1 +++ b/SKYAPI/Functions/Get-SchoolScheduleMeeting.ps1 @@ -146,8 +146,16 @@ function Get-SchoolScheduleMeeting # Remove the School Time Zone parameter since we don't pass it on to the API. $parameters.Remove('SchoolTimeZoneId') | Out-Null - # Convert SchoolTimeZone to TimeZoneInfo object. + # Convert SchoolTimeZone to TimeZoneInfo object. Check match for ID, then StandardName, then DaylightName. $SchoolTimeZone = Get-TimeZone -ListAvailable | Where-Object -Property Id -EQ $SchoolTimeZoneId + if ([string]::IsNullOrEmpty($SchoolTimeZone)) + { + $SchoolTimeZone = Get-TimeZone -ListAvailable | Where-Object -Property StandardName -EQ $SchoolTimeZoneId + } + if ([string]::IsNullOrEmpty($SchoolTimeZone)) + { + $SchoolTimeZone = Get-TimeZone -ListAvailable | Where-Object -Property DaylightName -EQ $SchoolTimeZoneId + } # Get the SKY API subscription key $sky_api_config = Get-SKYAPIConfig -ConfigPath $sky_api_config_file_path diff --git a/SKYAPI/Functions/Get-SchoolUserAddress.ps1 b/SKYAPI/Functions/Get-SchoolUserAddress.ps1 new file mode 100644 index 0000000..c068710 --- /dev/null +++ b/SKYAPI/Functions/Get-SchoolUserAddress.ps1 @@ -0,0 +1,69 @@ +function Get-SchoolUserAddress +{ + <# + .LINK + https://github.com/Sekers/SKYAPI/wiki + + .LINK + Endpoint: https://developer.sky.blackbaud.com/docs/services/school/operations/V1UsersByUser_idAddressesGet + + .SYNOPSIS + Education Management School API - Returns a collection addresses for one or more user IDs. + + .DESCRIPTION + Education Management School API - Returns a collection addresses for one or more user IDs. + + .PARAMETER User_ID + Required. Array of user IDs for each user you want addresses of returned. + .PARAMETER ReturnRaw + Returns the raw JSON content of the API call. + + .EXAMPLE + Get-SchoolUserAddress -User_ID 3154032,5942642 + + #> + + [cmdletbinding()] + Param( + [Parameter( + Position=0, + Mandatory=$true, + ValueFromPipeline=$true, + ValueFromPipelineByPropertyName=$true)] + [int[]]$User_ID, # Array as we loop through submitted IDs + + [Parameter( + Position=1, + ValueFromPipeline=$true, + ValueFromPipelineByPropertyName=$true)] + [switch]$ReturnRaw + ) + + # 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/' + $endUrl = '/addresses' + + # Set the response field + $ResponseField = "value" + + # Get data for one or more IDs + foreach ($uid in $User_ID) + { + if ($ReturnRaw) + { + $response = Get-SKYAPIUnpagedEntity -uid $uid -url $endpoint -endUrl $endUrl -api_key $sky_api_subscription_key -authorisation $AuthTokensFromFile -ReturnRaw + $response + continue + } + + $response = Get-SKYAPIUnpagedEntity -uid $uid -url $endpoint -endUrl $endUrl -api_key $sky_api_subscription_key -authorisation $AuthTokensFromFile -response_field $ResponseField + $response + } +} diff --git a/SKYAPI/Functions/Get-SchoolUserAddressType.ps1 b/SKYAPI/Functions/Get-SchoolUserAddressType.ps1 new file mode 100644 index 0000000..5fc4a9e --- /dev/null +++ b/SKYAPI/Functions/Get-SchoolUserAddressType.ps1 @@ -0,0 +1,54 @@ +function Get-SchoolUserAddressType +{ + <# + .LINK + https://github.com/Sekers/SKYAPI/wiki + + .LINK + Endpoint: https://developer.sky.blackbaud.com/docs/services/school/operations/V1UsersAddresstypesGet + + .SYNOPSIS + Education Management School API - Returns a collection of address types. + + .DESCRIPTION + Education Management School API - Returns a collection of address types. + Accessible by any authorized user. + + .PARAMETER ReturnRaw + Returns the raw JSON content of the API call. + + .EXAMPLE + Get-SchoolUserAddressType + #> + + [cmdletbinding()] + param( + [Parameter( + Position=0, + ValueFromPipeline=$true, + ValueFromPipelineByPropertyName=$true)] + [switch]$ReturnRaw + ) + + # Set the endpoints + $endpoint = 'https://api.sky.blackbaud.com/school/v1/users/addresstypes' + + # Set the response field + $ResponseField = "value" + + # 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 + + if ($ReturnRaw) + { + $response = Get-SKYAPIUnpagedEntity -url $endpoint -api_key $sky_api_subscription_key -authorisation $AuthTokensFromFile -ReturnRaw + return $response + } + + $response = Get-SKYAPIUnpagedEntity -url $endpoint -api_key $sky_api_subscription_key -authorisation $AuthTokensFromFile -response_field $ResponseField + $response +} diff --git a/SKYAPI/Functions/New-SchoolUserAddress.ps1 b/SKYAPI/Functions/New-SchoolUserAddress.ps1 new file mode 100644 index 0000000..53e1a60 --- /dev/null +++ b/SKYAPI/Functions/New-SchoolUserAddress.ps1 @@ -0,0 +1,200 @@ +function New-SchoolUserAddress +{ + <# + .LINK + https://github.com/Sekers/SKYAPI/wiki + + .LINK + Endpoint: https://developer.sky.blackbaud.com/docs/services/school/operations/V1UsersByUser_idAddressesPost + + .SYNOPSIS + Education Management School API - Creates a new address record for the specified user IDs and returns the ID of the address created. + + .DESCRIPTION + Education Management School API - Creates a new address record for the specified user IDs and returns the ID of the address created. + + .PARAMETER User_ID, + Required. Array of the user IDs. + .PARAMETER type_id + Required. The type ID of the specified address. The type ID corresponds with the type of address (ex. Business/College, Home, Summer). + Use Get-SchoolUserAddressType to get a list of address types. + .PARAMETER country + Required. Country full name (e.g., United States). Must be a full country name from the school's list of countries. + .PARAMETER line_one + Required. Address Line 1 (e.g., 123 Main Street). + .PARAMETER line_two + Address Line 2 (e.g., Suite 100). + .PARAMETER line_three + Address Line 3. + .PARAMETER city + City (e.g., Charelston). + .PARAMETER state + State 2-letter abbreviation (e.g., SC) or full name. Available only with country choices that use states. + .PARAMETER postal_code + Postal code. + .PARAMETER province + Province. Available only with country choices that use provinces. + .PARAMETER region + Region. + .PARAMETER mailing_address + Set to true to set this address as a mailing address. A user can have multiple mailing addresses. + .PARAMETER primary + Set to true to make this the primary address. A user can have only one primary address. + + .EXAMPLE + New-SchoolUserAddress -User_ID 3156271 -type_id 1005 -country 'United States' -line_one '129 Huntington Drive' + .EXAMPLE + $params = @{ + 'User_ID' = 3156271 + 'type_id' = 1005 + 'country' = "United States" + 'line_one' = "129 Huntington Drive" + 'line_two' = "Unit 406" + 'line_three' = "Lower Level" + 'city' = "Chicago" + 'state' = "IL" + 'postal_code' = "60601" + 'province' = "Angus" + 'region' = "North Central" + 'mailing_address' = $true + 'primary' = $true + } + New-SchoolUserAddress @params + #> + + [cmdletbinding()] + Param( + [Parameter( + Position=0, + Mandatory=$true, + ValueFromPipeline=$true, + ValueFromPipelineByPropertyName=$true)] + [int[]]$User_ID, # Array as we loop through submitted IDs + + [Parameter( + Position=1, + Mandatory=$true, + ValueFromPipeline=$true, + ValueFromPipelineByPropertyName=$true)] + [int]$type_id, + + [Parameter( + Position=2, + Mandatory=$true, + ValueFromPipeline=$true, + ValueFromPipelineByPropertyName=$true)] + [string]$country, + + [Parameter( + Position=3, + Mandatory=$true, + ValueFromPipeline=$true, + ValueFromPipelineByPropertyName=$true)] + [string]$line_one, + + [Parameter( + Position=4, + Mandatory=$false, + ValueFromPipeline=$true, + ValueFromPipelineByPropertyName=$true)] + [string]$line_two, + + [Parameter( + Position=5, + Mandatory=$false, + ValueFromPipeline=$true, + ValueFromPipelineByPropertyName=$true)] + [string]$line_three, + + [Parameter( + Position=6, + Mandatory=$false, + ValueFromPipeline=$true, + ValueFromPipelineByPropertyName=$true)] + [string]$city, + + [Parameter( + Position=7, + Mandatory=$false, + ValueFromPipeline=$true, + ValueFromPipelineByPropertyName=$true)] + [string]$state, + + [Parameter( + Position=8, + Mandatory=$false, + ValueFromPipeline=$true, + ValueFromPipelineByPropertyName=$true)] + [string]$postal_code, + + [Parameter( + Position=9, + Mandatory=$false, + ValueFromPipeline=$true, + ValueFromPipelineByPropertyName=$true)] + [string]$province, + + [Parameter( + Position=10, + Mandatory=$false, + ValueFromPipeline=$true, + ValueFromPipelineByPropertyName=$true)] + [string]$region, + + [Parameter( + Position=11, + Mandatory=$false, + ValueFromPipeline=$true, + ValueFromPipelineByPropertyName=$true)] + [bool]$mailing_address, + + [Parameter( + Position=12, + Mandatory=$false, + ValueFromPipeline=$true, + ValueFromPipelineByPropertyName=$true)] + [bool]$primary + ) + + # Set the endpoints + $endpoint = 'https://api.sky.blackbaud.com/school/v1/users/' + $endUrl = '/addresses' + + # Set the parameters + $parameters = @{} + foreach ($parameter in $PSBoundParameters.GetEnumerator()) + { + $parameters.Add($parameter.Key,$parameter.Value) + } + + # Remove the $User_ID parameter since we don't pass that on + $parameters.Remove('User_ID') | Out-Null + + # 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 + + # Verify the address type doesn't already exists for any of the users. + foreach ($uid in $User_ID) + { + $UserAddresses = Get-SchoolUserAddress -User_ID $uid + if ($UserAddresses.type_id -contains $type_id) + { + throw "User $uid already has address of type id $type_id" + } + } + + # Set data for one or more IDs + foreach ($uid in $User_ID) + { + # Clear out old user_id parameter and add in new. NO IDEA WHY THEY NEED THIS IN THE REQUEST BODY AS IT'S PART OF THE ENDPOINT URL. + $parameters.Remove('user_id') | Out-Null + $parameters.Add('user_id',$uid) + + $response = Submit-SKYAPIEntity -uid $uid -url $endpoint -end $endUrl -api_key $sky_api_subscription_key -authorisation $AuthTokensFromFile -params $parameters + $response + } +} diff --git a/SKYAPI/Functions/New-SchoolUserOccupation.ps1 b/SKYAPI/Functions/New-SchoolUserOccupation.ps1 index a1bc490..4432698 100644 --- a/SKYAPI/Functions/New-SchoolUserOccupation.ps1 +++ b/SKYAPI/Functions/New-SchoolUserOccupation.ps1 @@ -51,7 +51,7 @@ function New-SchoolUserOccupation New-SchoolUserOccupation -User_ID 3156271, 3294459 -business_name "Don's Auto" -job_title "Director of Shiny Things" -current $true .EXAMPLE $params = @{ - '-User_ID' = 3156271 + 'User_ID' = 3156271 'business_name' = "Don's Auto" 'job_title' = "Director of Shiny Things" 'business_url' = "https://donsauto.com" diff --git a/SKYAPI/Functions/New-SchoolUserPhone.ps1 b/SKYAPI/Functions/New-SchoolUserPhone.ps1 index f83da24..5621005 100644 --- a/SKYAPI/Functions/New-SchoolUserPhone.ps1 +++ b/SKYAPI/Functions/New-SchoolUserPhone.ps1 @@ -20,20 +20,6 @@ function New-SchoolUserPhone .PARAMETER type_id Required. The type ID of the specified phone number. The type ID corresponds with the type of phone number (ex. Cell, Work, Home). Use Get-SchoolUserPhoneType to get a list of phone types. - .PARAMETER links - Optional array of PhoneTypeLink objects for linking. Each PSObject should match the PhoneTypeLink Model. - More Info: https://developer.sky.blackbaud.com/docs/services/school/operations/V1UsersByUser_idPhonesPost#PhoneTypeLink - Schema: - "links": [ - { - "id": 0, - "shared": true, - "shared_relationship": "string", - "shared_user": "string", - "type_id": "string", - "user_id": 0 - } - ] .EXAMPLE New-SchoolUserPhone -User_ID 3154032,5942642 -number "(555) 555-5555" -type_id 331 @@ -60,13 +46,7 @@ function New-SchoolUserPhone Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] - [int]$type_id, - - [Parameter( - Position=3, - ValueFromPipeline=$true, - ValueFromPipelineByPropertyName=$true)] - [array]$links # Optional array of PhoneTypeLink objects for linking. + [int]$type_id ) # Set the endpoints @@ -83,23 +63,6 @@ function New-SchoolUserPhone # Remove the $User_ID parameter since we don't pass that on $parameters.Remove('User_ID') | Out-Null - # Build PhoneTypeLink Model - if ($links.Count -ge 1) - { - #TODO Verify PhoneTypeLinks Format (this functionality isn't working yet so I don't know what needs to be done to verify) - foreach ($PhoneTypeLink in $links) - { - # $($PhoneTypeLink | Get-Member -MemberType NoteProperty).count - throw "Sorry. Using SKY API to link phone numbers between users doesn't currently work. Blackbaud is aware of the issue with this endpoint and is looking into it." - } - } - else # No related users to link so create array with one empty object (otherwise the API returns an error). - { - $PhoneTypeLink = [PSCustomObject]@{} - [array]$PhoneTypeLinks = @($PhoneTypeLink) - $parameters.Add('links',$PhoneTypeLinks) - } - # 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 diff --git a/SKYAPI/Functions/Update-SchoolUserAddress.ps1 b/SKYAPI/Functions/Update-SchoolUserAddress.ps1 new file mode 100644 index 0000000..3e0efb9 --- /dev/null +++ b/SKYAPI/Functions/Update-SchoolUserAddress.ps1 @@ -0,0 +1,193 @@ +function Update-SchoolUserAddress +{ + <# + .LINK + https://github.com/Sekers/SKYAPI/wiki + + .LINK + Endpoint: https://developer.sky.blackbaud.com/docs/services/school/operations/V1UsersByUser_idAddressesByAddress_idPatch + + .SYNOPSIS + Education Management School API - Updates the address record of a user. Returns the ID of the address just updated upon success. + + .DESCRIPTION + Education Management School API - pdates the address record of a user. Returns the ID of the address just updated upon success. + Requires at least one of the following roles in the Education Management system: + - SKY API Data Sync + + .PARAMETER user_id + Required. User ID for the user you want to update the address of. + .PARAMETER address_id + Required. The ID of the address to be updated. + .PARAMETER type_id + The type ID of the specified address. The type ID corresponds with the type of address (ex. Business/College, Home, Summer). + Use Get-SchoolUserAddressType to get a list of address types. + .PARAMETER country + Country full name (e.g., United States). Must be a full country name from the school's list of countries. + .PARAMETER line_one + Address Line 1 (e.g., 123 Main Street). + .PARAMETER line_two + Address Line 2 (e.g., Suite 100). + .PARAMETER line_three + Address Line 3. + .PARAMETER city + City (e.g., Charelston). + .PARAMETER state + State 2-letter abbreviation (e.g., SC) or full name. Available only with country choices that use states. + .PARAMETER postal_code + Postal code. + .PARAMETER province + Province. Available only with country choices that use provinces. + .PARAMETER region + Region. + .PARAMETER mailing_address + Set to true to set this address as a mailing address. A user can have multiple mailing addresses. + .PARAMETER primary + Set to true to make this the primary address. A user can have only one primary address. + + + + + + + .EXAMPLE + Update-SchoolUser -User_ID 1757293 -custom_field_one "my data" -email "useremail@domain.edu" -first_name "John" -preferred_name "Jack" + .EXAMPLE + Update-SchoolUser -User_ID 1757293,2878846 -custom_field_one "my data" + #> + + [cmdletbinding()] + Param( + [Parameter( + Position=0, + Mandatory=$true, + ValueFromPipeline=$true, + ValueFromPipelineByPropertyName=$true)] + [int]$user_id, + + [Parameter( + Position=1, + Mandatory=$true, + ValueFromPipeline=$true, + ValueFromPipelineByPropertyName=$true)] + [int]$address_id, + + [Parameter( + Position=2, + Mandatory=$false, + ValueFromPipeline=$true, + ValueFromPipelineByPropertyName=$true)] + [int]$type_id, + + [Parameter( + Position=3, + Mandatory=$false, + ValueFromPipeline=$true, + ValueFromPipelineByPropertyName=$true)] + [string]$country, + + [Parameter( + Position=4, + Mandatory=$false, + ValueFromPipeline=$true, + ValueFromPipelineByPropertyName=$true)] + [string]$line_one, + + [Parameter( + Position=5, + Mandatory=$false, + ValueFromPipeline=$true, + ValueFromPipelineByPropertyName=$true)] + [string]$line_two, + + [Parameter( + Position=6, + Mandatory=$false, + ValueFromPipeline=$true, + ValueFromPipelineByPropertyName=$true)] + [string]$line_three, + + [Parameter( + Position=7, + Mandatory=$false, + ValueFromPipeline=$true, + ValueFromPipelineByPropertyName=$true)] + [string]$city, + + [Parameter( + Position=8, + Mandatory=$false, + ValueFromPipeline=$true, + ValueFromPipelineByPropertyName=$true)] + [string]$state, + + [Parameter( + Position=9, + Mandatory=$false, + ValueFromPipeline=$true, + ValueFromPipelineByPropertyName=$true)] + [string]$postal_code, + + [Parameter( + Position=10, + Mandatory=$false, + ValueFromPipeline=$true, + ValueFromPipelineByPropertyName=$true)] + [string]$province, + + [Parameter( + Position=11, + Mandatory=$false, + ValueFromPipeline=$true, + ValueFromPipelineByPropertyName=$true)] + [string]$region + ) + + throw "Sorry, the function for this endpoint is not currently available. It will be made available in a future release." + + # Set the endpoints + $endpoint = 'https://api.sky.blackbaud.com/school/v1/users/' + $endUrl = "/addresses/$($address_id)" + + # Set the parameters + $parameters = @{} + foreach ($parameter in $PSBoundParameters.GetEnumerator()) + { + $parameters.Add($parameter.Key,$parameter.Value) + } + + # Remove the Address ID parameter since we don't pass it on this way. + $parameters.Remove('address_id') | Out-Null + + + + $parameters.Remove('user_id') | Out-Null + + # # Add the Address ID in the way the endpoint wants. + # $parameters.Add('id',$address_id) + + # Build AddressTypeLink Model + # No related users to link so create array with one empty object (otherwise the API returns an error). + + # $AddressTypeLink = [PSCustomObject]@{} + # [array]$AddressTypeLinks = @($AddressTypeLink) + # $parameters.Add('links',$AddressTypeLinks) + + + # 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 data for one or more IDs + + # DO I REALLY NEED TO DO THIS? WHY DID I DO IT FOR THE OTHER UPDATE? THE FOREACH? + [hashtable]$uid_parameters = $parameters.Clone() + $uid_parameters.Add('id',$address_id) + + + $response = Update-SKYAPIEntity -url $endpoint -uid $user_id -endUrl $endUrl -api_key $sky_api_subscription_key -authorisation $AuthTokensFromFile -params $uid_parameters + $response +} diff --git a/SKYAPI/SKYAPI.psd1 b/SKYAPI/SKYAPI.psd1 index 746ba6f..1f43789 100644 --- a/SKYAPI/SKYAPI.psd1 +++ b/SKYAPI/SKYAPI.psd1 @@ -12,7 +12,7 @@ RootModule = 'SKYAPI.psm1' # Version number of this module. -ModuleVersion = '0.3.9' +ModuleVersion = '0.3.10' # Supported PSEditions CompatiblePSEditions = @('Desktop','Core') @@ -108,6 +108,8 @@ FunctionsToExport = @( 'Get-SchoolTerm', 'Get-SchoolTimeZone', 'Get-SchoolUser', + 'Get-SchoolUserAddress', + 'Get-SchoolUserAddressType', 'Get-SchoolUserBBIDStatus', 'Get-SchoolUserByRole', 'Get-SchoolUserEducation', @@ -123,11 +125,13 @@ FunctionsToExport = @( 'Get-SchoolVenueBuilding', 'Get-SchoolYear', 'New-SchoolEventCategory', + 'New-SchoolUserAddress', 'New-SchoolUserOccupation', 'New-SchoolUserPhone', 'Remove-SchoolUserRelationship', 'Set-SchoolUserRelationship', - 'Update-SchoolUser' + 'Update-SchoolUser', + 'Update-SchoolUserAddress' ) # Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. diff --git a/Sample_Usage_Scripts/@SKYAPI Module/SKYAPI_Examples.ps1 b/Sample_Usage_Scripts/@SKYAPI Module/SKYAPI_Examples.ps1 index 2057a8e..0703d64 100644 --- a/Sample_Usage_Scripts/@SKYAPI Module/SKYAPI_Examples.ps1 +++ b/Sample_Usage_Scripts/@SKYAPI Module/SKYAPI_Examples.ps1 @@ -321,6 +321,38 @@ # Update-SchoolUser -User_ID 1757293 -custom_field_one "my data" -email "useremail@domain.edu" -first_name "John" -preferred_name "Jack" # Update-SchoolUser -User_ID 1757293,2878846 -custom_field_one "my data" +<# + Get-SchoolUserAddressType +#> +# Get-SchoolUserAddressType + +<# + Get-SchoolUserAddress +#> +# Get-SchoolUserAddress -User_ID 3154032,5942642 + +<# + New-SchoolUserAddress + (Use Get-SchoolUserAddressType to get a list of address types) +#> +# New-SchoolUserAddress -User_ID 3156271 -type_id 1005 -country 'United States' -line_one '129 Huntington Drive' +# $params = @{ +# 'User_ID' = 3156271 +# 'type_id' = 1005 +# 'country' = "United States" +# 'line_one' = "129 Huntington Drive" +# 'line_two' = "Unit 406" +# 'line_three' = "Lower Level" +# 'city' = "Chicago" +# 'state' = "IL" +# 'postal_code' = "60601" +# 'province' = "Angus" +# 'region' = "North Central" +# 'mailing_address' = $true +# 'primary' = $true +# } +# New-SchoolUserAddress @params + <# Get-SchoolUserPhoneType #> @@ -334,8 +366,6 @@ <# New-SchoolUserPhone (Use Get-SchoolUserPhoneType to get a list of phone types) - Notes: Linking using the -links parameter doesn't currently work and Blackbaud is looking into the issue with the endpoint. - You can specify multiple user IDs with this function but it will not link them (each user record will have the number added without them sharing it). #> # New-SchoolUserPhone -User_ID 3154032,5942642 -number "(555) 555-5555" -type_id 331 @@ -344,7 +374,7 @@ #> # New-SchoolUserOccupation -User_ID 3156271, 3294459 -business_name "Don's Auto" -job_title "Director of Shiny Things" -current $true # $params = @{ -# '-User_ID' = 3156271 +# 'User_ID' = 3156271 # 'business_name' = "Don's Auto" # 'job_title' = "Director of Shiny Things" # 'business_url' = "https://donsauto.com" diff --git a/Sample_Usage_Scripts/Blackbaud SIS Teacher Schedules to Google Calendar CSVs/README.md b/Sample_Usage_Scripts/Blackbaud SIS Teacher Schedules to Google Calendar CSVs/README.md new file mode 100644 index 0000000..fb3121f --- /dev/null +++ b/Sample_Usage_Scripts/Blackbaud SIS Teacher Schedules to Google Calendar CSVs/README.md @@ -0,0 +1,15 @@ +# Blackbaud SIS Teacher Schedules to Google Calendar CSVs + +## Overview +A sample PowerShell script that uses the PowerShell SKYAPI Module to create importable Google Calendar schedules for faculty from the Blackbaud School Envirionment. It outputs CSV files, one for each teacher. Teachers can manually import as needed. Throw them in a shared Google Drive folder or somewhere else for easy access. + +## Prerequisites +- SKYAPI PowerShell Module (https://github.com/Sekers/SKYAPI) +- Create a Blackbaud app registration to enable API access. See the SKYAPI PowerShell Module Wiki for more information. + +## File: 'Create Importable Faculty Google Calendar CSVs.ps1' +The script. Edit the config variables as needed. + +## File: 'Import Teacher Schedule into Google Calendar - Teacher Instructions.docx' +Sample instruction page to give to your faculty as end-users. +