CANNOT_EXCLUDE_DOCUMENT: This document cannot be excluded for this recipient - docusignapi

I am seeing a weird behavior with this test eSign transaction:
{
"compositeTemplates": [
{
"inlineTemplates": [
{
"documents": [
{
"documentBase64": "BASE64STRING",
"documentId": "7",
"fileExtension": "PDF",
"name": "DOCUMENT7"
}, {
"documentBase64": "BASE64STRING",
"documentId": "10",
"fileExtension": "PDF",
"name": "DOCUMENT10"
}, {
"documentBase64": "BASE64STRING",
"documentId": "12",
"fileExtension": "PDF",
"name": "DOCUMENT12"
}, {
"documentBase64": "BASE64STRING",
"documentId": "17",
"fileExtension": "PDF",
"name": "DOCUMENT17"
}, {
"documentBase64": "BASE64STRING",
"documentId": "18",
"fileExtension": "PDF",
"name": "DOCUMENT18"
}, {
"documentBase64": "BASE64STRING",
"documentId": "19",
"fileExtension": "PDF",
"name": "DOCUMENT19"
}, {
"documentBase64": "BASE64STRING",
"documentId": "20",
"fileExtension": "PDF",
"name": "DOCUMENT20"
}
],
"recipients": {
"signers": [
{
"email": "SIGNER1#mailinator.com",
"excludedDocuments": [
"20"
],
"name": "SIGNER1",
"recipientId": "2",
"tabs": {
"signHereTabs": [
{
"documentId": "7",
"pageNumber": "1",
"recipientId": "2",
"xPosition": "45",
"yPosition": "628"
}
]
}
}, {
"email": "SIGNER2#mailinator.com",
"excludedDocuments": [
"7"
],
"name": "SIGNER2",
"recipientId": "3",
"tabs": {
"signHereTabs": [
{
"documentId": "20",
"pageNumber": "1",
"recipientId": "3",
"xPosition": "45",
"yPosition": "628"
}
]
}
}
]
},
"sequence": "1"
}
]
}, {
"serverTemplates": [
{
"sequence": "1",
"templateId": "f7e03095-8fd0-4c0a-9ec4-50d8fcee9b17"
}
]
}
],
"emailSubject": "Test eSign",
"enforceSignerVisibility": "True",
"status": "sent"
}
When I send it to the DocuSign v2.1 api {{baseUrl}}/v2.1/accounts/{{accountId}}/envelopes
I receive the following error:
{
"errorCode": "CANNOT_EXCLUDE_DOCUMENT",
"message": "This document cannot be excluded for this recipient. Recipient: SIGNER2 cannot be excluded from Document:DOCUMENT20"
}
However, as you can see in the recipient "SIGNER2", the list of excluded documents doesn't contain the document 20 but this one :
"excludedDocuments": [
"7"
],
If I remove the document "7" from the list of excludedDocuments, then the transaction will go through.
I have tested with any templates and it fails just the same.
If I don't use the CompositeTemplate structure, it succeeds.
Anything I am missing or not seeing ?
Thanks in advance

After more than 4 months since I have created a DocuSign case, it was finally reviewed and considered a bug on the DocuSign API.
This bug has been announced as something that will be fixed in the future.
This issue is currently open and in the hands of our engineering team
that have come with a workaround. This issue is due to the
compositeTemplate call re-generated document Ids, so instead of
honoring the values provided for document id the documents are
renumbered, in the created envelope DOCUMENT20 does have an ID of 7,
so that's where the error is coming from. To remove DOCUMENT20 you
would have to send exclude document 7 in your call body.

Go to Settings > Sending Settings > Document Visibility
And change Document Visibility to "Must sign to view, unless sender"
If this does not work, open a case and make sure to include the API request logs.

Related

DocuSign: recipient signerAttachmentTabs inappropriately replicated

