API request works in Javascript but not C#
Hi. We are trying to make requests to the General Ledger - Transaction distribution (List) endpoint. Using the JavaScript example code provided at the endpoint reference works just fine. Here is our implementation:

Unfortunately, we are unable to make a request using the C# example code provided at the endpoint reference. Here is our implementation of that:

Our implementation is exactly the same as the sample code except that we wrapped it in a try-catch, and we added the "var test = response.StatusCode". However, it still does not work even if we leave those out. Here are the error details that we get:

In case that is too small to read, the innerException is "The underlying connection was closed. An unexpected error occurred on a send."
Does anyone have any ideas as to why this is not working for us? We would rather make these requests on the server rather than the client, so we need to get the C# working.
Thanks in advance for any insight you can share,
Bryce

Unfortunately, we are unable to make a request using the C# example code provided at the endpoint reference. Here is our implementation of that:

Our implementation is exactly the same as the sample code except that we wrapped it in a try-catch, and we added the "var test = response.StatusCode". However, it still does not work even if we leave those out. Here are the error details that we get:

In case that is too small to read, the innerException is "The underlying connection was closed. An unexpected error occurred on a send."
Does anyone have any ideas as to why this is not working for us? We would rather make these requests on the server rather than the client, so we need to get the C# working.
Thanks in advance for any insight you can share,
Bryce
1
Comments
-
Hi Bryce,
Are you setting TLS protocol to something later than 1.0 (which has been deprecated)? If your default on the C# machine is TLS 1.0 then it's likely that your calls will fail.
In your (static) class type initializer, add this line:
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
You're also welcome to download our SKYLib•NET SKY API code library and SDK which includes a C# (and VB) demo application with source code which you can use to "sanity check" your own app's code. (SKYLib.NET is free for this purpose, working in rate-limited mode of 1 call/s. You can license it for an annual fee to take you up to the fastest call rate, currently 10 call/s.)
Let me know if this fixes things for you (or not).
Cheers,
Steve Cinquegrana | CEO and Principal Developer | Protégé Solutions
0 -
Steve, you're brilliant! And fast! That was the solution. Thanks for getting back to me so quickly. I really appreciate it. Merry Christmas!0
-
0
Categories
- All Categories
- 6 Blackbaud Community Help
- 210 bbcon®
- 1.4K Blackbaud Altru®
- 395 Blackbaud Award Management™ and Blackbaud Stewardship Management™
- 1.1K Blackbaud CRM™ and Blackbaud Internet Solutions™
- 15 donorCentrics®
- 360 Blackbaud eTapestry®
- 2.5K Blackbaud Financial Edge NXT®
- 649 Blackbaud Grantmaking™
- 567 Blackbaud Education Management Solutions for Higher Education
- 3.2K Blackbaud Education Management Solutions for K-12 Schools
- 937 Blackbaud Luminate Online® and Blackbaud TeamRaiser®
- 84 JustGiving® from Blackbaud®
- 6.5K Blackbaud Raiser's Edge NXT®
- 3.7K SKY Developer
- 247 ResearchPoint™
- 119 Blackbaud Tuition Management™
- 165 Organizational Best Practices
- 239 The Tap (Just for Fun)
- 33 Blackbaud Community Challenges
- 31 PowerUp Challenges
- 3 (Open) PowerUp Challenge: Data Health
- 3 (Closed) 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
- 784 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)
