Skip to content

A sample application for DocuSign that shows how to easily integrate the REST API in various scenarios Edit Add topics

License

Notifications You must be signed in to change notification settings

sistemas-grupoctl/sample-app-loanco-csharp

 
 

Repository files navigation

DocuSign LoanCo Online Sample App

Online LoanCo Sample App

LoanCo is a sample loan app that shows some common ways an application might interact with the DocuSign eSignature API. Various switches (authentication, embedded signing, templates) can be changed to show additional platform and API features and how easy they are to add to your own solution. LoanCo offers three (3) different loan workflows that demonstrate various features and workflows available through the platform.

Requirements

Approach

This sample code uses both Node.js and C#. To maintain consistency with the existing Node.js LoanCo sample app, we continued to use Node.js as a front-end web server, but replaced the Node.js code with C# where it calls the DocuSign eSignature API. Please see this blog post for more info.

Installation

git clone <repo> 
cd <repo directory>
npm install
npm install edge

Running

Run the Visual Studio solution. It will already be set to start the Node.js web server by default. Open a browser and type http://localhost:3801.

Configuration

DocuSign has multiple ways of authenticating your app. This example (storing username/password/integrator-key locally and sending in a custom X-DocuSign-Authentication header) is known as legacy auth. You can also authenticate using the OAuth2 Authorization Code Grant and Implicit Grant methods.

We use environment variables to setup our configuration. Because the LoanCo C# application uses both Node.js and C#, you need configuration variables in two places. The Visual Studio 2017 solution already contains both configuration files.

.env file (used in the Node.js project) in the root of the samplesample-app-loanco-nodejs-master project:

DOCUSIGN_ENVIRONMENT=demo  // use "www" for production  
DOCUSIGN_USERNAME=         // account email address  
DOCUSIGN_PASSWORD=         // account password
DOCUSIGN_IK=               // Integrator Key 
EMPLOYEE_EMAIL=            // used for final recipient of Personal Loan
EMPLOYEE_NAME=             // used for final recipient of Personal Loan
LOCAL_RETURN_URL=http://localhost:3801/   // change to the correct return url, with a trailing slash
BRAND_ID=                  // not required, use to show a different Brand for the Sailboat example 
GOOGLE_MAPS_API_KEY=       // required for Sailboat example to work
GOOGLE_ANALYTICS=          // UA-XYZ-1
DEFAULT_EMAIL=             // for autofilling email input fields
FORCE_HTTPS=               // force https by setting to true

App.config file (used in the C# project) in the root of the DocuSign CSharp LoanCo project (replace the values with your values and reference the descriptions above):

<appSettings>
<add key="DOCUSIGN_ENVIRONMENT" value="demo" />
<add key="DOCUSIGN_USERNAME" value="<replace>" />
<add key="DOCUSIGN_PASSWORD" value="<replace>" />
<add key="DOCUSIGN_IK" value="<replace>" />
<add key="EMPLOYEE_EMAIL" value="<replace>" />
<add key="EMPLOYEE_NAME" value="Internal LoanCo Account" />
<add key="LOCAL_RETURN_URL" value="http://localhost:3801/" />
<add key="AUTOLOAN_TEMPLATEID" value="<replace>" />
<add key="BRAND_ID" value="f157069c-3828-4073-a298-0bf5749b27bb" />
<add key="GOOGLE_MAPS_API_KEY" value="AIzaSyD1-3_ag-DVGsvLuHWfx-gOE4-F2y-rskk" />
<add key="GOOGLE_ANALYTICS" value="UA-39550292-1" />
<add key="DEFAULT_EMAIL" value="<replace>" />
<add key="FORCE_HTTPS" value="0" />
<add key="ClientSettingsProvider.ServiceUri" value="" />
</appSettings>
Templates

When initially run, the app will attempt to create a Template for the Auto Loan Application. This template is defined at pdfs/template-auto-loan.json. Upload this template into your DocuSign account. After doing so, it will generate a TemplateID, which needs to be placed in the AUTOLOAN_TEMPLATEID value in the C# configuration file above.

Errors you may encounter

{ 
    errorCode: 'ACCOUNT_LACKS_PERMISSIONS',
    message: 'This Account lacks sufficient permissions. Document Visibility has been specified.  This account does not have document visibility turned on.' 
}

Change this setting: http://imgur.com/j4VD6nd

API Tools and Links

Developer Center
https://www.docusign.com/devcenter

API Recipes (code walkthroughs)
https://www.docusign.com/developer-center/recipes

API Documentation
https://docs.docusign.com/

API Explorer
https://apiexplorer.docusign.com/

License

The DocuSign LoanCo Sample App is licensed under the MIT License.

About

A sample application for DocuSign that shows how to easily integrate the REST API in various scenarios Edit Add topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 37.2%
  • JavaScript 32.5%
  • C# 27.7%
  • CSS 2.6%