Combining Signer Tasks on Composite Template - docusignapi

I am running some tests with the DocuSign API via PostMan for a solution proof of concept. My goal is to create a single envelope with multiple documents, each assigned to its own template.
Our goal is to create a dynamic envelope of templates as needed; i.e. sometimes we will only need to put one template into the envelope, other times we might need five or six. The tricky bit is that a single person might be a recipient on multiple documents at once. We are looking to see if its possible to configure the envelope so that they can sign all of their documents at once.
I've been able to use the API to generate an envelope with two documents assigned to two templates. Each template has three recipients (the same three people for both document). The envelope is automatically assigned to the first batch of recipients for the first template (Recipients A and B since they both have a routing order of 1). But when the recipient goes to sign the envelope, they only see the signature option for the first document and don't have an option to sign the second document.
Is what I am trying to achieve possible?
I'm testing this process in Postman. Below is a copy of the POST body. I appreciate any advice.
{
"compositeTemplates": [
{
"document": {
"documentBase64": "<<BinaryDataA>>",
"documentId": "1",
"fileExtension": "pdf",
"name": "Test Document A"
},
"inlineTemplates": [
{
"sequence": "1",
"recipients": {
"signers": [
{
"email": "<<recipient_a_email>>",
"name": "<<recipient_a_name>>",
"recipientId": "1",
"roleName": "Client A",
"routingOrder":"1"
},
{
"email": "<<recipient_b_email>>",
"name": "<<recipient_b_name>>",
"recipientId": "2",
"roleName": "Client B",
"routingOrder":"1"
},
{
"email": "<<recipient_c_email>>",
"name": "<<recipient_c_name>>",
"recipientId": "3",
"roleName": "Internal Review",
"routingOrder":"2"
}
]
}
}
],
"serverTemplates": [
{
"sequence": "1",
"templateId": "<<templateID_1>>"
}
]
},
{
"document": {
"documentBase64": "<<BinaryDataB>>",
"documentId": "2",
"fileExtension": "pdf",
"name": "Test Landscape Document"
},
"inlineTemplates": [
{
"sequence": "1",
"recipients": {
"signers": [
{
"email": "<<recipient_a_email>>",
"name": "<<recipient_a_name>>",
"recipientId": "1",
"roleName": "Client A",
"routingOrder":"1"
},
{
"email": "<<recipient_b_email>>",
"name": "<<recipient_b_name>>",
"recipientId": "2",
"roleName": "Client B",
"routingOrder":"1"
},
{
"email": "<<recipient_c_email>>",
"name": "<<recipient_c_name>>",
"recipientId": "3",
"roleName": "Internal Review",
"routingOrder":"2"
}
]
}
}
],
"serverTemplates": [
{
"sequence": "1",
"templateId": "<<templateID_2>>"
}
]
}
],
"status": "sent",
"emailSubject":"Please Sign this Document"}

Try this: (taken out of Gil's Composite Template Blog Post)
{
"emailSubject": "Please sign your lease agreement.",
"emailBlurb": "Each tenant must sign individual lease.",
"status": "sent",
"compositeTemplates": [{
"document": {
"documentId": "1",
"name": "Property-A",
"fileExtension": "pdf",
"documentBase64": "JVBERi...NCg=="
}
},
{
"serverTemplates": [{
"sequence": "1",
"templateId": "E5577130-xxxx-xxxx-xxxx-95DD79644971"
}],
"inlineTemplates": [{
"recipients": {
"signers": [{
"email": "wile.e.coyote#example.com",
"name": "Wile E. Coyote",
"roleName": "Tenant"
}]
},
"sequence": "2"
}]
},
{
"serverTemplates": [{
"sequence": "1",
"templateId": "E5577130-xxxx-xxxx-xxxx-95DD79644971"
}],
"inlineTemplates": [{
"recipients": {
"signers": [{
"email": "hunter_of_rabbits#example.com",
"name": "Elmer Fudd",
"roleName": "Tenant"
}]
},
"sequence": "2"
}]
}
]
}

The following JSON body allowed me to create an envelope with two Documents, each assigned to a different template. I did have to define the recipient information per composite item, but DocuSign recognised that they were the same person and they were able to sign both documents in a single session.
The blog (https://www.docusign.com/blog/dsdev-why-use-composite-templates) helped describe how composite envelopes are structured which was a big help.
{
"compositeTemplates": [
{
"compositeTemplateId": "1",
"document": {
"documentBase64": "<<BinaryDataA>>",
"documentId": "1",
"fileExtension": "pdf",
"name": "Test Document A"
},
"serverTemplates": [
{
"sequence": "1",
"templateId": "<<TemplateIDA>>"
}
],
"inlineTemplates": [
{
"sequence": "1",
"recipients": {
"signers": [
{
"email": "<<recipient_A_Email>>",
"name": "<<recipient_A_Name>>",
"recipientId": "1",
"roleName": "Client A",
"routingOrder":"1"
},
{
"email": "<<recipient_B_Email>>",
"name": "<<recipient_B_Name>>",
"recipientId": "2",
"roleName": "Client B",
"routingOrder":"1"
},
{
"email": "<<recipient_C_Email>>",
"name": "<<recipient_C_Name>>",
"recipientId": "3",
"roleName": "Internal Review",
"routingOrder":"2"
}
]
}
}
]
},
{
"compositeTemplateId": "2",
"document": {
"documentBase64": "<<BinaryDataB>>",
"documentId": "2",
"fileExtension": "pdf",
"name": "Test Document B"
},
"serverTemplates": [
{
"sequence": "1",
"templateId": "<<TemplateIDB>>"
}
],
"inlineTemplates": [
{
"sequence": "1",
"recipients": {
"signers": [
{
"email": "<<recipient_A_Email>>",
"name": "<<recipient_A_Name>>",
"recipientId": "1",
"roleName": "Client A",
"routingOrder":"1"
},
{
"email": "<<recipient_B_Email>>",
"name": "<<recipient_B_Name>>",
"recipientId": "2",
"roleName": "Client B",
"routingOrder":"1"
},
{
"email": "<<recipient_C_Email>>",
"name": "<<recipient_C_Name>>",
"recipientId": "3",
"roleName": "Internal Review",
"routingOrder":"2"
}
]
}
}
]
}
],
"status": "sent",
"emailSubject":"Please Sign this Document",
"emailBlurb":"This is a test email blurb"}

Related

Using Pdf Form field to locate and resize SignHereTab

My goal is to make SignHereTab location and size the same as one of my Pdf Form Field. Docusign guide
tells me that I can transform Pdf Form fields into DocuSign tabs. And according to the guide I shoud use CompositeTempates.
I have two recipients and two Pdfs. One pdf should be signed by both recipients, the second pdf should be signed by the first. Here is JSON example of envelop. I'm usign CreateEnvelop method from Docusign.eSign.dll (https://www.nuget.org/packages/DocuSign.eSign.dll/)
{
"compositeTemplates": [
{
"document": {
"documentBase64": "base64 data",
"documentId": "1",
"name": "MainPart.pdf",
"transformPdfFields": "True"
},
"inlineTemplates": [
{
"recipients": {
"signers": [
{
"accessCode": "1239",
"email": "insured#gmail.com",
"name": "Insured ",
"recipientId": "1",
"routingOrder": "1",
"tabs": {
"signHereTabs": [
{
"recipientId": "1",
"tabLabel": "insured_sign_parta\\*"
}
]
}
},
{
"accessCode": "1212",
"email": "owner#gmail.com",
"name": "Owner",
"recipientId": "2",
"routingOrder": "2",
"tabs": {
"signHereTabs": [
{
"recipientId": "2",
"tabLabel": "owner_sign_parta\\*"
}
]
}
}
]
},
"sequence": "1"
}
]
},
{
"document": {
"documentBase64": "base64 data",
"documentId": "2",
"name": "AdditionalPart.pdf",
"transformPdfFields": "True"
},
"inlineTemplates": [
{
"recipients": {
"signers": [
{
"accessCode": "1239",
"email": "insured#gmail.com",
"name": "Insured",
"recipientId": "1",
"routingOrder": "1",
"tabs": {
"signHereTabs": [
{
"recipientId": "1",
"tabLabel": "insured_sign_parta\\*"
}
]
}
}
]
},
"sequence": "2"
}
]
}
],
"emailBlurb": "Email Text",
"emailSubject": "Subject",
"status": "sent"
}
When I open documents SignHereTabs doesn't appear :(
Could anybody help me, please? What am I doing wrong?
I have seen tutorials from Docusign website and all related issues on StackOverflow, but still it didn't help. I've been investigating this issue for almost two days and I got nothing...
tabs should have a documentId as well as a recipientId so that they can refer to both the recipient that needs to sign them and the specific document that they should be in.
see here for full reference - https://developers.docusign.com/esign-rest-api/reference/Envelopes/EnvelopeDocumentTabs

How to manage visibility settings in Composite Envelope

I am trying to work with visibility settings in a workflow using the docusign api. The workflow consists of two inline templates and I want to restrict it so a signer cannot see 1 document in the second inline template. Here is the json being sent to DocuSign:
{
"compositeTemplates": [
{
"inlineTemplates": [
{
"recipients": {
"signers": [
{
"email": ,
"name": ,
"recipientId": "2",
"roleName": "High School Faculty"
},
{
"email": ,
"name": ,
"recipientId": "3",
"roleName": "High School Administration"
},
{
"email": ,
"name": ,
"recipientId": "4",
"roleName": "Department Dean"
},
{
"documentVisibility": [
{
"documentId": "2",
"recipientId": "5",
"visible": "false"
}
],
"email": ,
"name": ,
"recipientId": "5",
"roleName": "Department Faculty"
}
]
},
"sequence": "1"
}
],
"serverTemplates": [
{
"sequence": "1",
"templateId": "900cc73b-f35c-45b1-92d1-e8453094aa60"
}
]
},
{
"inlineTemplates": [
{
"documents": [
{
"documentBase64": <data>,
"documentId": "1",
"fileExtension": "docx",
"name": "Packet"
},
{
"documentBase64": <data>,
"documentId": "2",
"fileExtension": "docx",
"name": "Packet"
}
],
"recipients": {
"signers": [
{
"email": ,
"name": ,
"recipientId": "2",
"roleName": "High School Faculty"
},
{
"email": ,
"name": ,
"recipientId": "3",
"roleName": "High School Administration"
},
{
"email": ,
"name": ,
"recipientId": "4",
"roleName": "Department Dean"
},
{
"documentVisibility": [
{
"documentId": "2",
"recipientId": "5",
"visible": "false"
}
],
"email": ,
"name": ,
"recipientId": "5",
"roleName": "Department Faculty"
}
]
},
"sequence": "2"
}
]
}
],
"emailSubject": "College Now Master Form",
"enforceSignerVisibility": "true"
}
When I go through testing the workflow the Department Faculty is still able to view the 2nd Document in the second inline template. I am testing so I am using the same signin for each role, could this be the issue? Can anyone point to what I am doing wrong? We do have visibility turned on for our instance. Thanks!
As per the EnvelopeRecipients docs, you'll want to use the ExcludedDocuments parameter to define it as a part of the Recipient object:
"recipients": {
"signers": [
{
"email": "user#example.com",
"name": "Example Signer",
"recipientId": "2",
"routingOrder":1,
"excludedDocuments":[2],
"tabs": {
"signHereTabs": [
{
"documentId": "1",
"recipientId": "1",
"xPosition": "150",
"yPosition": "150",
"pageNumber":1
}
]
}
}]
}
You'll also want to confirm how your account has Document Visibility configured, as it can be set to exclude the sender alone, or members of the sender's account. If it's set to "unless member of signer's account", testing may be thrown off.

Docusign signer got document that I did not think they would receive

I am using one server template. I have 3 documents. Doc 1 and Doc 3 need to be signed by buyer and seller. Doc 2 needs to be signed by seller and attorney. The envelope definition looks like this:
{
"compositeTemplates": [
{
"compositeTemplateId": "1",
"serverTemplates": [
{
"sequence": "1",
"templateId": "a0d319ef-ad34-4a2e-a375-069ce2df630c"
}
],
"inlineTemplates": [
{
"sequence": "2",
"recipients": {
"signers": [
{
"name": "Kathy Keaton",
"email": "KathyKeaton1#outlook.com",
"recipientId": "1",
"routingOrder": "1",
"roleName": "##Buyer1"
},
{
"name": "Kathy Lori"xxx,
"email": "kathyxxx#outlook.com",
"recipientId": "2",
"routingOrder": "2",
"roleName": "##Seller1"
}
]
}
}
],
"document": {
"documentId": "1",
"name": "Here is document one of the test.docx",
"fileExtension": "docx",
"documentBase64": [bytearray]
}
},
{
"compositeTemplateId": "2",
"serverTemplates": [
{
"sequence": "1",
"templateId": "a0d319ef-ad34-4a2e-a375-069ce2df630c"
}
],
"inlineTemplates": [
{
"sequence": "2",
"recipients": {
"signers": [
{
"name": "Kathy xxx,
"email": "kathyxxx#outlook.com",
"recipientId": "2",
"routingOrder": "2",
"roleName": "##Seller1"
}
]
}
}
],
"document": {
"documentId": "2",
"name": "Here is document two of the test",
"fileExtension": "docx",
"documentBase64": [bytearray]
}
},
{
"compositeTemplateId": "3",
"serverTemplates": [
{
"sequence": "1",
"templateId": "a0d319ef-ad34-4a2e-a375-069ce2df630c"
}
],
"inlineTemplates": [
{
"sequence": "2",
"recipients": {
"signers": [
{
"name": "Kathy Keaton",
"email": "KathyKeaton1#outlook.com",
"recipientId": "1",
"routingOrder": "1",
"roleName": "##Buyer1"
},
{
"name": "Kathy xxx",
"email": "kathyxxx#outlook.com",
"recipientId": "2",
"routingOrder": "2",
"roleName": "##Seller1"
}
]
}
}
],
"document": {
"documentId": "3",
"name": "Here is document three of the test",
"fileExtension": "docx",
"documentBase64": [bytearray]
}
}
],
"status": "sent",
"emailSubject": "Please sign the following document at 12:47 PM"
}
My question is: Doc 2 went to my first signer, even though they had no signing tabs on that document. Why did that happen?
Take a look at the document visibility feature of DocuSign. If you have doc visibility 'off', then all recipients in an envelope will have visibility to all documents in the envelope. If you have it enabled, then a recipient will need to have at least one DocuSign tab assigned to them to view the document (and all the pages this document contains). If a document has zero tabs, then it should be viewable by all.

Docusign: composite templates with tabs

How do I specify prefilled fields with composite templates when creating an envelope.
I tried including the tabs information in the inlineTemplate.recipients.signers[0].tabs, but I get an error that System.String cannot be cast to API_REST.Models.v2.tabs.
If I include information as a template role in templateRoles, it is ignored. The documentation is light on information about how to do this. It seems like the prefill data should be specified in the inline template.
Other open questions I have include what does the recipientId do. What is the clientUserIdused for? We currently set clientUserId to the same value for all signers. I see it's used when signer requests a signature. Should it be unique to every signer for some reason?
It also looks like a single composite template overlays the server and inline templates on top of each other. What's the use case for having multiple server templates or multiple inline templates in a single composite template?
Are there plans to improve the documentation to describe how to use composite templates for various purposes?
Signer/template role:
{
"clientUserId": "clientUserId",
"email": "first+last#email.com",
"name": "First Last",
"roleName": "role1",
"tabs": {
"textTabs": [
{
"locked": true,
"tabLabel": "\\*FieldName",
"value": "prefillValue"
}
]
}
}
Example request:
{
"compositeTemplates": [
{
"inlineTemplates": [
{
"recipients": {
"signers": [
{
"clientUserId": "clientUserId",
"email": "first+last#email.com",
"name": "First Last",
"recipientId": 1,
"roleName": "role1",
"tabs": {
"textTabs": [{"tabLabel": "label", "value": "val"}]
}
}
]
},
"sequence": 1
}
],
"serverTemplates": [
{
"sequence": 1,
"templateId": "templateId1"
}
]
},
{
"inlineTemplates": [
{
"recipients": {
"signers": [
{
"clientUserId": "clientUserId",
"email": "first+last#better.com",
"name": "First Last",
"recipientId": 1,
"roleName": "role1",
"tabs": {
"textTabs": [{"tabLabel": "label", "value": "val"}]
}
}
]
},
"sequence": 2
}
],
"serverTemplates": [
{
"sequence": 2,
"templateId": "templateId2"
}
]
}
],
"emailSubject": "Email subject",
"status": "sent",
"templateId": null,
"templateRoles": null
}
Information on sending an envelope from a server template can be found here.
RecipientID is used by the tab element to indicate which recipient is to sign the Document while the clientuserID specifies if the user is remote or embedded and it is recommended it be unique per signer (but not required).
I'd also suggest reading this page about composite templates, hopefully the concept will make a bit more sense but I am with you that the lack of documentation on composite templates can be troublesome.
Unfortunately, I don't have a sample with tab data included, but adding the tab section under each recipient from my sample below should work with no issues.
{
"emailSubject": "DocuSign Comp Test 1",
"emailBlurb": "Example - Composite Templates",
"status": "sent",
"compositeTemplates": [
{
"serverTemplates": [
{
"sequence": "1",
"templateId": "templateId1"
}
],
"inlineTemplates": [
{
"sequence": "1",
"recipients": {
"signers": [
{
"email": "testsigner123#gmail.com",
"name": "Test Tester",
"recipientId": "1",
"roleName": "Signer 1"
}
]
}
}
]
},
{
"serverTemplates": [
{
"sequence": "2",
"templateId": "templateId2"
}
],
"inlineTemplates": [
{
"sequence": "2",
"recipients": {
"signers": [
{
"email": "testsigner123#gmail.com",
"name": "Test Tester",
"recipientId": "1",
"roleName": "Signer 1"
}
]
}
}
]
},
{
"serverTemplates": [
{
"sequence": "3",
"templateId": "templateId3"
}
],
"inlineTemplates": [
{
"sequence": "2",
"recipients": {
"signers": [
{
"email": "testsigner123#gmail.com",
"name": "Test Tester",
"recipientId": "1",
"roleName": "Signer 1"
}
]
}
}
]
}
]
}

DocuSign one envelope with multiple server templates

I have had plenty of success using docusign API with single template, roles, tabs, etc... My use case is now:
1) Have a single envelope that contains multiple server templates
2) The roles will be the same for both server templates
3) However there may be different tabs for each role for each template
Through reading the Docusign API and trial and error I am close, but just cant get across the finish line here. Here is my current JSON:
accountId = 414772
baseUrl = https://demo.docusign.net/restapi/v2/accounts/414772
{
"accountId": "414772",
"emailSubject": "DocuSign API - Signature Request from Template",
"compositeTemplates": [
{
"serverTemplates": [
{
"sequence": 1,
"templateId": "F42C617E-0C61-4A98-944E-F9CAA0AE55D9"
}
],
"inlineTemplates": [
{
"sequence": 2,
"recipients": {
"signers": [
{
"recipientId": 1,
"email": "reirealtor#mailinator.com",
"name": "REI Realtor",
"roleName": "Realtor",
"tabs": {
"textTabs": [
{
"tabLabel": "\\*header_address",
"value": "SOME TEST INFO GOES HERE"
},
{
"tabLabel": "Address",
"value": "123 REally Cool St"
}
]
}
},
{
"recipientId": 2,
"email": "reibuyer#mailinator.com",
"name": "John Doe",
"roleName": "Client"
}
]
}
}
]
},
{
"serverTemplates": [
{
"sequence": 1,
"templateId": "47F5C07B-016C-4E6D-B31D-DCEF9AEAAA69"
}
],
"inlineTemplates": [
{
"sequence": 2,
"recipients": {
"signers": [
{
"recipientId": 1,
"email": "reirealtor#mailinator.com",
"name": "REI Realtor",
"roleName": "Realtor",
"tabs": {
"textTabs": [
{
"tabLabel": "\\*header_address",
"value": "SOME TEST INFO GOES HERE"
},
{
"tabLabel": "Some Other Tab",
"value": "Populate some text here"
}
]
}
},
{
"recipientId": 2,
"email": "reibuyer#mailinator.com",
"name": "John Doe",
"roleName": "Client"
}
]
}
}
]
}
],
"status": "sent"
}
So obviously this doesn't work, but I don't really get any feedback as to why, Docusign just doesn't reply. I have narrowed it down to the 4th signer block
"recipientId": 2,
"email": "reibuyer#mailinator.com",
"name": "John Doe",
"roleName": "Client"
If I remove this block, it creates the envelope and sends it, but then my second template doesn't have a signing block. I suspect I am just doing this all wrong to begin with.
Any ideas?
I think your real issue is number vs string on sequence and ids. I will mock up a POST with your JSDON later today, but here is a valid sample for you to review in the mean time:
{
"emailSubject": "Test 3",
"emailBlurb": "Using two templates from composite template structure",
"brandId" : "f8c86e34-722e-4360-a9a0-54647bcd3004",
"status": "created",
"compositeTemplates": [{
"serverTemplates": [{
"sequence": "1",
"templateId": "6E558133-112C-434E-BF84-7C4DF340F042"
}],
"inlineTemplates": [{
"sequence": "1",
"recipients": {
"signers": [{
"email": "David.grigsby#docusign.com",
"name": "David W. Grigsby",
"recipientId": "1",
"roleName": "Role",
"tabs": {
"textTabs": [{
"value": "David Grigsby",
"tabLabel": "name"
},
{
"value": "David",
"tabLabel": "first_name"
}]
}
}]
}
}]
},
{
"serverTemplates": [{
"sequence": "2",
"templateId": "12C8894E-505C-480F-92FF-245DC387AD34"
}],
"inlineTemplates": [{
"sequence": "2",
"recipients": {
"signers": [{
"email": "David.grigsby#docusign.com",
"name": "David W. Grigsby",
"recipientId": "1",
"roleName": "Role",
"tabs": {
"textTabs": [{
"value": "David W. Grigsby",
"tabLabel": "name"
},
{
"value": "Grigsby",
"tabLabel": "last_name"
}]
}
}]
}
}]
}]
}

Resources