Blog
Home/

153 Docusign API code examples (and more to come!)

Author Larry Kluger
Larry KlugerDocuSign Lead Product Manager for Partner Platforms
Summary3 min read

Get code examples in all our supported SDK languages.

      • Getting started with the code example launchers
      • Notable workflow code examples
        • What’s Next

      Table of contents

      The easiest way to write software is to start with “known-good” software, then update it to meet your own specific requirements. Starting with software you know works also helps with debugging.

      In 2018, I focused on re-writing the Docusign eSignature API code examples for our developers, providing new examples that are easier to use, more representative of real-world use cases and patterns, and supporting more programming languages. We now have the following examples:

      • New workflow code examples that use the current versions of the Docusign SDKs are available on github.com/docusign in all of our primary languages: C#, PHP, Java, Node.js, Python, and Ruby. Code examples showing how to call the API directly are also available. They use the cURL utility.

      • Each new code example has been grouped into a launcher, which provides access to all of the workflow code examples for a given language. Each launcher includes software for authenticating with Docusign via either the Authorization Code Grant flow or the JWT Grant flow.

      • Each workflow code example can be used with either type of authentication. For example, you can list and then download an envelope’s documents (workflow examples 6 and 7) using either the Authorization Code or JWT Grant flows--all you need to do is pass in an access token, account_id, and base_path from the authentication flow. The primary launchers, each of which includes 14 – 18 workflow examples, are the Github repositories that include support for the OAuth Authorization Code Grant flow

      Getting started with the code example launchers

      So how do you use them? First, decide which language you want to use: C#, PHP, Java, Node.js, Python, Ruby, or the direct API examples via cURL. Next, click the link, download the launcher’s repository, and follow the instructions in the readme file for configuring and running it.

      The example projects listed above all implement Authorization Code Grant authentication to obtain an access token, but we also provide examples of how to implement the OAuth JWT Grant flow. You can access code examples that implement JWT authentication from the following list: C# .NET Core, C# .NET Framework, PHP, Java, Node.js, Python, and Ruby.

      Notable workflow code examples

      The code example launchers include many different workflow examples. Here are some of the most notable examples.

      • The embedded signing example (example workflow 1 of the authorization code grant launchers) demonstrates a good UI for embedding the Docusign Signing Ceremony within your app’s flow. Note the busy indicator that’s used to reassure the user that something is happening.

      • The sign via email example (example workflow 2) demonstrates how an envelope can include multiple documents of different source types.

      • Sending an envelope with binary upload of the documents (example workflow 10) demonstrates the best way to send envelopes that include large documents or document sets.

      What’s Next

      Within the Docusign DevCenter team, we’re working to add additional workflow examples to the launchers. We’re also working on articles about each workflow example, which will be published in the DevCenter.

      If you have an idea for a new code example, please let me know via developers@docusign.com.

      Author Larry Kluger
      Larry KlugerDocuSign Lead Product Manager for Partner Platforms

      Larry Kluger has over 40(!) years of tech industry experience as a software developer, developer advocate, entrepreneur, and product manager. An award-winning speaker with a 48K StackOverflow reputation, he enjoys giving talks and helping the ISV and developer communities.

      Twitter: @larrykluger

      LinkedIn: https://www.linkedin.com/in/larrykluger/

      More posts from this author

      Related posts

      • Fast-Track Your Extension Apps with Reference Implementations
        Code Examples

        Fast-Track Your Extension Apps with Reference Implementations

        Author Karissa Jacobsen
        Karissa Jacobsen
      • Trending Topics: Latest from our forums (October 2024)
        Author Paige Rossi
        Paige Rossi
      • From the Trenches: Testing Docusign Connect with ngrok

        From the Trenches: Testing Docusign Connect with ngrok

        Author Ivan Dinkov
        Ivan Dinkov
      Fast-Track Your Extension Apps with Reference Implementations

      Fast-Track Your Extension Apps with Reference Implementations

      Author Karissa Jacobsen
      Karissa Jacobsen
      Trending Topics: Latest from our forums (October 2024)
      Author Paige Rossi
      Paige Rossi
      From the Trenches: Testing Docusign Connect with ngrok

      From the Trenches: Testing Docusign Connect with ngrok

      Author Ivan Dinkov
      Ivan Dinkov

      Discover what's new with Docusign IAM or start with eSignature for free

      Explore Docusign IAMTry eSignature for Free
      Person smiling while presenting