I'm trying to create an envelope using DocuSign REST API. The signature tabs are generated by converting the PDF signature fields, and a signerAttachment tab is added manually.
In the final envelope, there is (as expected) only one signHere tab, but three overlapping signerAttachment tabs, which must be acted upon (read: upload a file) before the envelope can be effectively signed.
Case details
The envelope has 2 documents, one of which has signature tabs generated by transforming PDF fields. There are two recipients, one signer and one "Carbon Copy". The signer, before completing the envelope, must upload an additional document, so I added a signerAttachmentTab.
The JSON sent to the API endpoint /restapi/v2.1/accounts/{accountId}/envelopes follows (null values omitted and sensitive information redacted):
{
"compositeTemplates": [
{
"compositeTemplateId": "0",
"document": {
"documentBase64": "(redacted)",
"documentId": "1",
"fileExtension": "pdf",
"name": "Summary",
"transformPdfFields": "true"
},
"inlineTemplates": [
{
"envelope": {
"emailBlurb": "Just a test for development. Ignore this message",
"emailSubject": "from unit-test 01"
},
"recipients": {
"carbonCopies": [
{
"email": "john.doe#company.com",
"name": "John Doe",
"recipientId": "00283187",
"roleName": "CCOPY",
"routingOrder": "1"
}
],
"signers": [
{
"email": "jane.dee#company.com",
"name": "Jane Dee",
"recipientId": "00283183",
"recipientSignatureProviders": [
{
"signatureProviderName": "(redacted)",
"signatureProviderOptions": {
"sms": "+000-000-000"
}
}
],
"roleName": "SIGNER",
"routingOrder": "1",
"tabs": {
"signerAttachmentTabs": [
{
"xposition": "10",
"yposition": "10",
"documentId": "3",
"name": "Attachment",
"pageNumber": "1",
"recipientId": "00283183",
"tabLabel": "Attach-document",
"tooltip": "SignerAttachment",
"xPosition": "10",
"yPosition": "10"
}
],
"signHereTabs": [
{
"anchorAllowWhiteSpaceInCharacters": "true",
"recipientId": "00283183",
"tabLabel": "firmatario_00283183\\*"
}
]
},
"userId": "00283183"
}
]
},
"sequence": "1"
}
]
},
{
"compositeTemplateId": "1",
"document": {
"documentBase64": "(redacted)",
"documentId": "2",
"fileExtension": "pdf",
"name": "sample0",
"transformPdfFields": "true"
},
"inlineTemplates": [
{
"customFields": {
},
"envelope": {
"emailBlurb": "Just a test for development. Ignore this message",
"emailSubject": "from unit-test 01"
},
"recipients": {
"carbonCopies": [
{
"email": "john.doe#company.com",
"name": "John Doe",
"recipientId": "00283187",
"roleName": "CCOPY",
"routingOrder": "1"
}
],
"signers": [
{
"email": "jane.dee#company.com",
"name": "Jane Dee",
"recipientId": "00283183",
"recipientSignatureProviders": [
{
"signatureProviderName": "(redacted)",
"signatureProviderOptions": {
"sms": "+000-000-000"
}
}
],
"roleName": "SIGNER",
"routingOrder": "1",
"tabs": {
"signerAttachmentTabs": [
{
"xposition": "10",
"yposition": "10",
"documentId": "3",
"name": "Attachment",
"pageNumber": "1",
"recipientId": "00283183",
"tabLabel": "Attach-document",
"tooltip": "SignerAttachment",
"xPosition": "10",
"yPosition": "10"
}
],
"signHereTabs": [
{
"anchorAllowWhiteSpaceInCharacters": "true",
"recipientId": "00283183",
"tabLabel": "firmatario_00283183\\*"
}
]
},
"userId": "00283183"
}
]
},
"sequence": "2"
}
]
},
{
"compositeTemplateId": "2",
"document": {
"documentBase64": "(redacted)",
"documentId": "3",
"fileExtension": "pdf",
"name": "sample1",
"transformPdfFields": "true"
},
"inlineTemplates": [
{
"envelope": {
"emailBlurb": "Just a test for development. Ignore this message",
"emailSubject": "from unit-test 01"
},
"recipients": {
"carbonCopies": [
{
"email": "john.doe#company.com",
"name": "John Doe",
"recipientId": "00283187",
"roleName": "CCOPY",
"routingOrder": "1"
}
],
"signers": [
{
"email": "jane.dee#company.com",
"name": "Jane Dee",
"recipientId": "00283183",
"recipientSignatureProviders": [
{
"signatureProviderName": "(redacted)",
"signatureProviderOptions": {
"sms": "+000-000-000"
}
}
],
"roleName": "SIGNER",
"routingOrder": "1",
"tabs": {
"signerAttachmentTabs": [
{
"xposition": "10",
"yposition": "10",
"documentId": "3",
"name": "Attachment",
"pageNumber": "1",
"recipientId": "00283183",
"tabLabel": "Attach-document",
"tooltip": "SignerAttachment",
"xPosition": "10",
"yPosition": "10"
}
],
"signHereTabs": [
{
"anchorAllowWhiteSpaceInCharacters": "true",
"recipientId": "00283183",
"tabLabel": "firmatario_00283183\\*"
}
]
},
"userId": "00283183"
}
]
},
"sequence": "3"
}
]
}
],
"notification": {
"expirations": {
"expireAfter": "2",
"expireEnabled": "true"
}
},
"status": "sent",
"transactionId": "55909b0d-b54f-454e-b966-e58ca5fb4e7e"
}
The envelope definition has been written following the guidelines by DocuSign, namely by inserting a composite template for each document and assigning the recipients to each one of them.
Now, I expect that, despite the same recipients being declared three times (one for each document), they will be merged in the final envelopes, as per this quote from the same page:
When you use multiple templates to create an envelope, two or more templates may define the same recipient (a recipient with the same role or even the same name as other recipients), creating duplicate recipients. You can automatically merge these duplicate recipients by making sure that each of these duplicate recipients has the same email, user name, and routing order. In this case, any duplicate recipients are merged together after all template overlays have been applied.
What I observe is that, in the final envelope, there is -- as expected -- only one signature field, but three overlapping signerAttachment field. Therefore, the signer has to upload the same file three times to complete the envelope.
A call to the endpoint /restapi/v2.1/accounts/{accountId}/envelopes/{envelopeId}/recipients/{recipientId}/tabs confirms the presence of three similar tabs:
{
"signHereTabs": [
{
"stampType": "signature",
"isSealSignTab": "false",
"name": "SignHere",
"tabLabel": "firmatario_00283183_Firma consulenza_001",
"scaleValue": "1",
"optional": "false",
"documentId": "3",
"recipientId": "1",
"pageNumber": "1",
"xPosition": "391",
"yPosition": "719",
"width": "0",
"height": "0",
"tabId": "2cee0f3e-a2bb-4aae-a5b4-82c66b177c0a",
"tabType": "signhere"
}
],
"signerAttachmentTabs": [
{
"name": "Attachment",
"tabLabel": "Attach-document",
"scaleValue": "1",
"optional": "false",
"documentId": "3",
"recipientId": "1",
"pageNumber": "1",
"xPosition": "10",
"yPosition": "10",
"width": "0",
"height": "0",
"tabId": "a67c3071-6ac4-4c3b-a20c-0197cda091ed",
"tabType": "signerattachment",
"tooltip": "SignerAttachment"
},
{
"name": "Attachment",
"tabLabel": "Attach-document",
"scaleValue": "1",
"optional": "false",
"documentId": "3",
"recipientId": "1",
"pageNumber": "1",
"xPosition": "10",
"yPosition": "10",
"width": "0",
"height": "0",
"tabId": "c20809de-3792-4ff7-ab31-6f09a13f3fbc",
"tabType": "signerattachment",
"tooltip": "SignerAttachment"
},
{
"name": "Attachment",
"tabLabel": "Attach-document",
"scaleValue": "1",
"optional": "false",
"documentId": "3",
"recipientId": "1",
"pageNumber": "1",
"xPosition": "10",
"yPosition": "10",
"width": "0",
"height": "0",
"tabId": "1d0c84cd-6511-47c2-a75f-73721ac2fb0f",
"tabType": "signerattachment",
"tooltip": "SignerAttachment"
}
]
}
Why the signerAttachment tabs are not merged like the signHere tabs and what can be done to merge them in the resulting envelope?
I believe the issue is that in the case of the SignHere tab, your InLineTemplate is not creating the SignHere tabs, it is providing/updating the settings for the existing tab where the tabLabel is "firmatario_00283183"
(The tab is existing because it was created as part of the PDF transformation.)
In contrast, your three definitions for the SignerAttachment tabs are each creating new tabs. So you're seeing the three new SignerAttachment tabs on the document.
Solution: only create as many SignerAttachment tabs as you want. There is no merging (supression) of tabs, just merging of the Recipients.
I will admit that I'm not a gonzo expert on CompositeTemplates. But I think I'm on reasonably firm ground here.
Each signerAttachmentTab specified in each compositeTemplate has specified the same document for placement - "documentId": "3", so each of your composites is placing a new signer attachment tab to the same document, ID 3. If you only want one signer attachment, only specify it in the requisite composite. For documentId = 3, that would be your third composite. If you want an attachment tab on each document, then make sure you specify the correct documentId.

