Best practice - call API or call C# client library

Viewed 98

We are integrating a new system with DocuSign. The system is built using C# objects.

My question is, which is the best practice to interface with DocuSign - call the DocuSign Web API methods directly, or include the DocuSign C# client library as a reference to our code, and call that directly?

Thanks!

2 Answers

I recommend using the C# client library. It will save you time and make it very easy to use. The code for it is also public in github, so if for some reason you want to fork and use it that way - you can do that too.

The DocuSign C# SDK saves you the bother of:

  • serializing the request objects into a JSON structure
  • sending the HTTPS request
  • deserializing the response objects into C# objects.

It also includes helper methods for implementing the OAuth JWT Grant flow.

These are all good reasons to use the SDK.

If you expect that you will be regularly sending documents that are above 20MB in size then you may want to implement the Envelopes::create call yourself. Why? Because the current version of the SDK BASE64 encodes the documents you upload to DocuSign.

If you implement the Envelopes::create call yourself, you can send the documents in binary. This isn't so easy to do but is important if you have very large source documents. An example of how to send in binary mode.

Added

Size limits: 25MB per API call. But document(s) in an API call that are BASE64 encoded have alot of overhead. So in this case, the effective max doc size is around 20 MB.

You can have multiple documents in an envelope. To have multiple large documents, create the envelope as a draft, then upload the additional documents as separate API calls.

See the API Limits document

Related