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. 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) Step 2: Now add “Get file content” SharePoint Action 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 Dynamic content: File name with extension from when item created. File content from Get file Action. Step 4: Dynamic content: ID from create file one drive 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. Dynamic content: Name (When item is created or modified) 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 Dynamic content: 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 Dynamic content: 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. Name (When item is created or modified) Output (Compose Action Output) Bytes in Base64 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.
... View more