Skip to content

Commit

Permalink
Merge pull request #36 from Sekers/develop
Browse files Browse the repository at this point in the history
Develop into Master 0.3.9
  • Loading branch information
Sekers committed Mar 6, 2023
2 parents 72f8149 + cf8c809 commit 7862b98
Show file tree
Hide file tree
Showing 19 changed files with 304 additions and 31 deletions.
17 changes: 16 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Changelog for SKYAPI PowerShell Module

## [0.3.9](https://github.com/Sekers/SKYAPI/tree/0.3.9) - (2023-03-06)

### Features

- New Endpoint: [Get-SchoolSession](https://developer.sky.blackbaud.com/docs/services/school/operations/V1SessionsGet)
- New Endpoint: [Get-SchoolResourceBoard](https://developer.sky.blackbaud.com/docs/services/school/operations/V1ContentResourcesGet)
- 'Get-SchoolAssignmentBySection' & 'Get-SchoolScheduleMeeting' now allow spaces in the types/offering_types parameters.
- New Example Script: [Blackbaud SIS Teacher Schedules to Google Calendar CSVs](https://github.com/Sekers/SKYAPI/tree/master/Sample_Usage_Scripts/Blackbaud%20SIS%20Teacher%20Schedules%20to%20Google%20Calendar%20CSVs). Creates importable Google Calendar schedules for faculty from the Blackbaud School Envirionment.

### Other
- Built-in help updates regarding necessary permissions to access some endpoints (Blackbaud [loosened the requirements](https://developer.blackbaud.com/skyapi/support/changelog/bbem?_ga=2.83020246.1587108373.1678131781-1653312318.1663684217) on a bunch of general information ones).

Author: [**@Sekers**](https://github.com/Sekers)

---
## [0.3.8](https://github.com/Sekers/SKYAPI/tree/0.3.8) - (2023-02-13)

### Fixes
Expand Down Expand Up @@ -136,7 +151,7 @@ Author: [**@Sekers**](https://github.com/Sekers)
- Module now works with POST & PATCH endpoints, thus allowing for NEW-* & UPDATE-* PowerShell functions against the SKY API.
- New Endpoint: [Get-SchoolUserPhoneList](https://developer.sky.blackbaud.com/docs/services/school/operations/V1UsersByUser_idPhonesGet)
- New Endpoint: [Get-SchoolUserPhoneTypeList](https://developer.sky.blackbaud.com/docs/services/school/operations/V1UsersPhonetypesGet)
- New Endpoint (Beta): [Get-SchoolSchedulesMeetings](https://developer.sky.blackbaud.com/docs/services/school/operations/V1SchedulesMeetingsGet)
- New Endpoint (Beta): [Get-SchoolScheduleMeetings](https://developer.sky.blackbaud.com/docs/services/school/operations/V1SchedulesMeetingsGet)
- New Endpoint: [New-SchoolEventsCategory](https://developer.sky.blackbaud.com/docs/services/school/operations/V1EventsCategoriesPost)
- New Endpoint: [New-SchoolUserPhone](https://developer.sky.blackbaud.com/docs/services/school/operations/V1UsersByUser_idPhonesPost)
- New Endpoint: [Update-SchoolUser](https://developer.sky.blackbaud.com/docs/services/school/operations/V1UsersPatch)
Expand Down
7 changes: 7 additions & 0 deletions SKYAPI/Functions/Get-SchoolAssignmentBySection.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,13 @@ function Get-SchoolAssignmentBySection
$parameters.Add($parameter.Key,$parameter.Value)
}

# Remove spaces from 'types' string if included in a comma-separated list, as the endpoint doesn't allow spaces.
if ($parameters -contains 'types')
{
$parameters.Remove('types') | Out-Null
$parameters.Add('types',$($types.Replace(' ','')))
}

# Remove parameters since we don't pass them on to the API.
$parameters.Remove('Section_ID') | Out-Null
$parameters.Remove('ReturnRaw') | Out-Null
Expand Down
4 changes: 1 addition & 3 deletions SKYAPI/Functions/Get-SchoolDepartment.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ function Get-SchoolDepartment
.DESCRIPTION
Education Management School API - Returns a collection of academic departments.
Requires at least one of the following roles in the Education Management system:
- Academic Group Manager
- Platform Manager
Accessible by any authorized user.
.PARAMETER level_id
Optional parameter to specify a school level ID to limit response to departments of a specific school level.
Expand Down
1 change: 1 addition & 0 deletions SKYAPI/Functions/Get-SchoolGradeLevel.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ function Get-SchoolGradeLevel
.DESCRIPTION
Education Management School API - Returns a collection of grade levels.
Accessible by any authorized user.
.PARAMETER ReturnRaw
Returns the raw JSON content of the API call.
Expand Down
11 changes: 1 addition & 10 deletions SKYAPI/Functions/Get-SchoolLevel.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,7 @@ function Get-SchoolLevel
.DESCRIPTION
Education Management School API - Returns a collection of core school levels.
Requires at least one of the following roles in the Education Management system:
- Academic Group Manager
- Activity Group Manager
- Advisory Group Manager
- Athletic Group Manager
- Dorm Group Manager
- Dorm Supervisor
- Platform Manager
- Schedule Manager
- SKY API Data Sync
Accessible by any authorized user.
.PARAMETER ReturnRaw
Returns the raw JSON content of the API call.
Expand Down
54 changes: 54 additions & 0 deletions SKYAPI/Functions/Get-SchoolResourceBoard.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
function Get-SchoolResourceBoard
{
<#
.LINK
https://github.com/Sekers/SKYAPI/wiki
.LINK
Endpoint: https://developer.sky.blackbaud.com/docs/services/school/operations/V1ContentResourcesGet
.SYNOPSIS
Education Management School API - Returns a collection of Resources.
.DESCRIPTION
Education Management School API - Returns a collection of Resources.
Requires the 'Parent', 'Faculty' or 'Student' role in the Education Management system.
.PARAMETER ReturnRaw
Returns the raw JSON content of the API call.
.EXAMPLE
Get-SchoolResourceBoard
#>

[cmdletbinding()]
param(
[Parameter(
Position=0,
ValueFromPipeline=$true,
ValueFromPipelineByPropertyName=$true)]
[switch]$ReturnRaw
)

# Set the endpoints
$endpoint = 'https://api.sky.blackbaud.com/school/v1/content/resources'

# 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
}
11 changes: 1 addition & 10 deletions SKYAPI/Functions/Get-SchoolRole.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,7 @@ function Get-SchoolRole
.DESCRIPTION
Education Management School API - Returns a collection of core school user roles.
Requires at least one of the following roles in the Education Management system:
- Academic Group Manager
- Activity Group Manager
- Advisory Group Manager
- Athletic Group Manager
- Dorm Group Manager
- Dorm Supervisor
- Platform Manager
- Schedule Manager
- SKY API Data Sync
Accessible by any authorized user.
.PARAMETER ReturnRaw
Returns the raw JSON content of the API call.
Expand Down
10 changes: 9 additions & 1 deletion SKYAPI/Functions/Get-SchoolScheduleMeeting.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ function Get-SchoolScheduleMeeting
If not specified, defaults to 30 days from start_date.
.PARAMETER offering_types
Can take a single or multiple values as a comma delimited string of integers (defaults to 1 'Academics').
IMPORTANT NOTE: NO SPACES ALLOWED BETWEEN VALUES!!!! (e.g., "1,3" is the correct way, NOT "1, 3")
Use Get-SchoolOfferingType to get a list of offering types.
.PARAMETER section_ids
Comma delimited list of integer values for the section identifiers to return. By default the route returns all sections.
Expand Down Expand Up @@ -135,6 +134,15 @@ function Get-SchoolScheduleMeeting
$parameters.Add($parameter.Key,$parameter.Value)
}

# IMPORTANT NOTE: NO SPACES ALLOWED BETWEEN VALUES FOR 'offering_types' STRING!!!! (e.g., "1,3" is the correct way, NOT "1, 3")
# It will still process the query if there is a string, but only return results for the first value.
# Remove spaces from 'offering_types' string if included in a comma-separated list.
if ($parameters -contains 'offering_types')
{
$parameters.Remove('offering_types') | Out-Null
$parameters.Add('offering_types',$($offering_types.Replace(' ','')))
}

# Remove the School Time Zone parameter since we don't pass it on to the API.
$parameters.Remove('SchoolTimeZoneId') | Out-Null

Expand Down
85 changes: 85 additions & 0 deletions SKYAPI/Functions/Get-SchoolSession.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
function Get-SchoolSession
{
<#
.LINK
https://github.com/Sekers/SKYAPI/wiki
.LINK
Endpoint: https://developer.sky.blackbaud.com/docs/services/school/operations/V1SessionsGet
.SYNOPSIS
Education Management School API - Returns a collection of sessions for a higher education institution.
.DESCRIPTION
Education Management School API - Returns a collection of sessions for a higher education institution.
Accessible by any authorized user.
.PARAMETER level_num
Filter for a specific level number.
Use Get-SchoolLevel to get a list of school levels.
.PARAMETER school_year
Filter for a specific school year.
.PARAMETER ReturnRaw
Returns the raw JSON content of the API call.
.EXAMPLE
Get-SchoolSession
.EXAMPLE
Get-SchoolSession -level_num 229 -school_year "2019-2020"
#>

[cmdletbinding()]
Param(
[Parameter(
Position=0,
ValueFromPipeline=$true,
ValueFromPipelineByPropertyName=$true)]
[int]$level_num,

[parameter(
Position=1,
ValueFromPipeline=$true,
ValueFromPipelineByPropertyName=$true)]
[string]$school_year,

[Parameter(
Position=2,
ValueFromPipeline=$true,
ValueFromPipelineByPropertyName=$true)]
[switch]$ReturnRaw
)

# Set the endpoints
$endpoint = 'https://api.sky.blackbaud.com/school/v1/sessions'

# Set the response field
$ResponseField = "value"

# Set the parameters
$parameters = [System.Web.HttpUtility]::ParseQueryString([String]::Empty)
foreach ($parameter in $PSBoundParameters.GetEnumerator())
{
$parameters.Add($parameter.Key,$parameter.Value)
}

# Remove parameters since we don't pass them on this way
$parameters.Remove('ReturnRaw') | 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

# Get data for one or more school levels
if ($ReturnRaw)
{
$response = Get-SKYAPIUnpagedEntity -url $endpoint -api_key $sky_api_subscription_key -authorisation $AuthTokensFromFile -params $parameters -ReturnRaw
$response
continue
}

$response = Get-SKYAPIUnpagedEntity -url $endpoint -api_key $sky_api_subscription_key -authorisation $AuthTokensFromFile -params $parameters -response_field $ResponseField
$response
}
2 changes: 1 addition & 1 deletion SKYAPI/Functions/Get-SchoolTimeZone.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function Get-SchoolTimeZone
.DESCRIPTION
Education Management School API - Returns the current time zone set for the school.
Requires the 'Academic Group Manager' or 'Platform Manager' role in the Education Management system.
Accessible by any authorized user.
.PARAMETER ReturnRaw
Returns the raw JSON content of the API call.
Expand Down
3 changes: 1 addition & 2 deletions SKYAPI/Functions/Get-SchoolUserGenderType.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ function Get-SchoolUserGenderType
.DESCRIPTION
Education Management School API - Returns a collection of gender types.
Requires at least one of the following roles in the Education Management system:
- SKY API Data Sync
Accessible by any authorized user.
.PARAMETER ReturnRaw
Returns the raw JSON content of the API call.
Expand Down
1 change: 1 addition & 0 deletions SKYAPI/Functions/Get-SchoolUserPhoneType.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ function Get-SchoolUserPhoneType
.DESCRIPTION
Education Management School API - Returns a collection of phone types.
Accessible by any authorized user.
.PARAMETER ReturnRaw
Returns the raw JSON content of the API call.
Expand Down
2 changes: 1 addition & 1 deletion SKYAPI/Functions/Get-SchoolYear.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function Get-SchoolYear
.DESCRIPTION
Education Management School API - Returns a list of school years.
Requires the 'Academic Group Manager', 'Schedule Manager' or 'Platform Manager' role in the Education Management system.
Accessible by any authorized user.
.PARAMETER ReturnRaw
Returns the raw JSON content of the API call.
Expand Down
4 changes: 3 additions & 1 deletion SKYAPI/SKYAPI.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'SKYAPI.psm1'

# Version number of this module.
ModuleVersion = '0.3.8'
ModuleVersion = '0.3.9'

# Supported PSEditions
CompatiblePSEditions = @('Desktop','Core')
Expand Down Expand Up @@ -97,10 +97,12 @@ FunctionsToExport = @(
'Get-SchoolNewsItem',
'Get-SchoolOfferingType',
'Get-SchoolRole',
'Get-SchoolResourceBoard',
'Get-SchoolScheduleMeeting',
'Get-SchoolSectionBySchoolLevel',
'Get-SchoolSectionByStudent',
'Get-SchoolSectionByTeacher',
'Get-SchoolSession',
'Get-SchoolStudentEnrollment',
'Get-SchoolStudentBySection',
'Get-SchoolTerm',
Expand Down
2 changes: 1 addition & 1 deletion SKYAPI/SKYAPI.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ Function Show-SKYAPIOAuthWindow

# Clear WebView2 cache in the previously specified UserDataFolder, if requested.
# Using the WebView2 SDK to clear the browsing data is best, but wasn't released until version 1.0.1245.22 of the control.
# This version SDK requires EdgeWebView2 version 102.0.1245.22 to be installed for full API compatibility.
# This version of the SDK requires EdgeWebView2 version 102.0.1245.22 to be installed for full API compatibility.
# So, we only clear the cache using the SDK if this version or higher of the WebView2 runtime is installed.
# Otherwise, we just hardcode deleting the folder.
# Note that we have to delete the folder before the control is loaded,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,17 @@
# Set-SchoolUserRelationship -User_ID 1574497 -Left_User_ID 1574374 -relationship_type Parent_Child -give_parental_access $true -list_as_parent $false -tuition_responsible_signer $false
# Set-SchoolUserRelationship -User_ID 1574497,1574461 -Left_User_ID 1574374,1574389 -relationship_type Grandparent_Grandchild -give_parental_access $true

<#
Get-SchoolSession
#>
# Get-SchoolSession

<#
Get-SchoolResourceBoard
#>
# Get-SchoolResourceBoard


###############################
# Raiser's Edge API Endpoints #
###############################
Expand Down
Loading

0 comments on commit 7862b98

Please sign in to comment.