Using SDK to connect to the API from a C# .Net Framework Web API
Hi!
I am integrating Docusign into my C# Web API solution and I opted to use the SDK as a tool for the integration.
When I tried to make an authorization call to DocuSign, I was getting an error in line 1120 in the Class DocuSign.eSign.Client.DocuSignClient. DocuSignResponse docuSignResponse = RestClient.SendRequest(request);
The error was empty because the 'docuSignResponse.Content' was also empty so I had no clue where the issue was coming from. I took the same identical code and attempted to do an authorization from a console app and this worked fine.
Following the suggestion of Senior Support Manager Ivan Dinkov, I downloaded the SDK code and added it to my solution so I can debug it. Ultimately I found that the issue was that a TLS connection could not be established, however, I was not getting this error message but instead, I got an empty response. The problem is coming from the catch of the method SystemNetHttpClient.SendRequestAsync. because the real error was being masked by an empty 500 Internal Server Error with an empty response.Content.
It would be better if the actual error is returned instead of an empty string as I would have identified the issue immediately.
On the other hand, the actual issue was that the following code was missing and once I added it, it worked perfectly. ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11;
I added this in my code since I am using .Net Framework 4.6.2. Would it not be a good idea to add the security protocols in the SDK so that these are established for anyone using the SDK and trying to connect to the eSignature API from another API?
Thanks for your time!
Hello Neville,
We reached out to the Developers, and the Enhancement Ticket TIERBUGS-37647 was created to Enhance the Error Handling for the use case you reported. If you have any questions, you can reach out to the Support Team with this ticket.
Best,