cancel
Showing results for 
Search instead for 
Did you mean: 

Integrating Microsoft flow with DocuSign Rest API

Integrating Microsoft flow with DocuSign Rest API

Creating a DocuSign Envelope with document uploaded to document library is not straight process, we need to under go many steps. DocuSign connectors has lot of limitations. In this article I will show you how to create and send DocuSign Envelope with Document uploaded to Document Library &  dynamic content in Microsoft Flow.

1.png

Step 1:

Here I am using Item Created or Modified trigger on Document Library, Yes List trigger on Document library. (If You don’t find the document library just paste the document library name in the list name field)

 2.png

Step 2:

Now add “Get file content” SharePoint Action

  3.png

Dynamic content: File name with extension from when item created

Step 3:

Create a file in One drive in root folder with the file content from above step 2

 4.png

 

Dynamic content:

  1. File name with extension from when item created.
  2. File content from Get file Action.

 

Step 4:

5.png

Dynamic content:

  1. ID from create file one drive
  2. Target type: “PDF”

You can skip step 3 & 4 if you have PDF conversion connector license. But in our case word document is uploaded in to document library and in some cases, they are using content types to create word documents in the document library.

 

Step 5:

Now PDF document is created at OneDrive in previous step, copy that file back to temp Folder in the same document library or different one.

6.png

Dynamic content:

  1. Name (When item is created or modified)
  2. File content (convert file)

 

Step 6:

Now PDF file is copied to Temp Location in SharePoint. Get that file content using get file content using path action

7.png

Dynamic content:

  1. Name (When item is created or modified) (.pdf is added manually)

Step 7:

Most Important step in this entire process, add compose action to convert File content Binary into Base64

8A.png

8B.png

Dynamic content:

  1. File content from Get file content using path in step 6

Step 8:

Now its time to push this document in to DocuSign using Rest API, Add Http action like this

Note: Here I am Using Dev Environment.

9A.png9B.png

  1. Name (When item is created or modified)
  2. Output (Compose Action Output) Bytes in Base64
  3. Email & Name (I am using Item created by Name & Email)

Body

 

Here i am mapping all the dynamic content from Flow and Sharepoint into JSON Body, This will directly send the email to the recipients. if you want to change it like save it in drafts just change the status to "Created" instead of Sent

Tabs:

Here i am Placing Signature & Date Tabs in Page 2 Right corner mage changes acording to that 

Please refer 

Adding Tabs to Envelopes

 

{
  "emailSubject": "Docusign REST API Integration with Flow",
  "emailBlurb": "Docusign REST API Integration with Flow",
  "status": "sent",
  "documents": [
    {
      "documentId": "1",
      "name": "yourfilename.pdf",
      "documentBase64": "Replace_compose_output_here"
    }
  ],
  "recipients": {
    "signers": [
      {
        "email": "Replace_dynamic_email",
        "name": "Replace_Dynamic_Name",
        "recipientId": "1",
        "tabs": {
          "signHereTabs": [
            {
              "xPosition": "490",
              "yPosition": "706",
              "documentId": "1",
              "required": "true",
              "pageNumber": "2"
            }
          ],
          "dateSignedTabs": [
            {
              "tabLabel": "todaysDate",
              "xPosition": "483",
              "yPosition": "765",
              "documentId": "1",
              "pageNumber": "2"
            }
          ]
        }
      }
    ]
  }
}

Some Ideas !!

 

  • You can Make use of content type based Documents and Populate Tabs on the doucment when it is saved 
  • Use AutoPlace Feature to replace your text fields with Docusign Tabs.
  • Using the auto-place feature (also called anchor-tagging) you can specify the location of your tabs based on content or "markers" contained within your documents.
  • "tabs": {
        "signHereTabs": [{
            "anchorString": "Please Sign Here:",
            "anchorXOffset": "1",
            "anchorYOffset": "0",
            "anchorIgnoreIfNotPresent": "false",
            "anchorUnits": "inches"
        }]
    }
  • After Creating Envelope in Drafts, we can parse response and get the Envelope ID and based on our custom logic we can add recipients dynamically from REST API.

 

Status: New
Comments
Level: Powered On

Thank You, Sarat! I'm looking for a very same scenario to implement. 

>