Tab refers to a missing document - docusignapi

I am trying to send an envelope that is composed of
Template1 (1 pdf document)
Template2 (2 pdf documents, 1-regular fill-out, 2-with attach extra document tab)
If I use just template1 or template2 individually, I am able to send out the envelope. However, I can not send it both templates at the same time, I get the following error, and not sure what it means.
<errorDetails xmlns="http://www.docusign.com/restapi" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<errorCode>TAB_REFERS_TO_MISSING_DOCUMENT</errorCode>
<message>The DocumentId specified in the tab element does not refer to a document in this envelope. Tab refers to DocumentId 2 which is not present.</message>
</errorDetails>
Here is the code that I am using:
{
"emailSubject": "Account Setup",
"emailBlurb": "Please fill out the form",
"status": "sent",
"compositeTemplates": [{
"compositeTemplateId": "compositeTemplate1",
"serverTemplates": [
/* STANDARD ACCOUNT FORM */
{
"sequence": "2",
"templateId": "182B70AD-*"
},
/* ELECTRONIC TRANSFER FORM */
{
"sequence": "3",
"templateId": "B2B0BF8D-*"
}
],
"inlineTemplates": [{
"sequence": "1",
"recipients": {
"signers": [{
"email": "email#gmail.com",
"name": "First Last",
"recipientId": "1",
"roleName": "Client",
"RequireIDLookup": "true",
"RequireIDLookupSpecified": "true",
"idCheckConfigurationName": "Phone Auth $",
"phoneAuthentication": {
"recipMayProvideNumber": "false",
"senderProvidedNumbers": [
"914-000-0000"
]
}
}]
}
}]
}]
}
Please advise.

