Question

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.

Was it helpful?

Solution

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:

  1. Edit the Electronic Funds Transfer Form Template in DocuSign -- remove/delete the Signer Attachment tag; save the Template.

  2. 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.

  3. 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.

  4. 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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top