Thursday, February 20, 2020

#751 OIC - DocuSign adapter

I just had a customer asking me about this, so I thought it was time for me to try it out.
To be honest, I have not looked at this adapter previously, but nothing like customer questions to whet the appetite.

So what does DocuSign offer?
eSignatures - a way to digitally sign documents etc.
In fact, much more than this. You can check it out here

As usual I didn't start by reading the DocuSign adapter doc, the anarchist/autodidact in me rebels against such pedestrian behaviour; however, I strongly suggest you do peruse it. Just click here

btw. text taken from the docuSign REST api docs is shown in italics.

Creating a DocuSign Developer's Account

Step 1, as with all app adapters is to get access to the target app, in this case, DocuSign.
A very simple task - just create a DocuSign developer's account.

Create the developer account and a Sandbox.

Then login -

Click on Admin -

Check out the menu on the left -

Click on API and Keys -

Add an App - you will get an Integration Key generated -

Copy the Integration key, you will need this later.

Click on the App, in my case OICApp  -

Copy the Secret key, you will need this later.

add the OIC redirect URI to your App definition -


Create the DocuSign connection in OIC 

Note the Scope: AFAIK - DocuSign supports 3 -
signature, signature extended and impersonation.

I choose signature extended.

Click Provide Consent -

The Provide Consent will require you to enter the following -

Client Id - Integration Key
Client Secret - Secret Key
Redirect URI - https://yourOIC:443/icsapis/agent/oauth/callback
Scope - signature extended
Path to persist Access Token -

Now that our connection is complete - on to the integration.

Creating an integration with DocuSign

Now to my use case - Request Signature on Single Document by Email - in this case, a timesheet.

I convert this pdf to base64, I will need this later.

Now to the configuration of the DocuSign connection in this integration -

So what are Envelopes in DocuSign speak?
Check out their REST API docs here

Now let's look at the mapping -

The payload is loosely based on that described in the DocuSign API docs -

full doc here

Let's go thru the request fields I've set -

let's check out documents -

A Document object represents the document content to be reviewed or signed by a recipient and contains metadata such as the document’s ID, name, and file extension. Documents are always defined as part of the documents property in an envelope or a template.

The document file included in the object can be a file in a variety of formats, including PDF, Word, HTML, and others. When you add one of these files to an envelope, the DocuSign platform converts it to PDF and stores it as base64-encoded ASCII.

Hence me converting my Timesheet.pdf to base64 earlier.

Net, net, what I expect to happen here is that I get sent an email asking me to sign Timesheet.pdf.

I activate the integration and test - and, quelle suprise, I receive the email 

I click on Review Document - and then click on Start

I click Continue and, in due course, receive the confirmation email 

I view the completed document -

All so easy with OIC.

No comments: