How to manage visibility settings in Composite Envelope - docusignapi

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.

Related

Use PDF FormFields in enveloppe

I need to use PdfFormField in an enveloppe, with 2 signers.
I use a dummy pdf file with only 1 field, but I can't get DocuSign to fill it.
Is there any special way to address it ?
Can you tell me what is wrong in my json ?
Here is the json sent :
{
"emailSubject": "Dummy",
"status": "sent",
"documents": [
{
"documentId": "1",
"name": "dummy.pdf",
"documentBase64": "...",
"transformPdfFields": "true",
"recipients": {
"signers": [
{
"recipientId": "1",
"tabs": {
"textTabs": [
{
"documentId": "1",
"pageNumber": "1",
"recipientId": "1",
"tabLabel": "acq-civ",
"value": "aaaaaaaaaaaaaa",
"required": "true"
}
]
}
},
{
"recipientId": "2"
}
]
}
}
],
"recipients": {
"signers": [
{
"recipientId": "1",
"roleName": "buyer",
"firstname": "Firstname",
"lastname": "Lastname",
"name": "Full Name",
"email": "email#gmail.com",
"routingOrder": 1
},
{
"recipientId": "2",
"roleName": "owner",
"name": "Full Name2",
"email": "email2#gmail.com",
"routingOrder": 2
}
]
}
}
I finally managed to do it using compositeTemplates. Simple documents structure doesn't allow form field manipulation after transformation

Combining Signer Tasks on Composite Template

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"}

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

Docusign composite template not sending the correct documents

I am trying to use the same server template for 3 different documents. I was assuming that by using 3 different composite templates, I could accomplish this. Instead, what I am seeing is that the first document is repeated 3 times in the envelope. Here is the request:
{
"customFields": {
"textCustomFields": [
{
"name": "Cartus file id",
"value": "1823456"
}
]
},
"eventNotification": {
"url": "http://requestb.in/p2qfvfp2",
"loggingEnabled": "true",
"requireAcknowledgment": "true",
"envelopeEvents": [
{
"envelopeEventStatusCode": "Delivered"
},
{
"envelopeEventStatusCode": "Completed"
},
{
"envelopeEventStatusCode": "Declined"
},
{
"envelopeEventStatusCode": "Voided"
},
{
"envelopeEventStatusCode": "Sent"
}
],
"useSoapInterface": "false",
"includeCertificateWithSoap": "false",
"signMessageWithX509Cert": "false",
"includeDocuments": "false",
"includeEnvelopeVoidReason": "false",
"includeTimeZone": "true",
"includeSenderAccountAsCustomField": "true",
"includeDocumentFields": "true",
"includeCertificateOfCompletion": "false"
},
"compositeTemplates": [
{
"compositeTemplateId": "1",
"serverTemplates": [
{
"sequence": "1",
"templateId": "4e2f0e2d-9888-xxxx-8da3-bbf70163233f"
}
],
"inlineTemplates": [
{
"sequence": "2",
"recipients": {
"signers": [
{
"name": "Kathy Gilbert",
"email": "KathyGilbert11#xxx.com",
"recipientId": "1",
"customFields": [
"this is the buyer"
],
"routingOrder": "1",
"roleName": "##Buyer1"
},
{
"name": "Kathy Langdon",
"email": "KathyLangdon1#xxx.com",
"recipientId": "2",
"customFields": [
"this is the seller"
],
"routingOrder": "2",
"roleName": "##Seller1"
}
],
"certifiedDeliveries": [
{
"name": "Kathy Lori",
"email": "kathylori#xxx.com",
"recipientId": "3",
"accessCode": "12345",
"routingOrder": "3",
"roleName": "##OtherPerson"
}
]
}
}
],
"document": {
"documentId": "1",
"name": "Here is document one of the test.docx",
"fileExtension": "docx",
"documentFields": [
{
"name": "Doc1Info",
"value": "here is doc1 info"
}
]
}
},
{
"compositeTemplateId": "2",
"serverTemplates": [
{
"sequence": "1",
"templateId": "4e2f0e2d-9888-xxxx-8da3-bbf70163233f"
}
],
"inlineTemplates": [
{
"sequence": "3",
"recipients": {
"signers": [
{
"name": "Kathy Gilbert",
"email": "KathyGilbert11#xxx.com",
"recipientId": "1",
"customFields": [
"this is the buyer"
],
"routingOrder": "1",
"roleName": "##Buyer1"
}
],
"certifiedDeliveries": [
{
"name": "Kathy Lori",
"email": "kathylori#xxx.com",
"recipientId": "3",
"accessCode": "12345",
"routingOrder": "3",
"roleName": "##OtherPerson"
}
]
}
}
],
"document": {
"documentId": "2",
"name": "Here is document two of the test",
"fileExtension": "docx",
"documentFields": [
{
"name": "Doc2Info",
"value": "here is doc2 info"
}
]
}
},
{
"compositeTemplateId": "3",
"serverTemplates": [
{
"sequence": "1",
"templateId": "4e2f0e2d-9888-xxxx-8da3-bbf70163233f"
}
],
"inlineTemplates": [
{
"sequence": "2",
"recipients": {
"signers": [
{
"name": "Kathy Gilbert",
"email": "KathyGilbert11#xxx.com",
"recipientId": "1",
"customFields": [
"this is the buyer"
],
"routingOrder": "1",
"roleName": "##Buyer1"
},
{
"name": "Kathy Langdon",
"email": "KathyLangdon1#xxx.com",
"recipientId": "2",
"customFields": [
"this is the seller"
],
"routingOrder": "2",
"roleName": "##Seller1"
}
],
"certifiedDeliveries": [
{
"name": "Kathy Lori",
"email": "kathylori#xxx.com",
"recipientId": "3",
"accessCode": "12345",
"routingOrder": "3",
"roleName": "##OtherPerson"
}
]
}
}
],
"document": {
"documentId": "3",
"name": "Here is document three of the test",
"fileExtension": "docx",
"documentFields": [
{
"name": "Doc3Info",
"value": "here is doc3 info"
}
]
}
}
],
"status": "sent",
"emailSubject": "Please sign the following document at 9:26 AM"
}
Like I said, document1.docx was repeated 3 times in the envelope ( these documents are only 1 page each ).
You are not specifying the Document bytes in your Composite Template.
Since the Document bytes are not included in your Composite template, the Server templates documents will be used to create the envelope. That's the reason you are seeing the same doc from the server template being repeated three times.
Change your document property in each composite template as below. I have added the documentBase64 property.
"document": {
"documentId": "1",
"name": "Here is document one of the test.docx",
"fileExtension": "docx",
"documentFields": [
{
"name": "Doc1Info",
"value": "here is doc1 info"
}
],
"documentBase64" : "[Include the base64 of the .docx file here]"
}

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.

Resources