We have had code using the DocuSign C# API in production for well over a year now, including some that successfully excludes documents from some recipients but not others. Now, on a new envelope type, I am getting the above error and can't figure out why. Below are the lightly edited/anonymized JSON request payload and DocuSign response with the error (both captured with Fiddler).
As you can see, there are three documents and two signers, with both signers getting document id 1, and one signer being excluded from document id 2 and the other signer excluded from document id 3. There are also two carbon copy recipients who are both internal employees on our account. For what it's worth, the Document Visibility setting on the account is "Must sign to view, unless a member of sender's account."
Here is the JSON payload being sent to DocuSign to create the envelope:
{
"documents": [
{
"documentId": "1",
"name": "Document1",
"fileExtension": "pdf",
"order": "1",
"documentBase64": "blahblahblah"
},
{
"documentId": "2",
"name": "Document2",
"fileExtension": "pdf",
"order": "2",
"documentBase64": "blahblahblah"
},
{
"documentId": "3",
"name": "Document2",
"fileExtension": "pdf",
"order": "3",
"documentBase64": "blahblahblah"
}
],
"recipients": {
"signers": [
{
"tabs": {
"signHereTabs": [
{
"name": "Joe Smith",
"tabLabel": "Signature1",
"scaleValue": "0.9",
"documentId": "1",
"recipientId": "1",
"anchorString": "Some anchor text",
"anchorXOffset": "4",
"anchorYOffset": "46",
"anchorMatchWholeWord": "true",
"tabId": "Signature1"
},
{
"name": "Joe Smith",
"tabLabel": "Signature2",
"documentId": "2",
"recipientId": "1",
"anchorString": "Some other anchor text",
"anchorXOffset": "4",
"anchorYOffset": "67",
"anchorMatchWholeWord": "true",
"tabId": "Signature2"
}
],
"dateSignedTabs": [
{
"tabLabel": "DateSigned1",
"documentId": "1",
"recipientId": "1",
"anchorString": "Some anchor text",
"anchorXOffset": "175",
"anchorYOffset": "38",
"anchorMatchWholeWord": "true",
"tabId": "DateSigned1"
}
],
"textTabs": []
},
"recipientSuppliesTabs": "false",
"excludedDocuments": [ "3" ],
"name": "Joe Smith",
"email": "[email protected]",
"emailRecipientPostSigningURL": "https://www.foocorp.com/e-consent-complete/",
"recipientId": "1",
"customFields": [],
"routingOrder": "1",
"roleName": "Signer",
"emailNotification": {
"emailSubject": "Joe Smith has documents from Foo Corp",
"emailBody": "Blah blah blah"
}
},
{
"tabs": {
"signHereTabs": [
{
"name": "Bob Jones",
"tabLabel": "Signature1",
"scaleValue": "0.9",
"documentId": "1",
"recipientId": "2",
"anchorString": "Some anchor text",
"anchorXOffset": "277",
"anchorYOffset": "46",
"anchorMatchWholeWord": "true",
"tabId": "Signature1"
},
{
"name": "Bob Jones",
"tabLabel": "Signature3",
"documentId": "3",
"recipientId": "2",
"anchorString": "Some other anchor text",
"anchorXOffset": "4",
"anchorYOffset": "67",
"anchorMatchWholeWord": "true",
"tabId": "Signature3"
}
],
"dateSignedTabs": [
{
"tabLabel": "DateSigned1",
"documentId": "1",
"recipientId": "2",
"anchorString": "Some anchor text",
"anchorXOffset": "448",
"anchorYOffset": "38",
"anchorMatchWholeWord": "true",
"tabId": "DateSigned1"
}
],
"textTabs": []
},
"recipientSuppliesTabs": "false",
"excludedDocuments": [ "2" ],
"name": "Bob Jones",
"email": "[email protected]",
"emailRecipientPostSigningURL": "https://www.foocorp.com/e-consent-complete/",
"recipientId": "2",
"customFields": [],
"routingOrder": "1",
"roleName": "Signer",
"emailNotification": {
"emailSubject": "Bob Jones has documents from Foo Corp",
"emailBody": "Blah blah blah"
}
}
],
"carbonCopies": [
{
"name": "Sue Employee",
"email": "[email protected]",
"emailRecipientPostSigningURL": "https://www.foocorp.com/e-consent-complete/",
"recipientId": "3",
"customFields": [],
"routingOrder": "1",
"roleName": "Internal",
"emailNotification": {
"emailSubject": "Joe Smith has documents from Foo Corp",
"emailBody": "Blah blah blah"
}
},
{
"name": "Sam Employee",
"email": "[email protected]",
"emailRecipientPostSigningURL": "https://www.foocorp.com/e-consent-complete/",
"recipientId": "4",
"customFields": [],
"routingOrder": "1",
"roleName": "Internal",
"emailNotification": {
"emailSubject": "Joe Smith has documents from Foo Corp",
"emailBody": "Blah blah blah"
}
}
],
"certifiedDeliveries": []
},
"status": "created",
"emailSubject": "Joe Smith has documents from Foo Corp",
"emailBlurb": "Blah blah blah",
"allowMarkup": "false",
"allowReassign": "false",
"recipientsLock": "true",
"emailSettings": {
"replyEmailAddressOverride": "[email protected]",
"replyEmailNameOverride": "Sue Employee"
}
}
And here is the HTTP response:
HTTP/1.1 400 Bad Request
Cache-Control: no-cache
Content-Length: 177
Content-Type: application/json; charset=utf-8
X-RateLimit-Reset: 1519927200
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 997
X-DocuSign-TraceToken: deadbeef-dead-beef-dead-beefdeadbeef
Date: Thu, 01 Mar 2018 17:25:01 GMT
Strict-Transport-Security: max-age=31536000; includeSubDomains
{
"errorCode": "CANNOT_EXCLUDE_DOCUMENT",
"message": "This document cannot be excluded for this recipient. Recipient: Joe Smith cannot be excluded from Document:"
}
Any direction appreciated.
Edited to show that the excluded documents both share the same name because it's a "logical name" to me, e.g., "W9" that I use in combination with custom fields on the document to then route to the right place in doc management when it comes back via a Connect call. If I send document id 2 and 3 with different names, then it all works. But exclusions work by document id, not document name, so why would that matter?
Edit #2: I was able to prove to myself that it doesn't matter what the document name is - whether they're the same or different, I get the error.