Http Request failed
Greetings everyone,
I've been attempting to retrieve payment configurations information via an HTTP request, but unfortunately, it's consistently failing.
I can confirm that my subscription is active. Strangely, when I test this functionality in the SKY API Console environment, it operates as expected. However, when attempting the same task through ASP.NET with VB.NET source code, I encounter difficulties.
Could it be that a specific framework is required for this operation? It's worth noting that I am not utilizing .NET Core. Below, I've provided a snippet of the code used. Unfortunately, it results in an error stating: {"error":"invalid_scope","error_description":"The scope parameter was not included in the request"}
Public Shared Sub Main()
ServicePointManager.SecurityProtocol = ServicePointManager.SecurityProtocol Or SecurityProtocolType.Tls12
Dim accessToken = GetAccessToken().GetAwaiter().GetResult()
Console.WriteLine("Access Token: " & accessToken)
End Sub
Public Shared Async Function GetAccessToken() As Task(Of String)
Dim httpClient As New HttpClient()
Dim clientId As String = ""
Dim clientSecret As String = ""
Dim requestBody As String = $"grant_type=client_credentials&client_id={clientId}&client_secret={clientSecret}"
'Dim response = Await httpClient.PostAsync("https://app.blackbaud.com/oauth/authorize?", New StringContent(requestBody, System.Text.Encoding.UTF8, "application/x-www-form-urlencoded"))
Dim response = Await httpClient.PostAsync("https://oauth2.sky.blackbaud.com/token", New StringContent(requestBody, System.Text.Encoding.UTF8, "application/x-www-form-urlencoded"))
Dim jsonResponse As String = Await response.Content.ReadAsStringAsync()
Dim accessToken As String = jsonResponse.Split(""""c)(3)
Return accessToken
End Function
End Class
Comments
-
@Sumathi Babu
Before anything elseIf these are you actual client id and secret, remove it from the post.
1 -
@Sumathi Babu the “invalid scope” error suggests that you don't have the right API scope set on the app. Here is the documentation on API scopes:
It also looks like you have the “grant type” set to “client credentials”, which is only used for specific school apps using the One Roster API. The grant type should be “authorization code”, or “refresh token”.
Hope that gets you in the right direction.
Also, @Alex Wong is correct in that your “client secret” is a sensitive value and should be treated like a password. You should regenerate the client secret to secure your app and the data it's attempting to access.
Thanks!
1 -
@Ben Wong Thanks Ben. I have now defined the scope. However, still getting Bad request message. The issue I'm encountering is that the applications I've created in My Applications list are not appearing in the authorization window. Do we need to adjust some settings for this? Please see the screenshot for reference.

The newly created applications are not listed in the console to test.
0 -
@Sumathi Babu the SKY API Console is a different application that can be used to test SKY API calls to a particular environment. It cannot be used to make API calls on behalf of your application.
Your application will need a UI to enable a user to initiate the authorization flow for your application to access the user's environment. The flow is described here:
A tutorial can be found here:
Hope that helps!
1 -
@Ben Wong Thank you for your reply.
I've noticed that I'm receiving a response from the SKY API for my application only after configuring the RedirectUri. However, I'm unsure why this configuration is necessary. I don't intend to redirect after authorization; instead, I simply need the token from the response to utilize it for transactions via the API.
Additionally, I've managed to test the API for my application using the .NET Core sample provided in the Git repository. However, I've encountered difficulties achieving the same functionality using the .NET 4.5 framework. Is it feasible to call the API using WebRequest (SOAP)? If so, could you provide an example?
0
Categories
- All Categories
- 6 Blackbaud Community Help
- 209 bbcon®
- 1.4K Blackbaud Altru®
- 394 Blackbaud Award Management™ and Blackbaud Stewardship Management™
- 1.1K Blackbaud CRM™ and Blackbaud Internet Solutions™
- 15 donorCentrics®
- 359 Blackbaud eTapestry®
- 2.5K Blackbaud Financial Edge NXT®
- 646 Blackbaud Grantmaking™
- 563 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.7K 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)

