Generating a SKY SDK for .NET
Sharing here in case it's useful to anyone. This is my process for generating a .NET SDK for the SKY API. It outputs classes representing the endpoints and models in the OpenAPI spec available on developer.sky.blackbaud.com.
Steps:
- Download and install the Chocolatey package manager for Windows
- Install NSwag by running this in a shell:
choco install NSwagStudio -y - Go to https://developer.sky.blackbaud.com/api#api=school
- Click the API definition dropdown
- Click Open API 3 (JSON)
- Save the downloaded file as swagger.json in a directory
- To customize your namespace and create a base class where you can customize things like obtaining a new refresh token, create a file in the same directory called nswag.json. For example:
{
"runtime": "WinX64",
"documentGenerator": {
"fromDocument": {
"json": "swagger.json"
}
},
"codeGenerators": {
"openApiToCSharpClient": {
"namespace": "Your.Namespace.Here",
"output": "SkyApiClient.g.cs",
"clientBaseClass": "SkyApiClientBase",
"configurationClass": "SkyApiConfiguration",
"generateClientInterfaces": true,
"useHttpRequestMessageCreationMethod": true,
"jsonLibrary": "SystemTextJson"
}
}
} - In your shell, run:
nswag run
Note: The generated classes don't handle refresh tokens out of the box IIRC. I ended up writing custom refresh token logic in SkyApiClientBase (fetch from DB, detect expiration, refresh if expiring soon).
2
Categories
- All Categories
- 6 Blackbaud Community Help
- 208 bbcon®
- 1.4K Blackbaud Altru®
- 394 Blackbaud Award Management™ and Blackbaud Stewardship Management™
- 1.1K Blackbaud CRM™ and Blackbaud Internet Solutions™
- 15 donorCentrics®
- 358 Blackbaud eTapestry®
- 2.5K Blackbaud Financial Edge NXT®
- 646 Blackbaud Grantmaking™
- 562 Blackbaud Education Management Solutions for Higher Education
- 3.2K Blackbaud Education Management Solutions for K-12 Schools
- 934 Blackbaud Luminate Online® and Blackbaud TeamRaiser®
- 84 JustGiving® from Blackbaud®
- 6.4K Blackbaud Raiser's Edge NXT®
- 3.6K SKY Developer
- 242 ResearchPoint™
- 118 Blackbaud Tuition Management™
- 165 Organizational Best Practices
- 238 The Tap (Just for Fun)
- 33 Blackbaud Community Challenges
- 28 PowerUp Challenges
- 3 (Open) Raiser's Edge NXT PowerUp Challenge: Product Update Briefing
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Standard Reports+
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Email Marketing
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Gift Management
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Event Management
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Home Page
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Standard Reports
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Query
- 779 Community News
- 2.9K Jobs Board
- 53 Blackbaud SKY® Reporting Announcements
- 47 Blackbaud CRM Higher Ed Product Advisory Group (HE PAG)
- 19 Blackbaud CRM Product Advisory Group (BBCRM PAG)