Docusign API Explorer not pre-populating fields

I tried filling in the tabs with labels and values, but when I send the request the tabs are not pre-populated, also does anyone know how does the fullname tab get populated?
{
"emailSubject": "Welcome to Soul Gym",
"status": "sent",
"templateId": "196b0d27-b967-4380-bb2c-013051ec9e45",
"templateRoles": [
{
"clientUserId": "marcus.yeo#business.edu.sg",
"email": "marcus.yeo#business.edu.sg",
"name": "Marcus Yeo",
"roleName": "New Member",
"tabs": {
"emailTabs": [
{
"tabLabel": "Email",
"value": "marcus.yeo#business.edu.sg"
}
],
"fullNameTabs": [
{
"tabLabel": "FullName"
},
{
"tabLabel": "FullName2"
}
],
"textTabs": [
{
"tabLabel": "Address",
"value": "32 Duke Road"
}
]
}
}
]
It looks like you're missing the documentId and tabPositions to display the full name on your document. Here is an example working request body with raw document omitted:
{
"documents": [
{
"documentBase64": "<Base64BytesHere>",
"documentId": "1",
"fileExtension": "docx",
"name": "testFile"
}
],
"emailSubject": "testing envelope",
"recipients": {
"signers": [
{
"email": "john.doe#example.com",
"name": "Docusign Test Signer",
"recipientId": "1",
"routingOrder": "1",
"tabs": {
"fullNameTabs": [
{
"documentId": "1",
"pageNumber": "1",
"xPosition": "280",
"yPosition": "172"
},
{
"documentId": "1",
"pageNumber": "1",
"xPosition": "480",
"yPosition": "300"
}
],
"signHereTabs": [
{
"documentId": "1",
"pageNumber": "1",
"xPosition": "120",
"yPosition": "300"
}
]
}
}
]
},
"status": "sent"
}
And the resulting fullName placement shown on a demo document I tried with this request json:
Though I didn't use an envelope templateId here, the mechanism works the same, set the documentID, pageNumber, & x/y coordinates to inject the fullName on your documents. Feel free to check out the Quickstart tool as well to find a full DocuSign implementation in a language of your choice that you can modify to suit your needs.

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.

Resources