Perhaps try changing the value of sequence in each of your server template objects and in the inline template object as well, to indicate that the server template should be applied first (and second), and then the inline template should be applied after that:
"serverTemplates": [
/* STANDARD ACCOUNT FORM */
{
"sequence": "1",
"templateId": "182B70AD-*"
},
/* ELECTRONIC TRANSFER FORM */
{
"sequence": "2",
"templateId": "B2B0BF8D-*"
}
],
"inlineTemplates": [{
"sequence": "3",
"recipients": {
....
------UPDATE------
The Template XML you provided suggests that the problematic tag (the one causing the error message you're receiving) is the SignerAttachment tag with TabLabel set to "Signer Attachment 34" in the Electronic Funds Transfer Form template. This tag is the only tag (in either XML file) that refers to DocumentID value 2 (I simply searched both XML files for <DocumentID>2</DocumentID>):
<Tab>
<DocumentID>2</DocumentID>
<RecipientID>1</RecipientID>
<PageNumber>1</PageNumber>
<XPosition>12</XPosition>
<YPosition>104</YPosition>
<ScaleValue>1</ScaleValue>
<Type>SignerAttachment</Type>
<Name>Signer Attachment</Name>
<TabLabel>Signer Attachment 34</TabLabel>
<Value />
<CustomTabRequired>false</CustomTabRequired>
<CustomTabLocked>false</CustomTabLocked>
<TemplateLocked>true</TemplateLocked>
<TemplateRequired>false</TemplateRequired>
</Tab>
This is problematic for DocuSign, because the value of DocumentID indicates the document in which the tag resides (i.e., where the signer will see that tag during their signing session). So, DocuSign's looking to place this tag in the document that has an ID=2 -- but, if you examine the contents of <Documents> within that XML file, you'll see only a single document (with ID=1) -- there is no second document (i.e., no document with ID=2):
<Documents>
<Document>
<ID>1</ID>
<Name>File1.pdf</Name>
<PDFBytes/>
<AttachmentDescription>Please attach voided check, deposit slip or a copy of bank statement.</AttachmentDescription>
</Document>
</Documents>
I'm not sure how things might have gotten to this state (i.e., why the DocumentID for the Signer Attachment tag refers to a document ID that doesn't exist). However, doing the following might resolve the issue:
Edit the Electronic Funds Transfer Form Template in DocuSign -- remove/delete the Signer Attachment tag; save the Template.
Attempt your original scenario (send the Envelope using both templates). If it works, then this will confirm that the Signer Attachment tag was indeed the cause of your problem.
Edit the Electronic Funds Transfer Form Template in DocuSign -- add a new Signer Attachment tag in the same location as the original (removed) one existed; save the Template.
Attempt your original scenario (send the Envelope using both templates).
I suspect this will resolve your issue, but let me know if that's not the case.

Related

POSTMan sample - creating envelope from a template is not populating the user tags

I created a DocuSign template that contains two roles: Provider and Recipient. I did this via the DocuSign Sandbox UI.
In my template, I have one document, with four tabs on it:
1. ProviderName
2. ProviderAddress1
3. RecipientName
4. RecipientAddress
Should I be using CustomFields vs. Tabs?
What's the API call(s) that I should be making to do the following, given a template with a document in it:
create an envelope for specific users
update the text within the document in the template for the specific users
send it out?
In the POSTMan sample, I tried using this URL, doing a POST:
{{baseUrl}}/envelopes
passing in a templateId, and the following JSON below in the POST body:
JSON:
{
"templateRoles": [{
"email": "{{signer1Email}}",
"name": "The Provider",
"roleName": "Provider",
"tabs": {
"textTabs": [{
"tabLabel": "ProviderName",
"value": "This is the provider!"
},
{
"tabLabel": "ProviderAddress1",
"value": "10 Provider Street, Baltimore, MD 21212"
}]
}
},
{
"email": "{{otherEmail}}",
"name": "Test Recipient",
"roleName": "Recipient",
"tabs": {
"textTabs": [{
"tabLabel": "RecipientName",
"value": "This is the recipient!"
},
{
"tabLabel": "RecipientAddress",
"value": "10 Main Street, Baltimore, MD 21212"
}]
}
}],
"emailSubject": "DocuSign API - Signature Request on Document Call",
"templateId": "<<template ID>>",
"status": "sent"
}
This does return an Envelope Id in the response, and I do receive the email with the DocuSign document to sign.
However, the tabs are NOT populated, they're blank.
Are the roles in the Template empty placeholders? If a name/email is defined on the template, the API call won't populate them as you might expect.
Try to add the documentId and pageNumber properties to your tabs. Also, ensure the label matches what is in the original template.
Lastly, you may need to add recipientId as well to each of the recipients to match what is in the template (this one may not be required since you have the roleName but just in case)

DocuSign API Composite Template Server Templates Understanding

After reading (here and here) and trying out composite templates, I'm not quite sure I understand how to properly use the Server Templates within the API request. The documentation mentions If supplied they are overlaid into the envelope in the order of their Sequence value so I've interpreted this as they would be merged together as one document. It seems they are merged together but it is yielding a result that I would not expect. The first one in the sequence is what is shown and you cannot see the others.
What I'd like to do is have a couple common headers that contain our different logos and combine that with whatever template I'm sending out. We cannot use the branding approach because they want it as part of the document within the template and as far as I can tell, there is no way to make that happen with branding.
Below is my (scrubbed) request. See my comments.
{
"brandId": "{{brandId}}",
"emailSubject": "Testing Subject",
"status": "SENT",
"compositeTemplates": [{
"serverTemplates": [{ // First document
"sequence": "1",
"templateId": "{{headerTemplateId}}" //Header logo template
}, {
"sequence": "2",
"templateId": "{{document1TemplateId}}" // Template with content
}
],
"inlineTemplates": [{
"sequence": "1",
"recipients": {
"signers": [{
"email": "test#test.com",
"name": "Leeroy Jenkins",
"roleName": "Customer",
"recipientId": "1"
}
]
}
}
]
}, {
"serverTemplates": [{ // Second document
"sequence": "2",
"templateId": "{{document2TemplateId}}"
}
],
"inlineTemplates": [{
"sequence": "2",
"recipients": {
"signers": [{
"email": "test#test.com",
"name": "Leeroy Jenkins",
"roleName": "Customer",
"recipientId": "1",
"tabs": {
"textTabs": [{
"tabLabel": "Address",
"value": "123 Test Rd "
}, {
"tabLabel": "CityStateZip",
"value": "Test/XY/12345"
}
]
}
}
]
}
}
]
}
]
}
As #Drew says, your immediate issue is that each individual composite template can only include zero or one server template.
Re: How to properly use the Server Templates within a composite template
Each composite template composites together different aspects of an envelope:
Zero or one template definitions stored on docusign.com
Newly defined recipients, tabs, documents, etc.
For example, composite templates can be used to create an envelope that includes document "B" instead of using the document included in a template on docusign.com.
Changing logos in documents
Unfortunately, the DocuSign compositing feature does not include a feature for combining the images from one document with another document to create a new (combined) document.
Some ideas:
If only page one of the contract includes the logo, then you could have multiple versions of page one (treating each as a separate document), and combine the logoed page one with the other pages to form a complete envelope.
Note that a document can be as short as a page. Recipients will view all of the envelope's documents together.
Use a PDF library to manipulate the PDF document itself to change the logo. There are now many PDF libraries available, with APIs for many languages and operating systems.
Use a SAAS PDF rendering service to combine the images with the content to obtain the final PDF. Eg, webmerge
Send DocuSign the document in a non-PDF format. For example, you can send a .docx document. If you're using the Windows stack, it may be easier for your application to create a custom logo version of a Word doc than a PDF.

DocuSign REST API not creating Supplemental Documents

Attempting to use the REST API Envelope Create to include Supplemental Documents in the envelope [no templates], so with the first object in the Documents array having a display value of ‘inline’ and the signerMustAcknowledge set to ‘null’ we have for the second object in the array used the display value of ‘modal’ and the signerMustAcknowledge set to ‘no_interaction’ or to ‘view’. When the recipient reviews the envelop online the supplemental document is not shown as grey strip below the primary document offering the reviewer any options, instead the document is expanded and shown in full. What other options do we need to set to get DocuSign to treat the second document as supplemental, as described in https://support.docusign.com/en/guides/ndse-user-guide-send-supplements.
Spoke to DocuSign Support yesterday to get the ‘Supplemental Documents’ functionality added to our Demo Account and the Permission Set on the User being used for this REST API connection has the ‘Disable document upload’ unchecked and the Allow supplemental documents option (and all related options below) is checked.
Example anonymised JSON:
{
"recipients": {
"signers": [
{
"routingOrder": 1,
"recipientId": "1",
"name": "Person-A",
"email": "person-a#website.com"
}
]
},
"emailSubject": "Test subject",
"emailBlurb": "Test blurb",
"documents": [
{
"signerMustAcknowledge": null,
"order": "asc",
"name": "MyCompany Quote",
"includeInDownload": null,
"documentId": "1",
"documentBase64": "JVBERi0xLjMKJcTl8uXrp/Og0M……",
"display": "inline"
},
{
"signerMustAcknowledge": "no_interaction",``
"order": "asc",
"name": "MyCompany Quote",
"includeInDownload": false,
"documentId": "2",
"documentBase64": "JVBERi0xLjQKJeLjz9MKMiAw……",
"display": "modal"
}
]
}
You are not assigning any DocuSign tabs to the signer? your documents part of JSON is correct, just not assigning tabs might be creating an issue. If you don't assign tabs then it is called free form signing which is not allowed in most of the plans and might not work for supplemental docs. Try by assigning atleast one tab to signer in the non-supplemental document. Lack of tabs is causing the issue.

DocuSign Status Code TAB_REFERS_TO_DOCUMENT_NO_TABS_ALLOWED?

I am currently using the REST api to create an envelope containing a document and a template which I have already set up in Docusign. I get the following error on the web request and can't find this error on the status code/error list provided by DocuSign to try debug the issue. Their support person suggests I ask here..
TAB_REFERS_TO_DOCUMENT_NO_TABS_ALLOWED -- The Tab refers to a document that does not allow tabs.
Has anyone experienced this?
Edit:
The issue appears to be related to the document section.
{
"emailBlurb":"Test Email Body",
"emailSubject": "Test Email Subject",
"status" : "sent",
"compositeTemplates": [
{
"serverTemplates": [
{
"sequence" : 1,
"templateId": "b1eccee3-9c00-4cb2-8d30-0400d51dcfe0"
}],
"inlineTemplates": [
{
"sequence" : 2,
"recipients": {
"signers" : [{
"email": "usera#bah.com",
"name": "usera",
"recipientId": "1",
"roleName": "Producer"
}]
}
}],
"document": {
"documentId": 1,
"name": "Test.docx",
"documentBase64":"[bytesremoved]",
"fileExtension":"docx"
}
}]
}
So you have a template on the server, with a document as part of the template?
But you want the envelope to use a different document with the template, yes?
It is my understanding that the documentId in the document section of the composite template must match the documentId used in the template if you want the document to be substituted for the template's document.
So check the definition of the template. Did you create the template programmatically or did you use the web browser DocuSign app? If the latter, then note that the first document in a template is not always given an id of 1.

Docusign signing url - Showing document 1 of a composite template

Using the docusign rest api i would like to create an envelope with 2 documents.
I will then be using the Post Recipient view to show document 1 to the first recipient (in an iframe) and once signed show document 2 in the same envelope to another recipients.
i have created the templates with different tempalteRoles (different names, order 5 and 10).
Its my understanding using a userId and the right settings in my docusign account, i can show document 1 to recipient 1 and then document 2 to recipient 2.
When i try and create the composite envelope the whole document is shown.
when i call the recipient status for the envelope it only shows one signer.
I have found the envelope will only create when the 2 template roles have the same clientUserId, userName and email, otherwise i get the error "ONESIGNALLSIGN_NOT_SATISFIED"
here is the envelope i am sending through
{
"accountId": "ACCOUNT_ID",
"emailSubject": "Email subject",
"status": "sent",
"templateId": "TEMPLATE_ID",
"templateRoles": [
{
"roleName": "PDS Customer",
"email": "pds#example.com",
"name": "TestFirstName TestSurname",
"clientUserId": "1",
"tabs": {
"textTabs": [
{
"tabLabel": "DocumentNumber",
"value": "123456789",
"locked": true,
"documentId": 1,
"pageNumber": 1
}
...removed some
]
}
},
{
"roleName": "Customer",
"email": "test#example.com",
"name": "mrTestFirstName TestSurname",
"clientUserId": "2",
"tabs": {
"textTabs": [
{
"tabLabel": "StorerEmail_LocalPart",
"value": "test",
"locked": true,
"documentId": 2,
"pageNumber": 1
}
...removed some
]
}
}
],
"compositeTemplates": [
{
"compositeTemplateId": 1,
"serverTemplates": [
{
"sequence": 1,
"templateId": "TEMPLATE_ID_2"
}
]
}
]
}
The error message is due to having Document Visibility enabled. In that scenario, each signer must have at least one tab present. Your second signer (embedded or not) must have at least one tab. In this case it'd probably be on the second document.
Your API call above does refer to a second documentId though so you may be okay there.
I would suggest that you not mix the "simple" sending (using templateRoles at the top level) with composite templates. Instead, add an inline template to the compositeTemplates structure with all of your recipient information. You may be seeing some odd behavior due to mixing those.
Lastly, the default Document Visibility configuration will show a document to a recipient only if they have a tab on that document. If your second signer should see all documents then you must either add a tab for them on each document or explicitly set visibility per document.

Resources