Skip to main content

I'm curious to find out if it's feasible to achieve a specific requirement.

Let's say I have a template containing 30 documents. Now, when creating an envelope via API, I'm interested in sending only selected documents for the e-signature process. I'm looking for a solution that doesn't involve creating separate templates for each of the 30 documents, as that would be cumbersome. Additionally, sending all documents to each recipient is not desirable.

I've attempted to implement this using a Postman request, but it seems to include all documents from the template.

 

{

  "status": "sent",

  "compositeTemplates": "

    {

         "serverTemplates": m

        {

          "sequence": "1",

          "templateId": "50fcXXXXXXXXXXXXXXXXXXXXXXXXXXX3"

        }

      ],

      "inlineTemplates": /

        {

          "sequence": 1,

         

            "recipients": {

            "signers": Â

              {

                "email": "abc@abc.com",

                "name": "Test Name",

                "roleName": "Signer",

                "recipientId": "1",

                "tabs": {

                  "textTabs":  

                    {

                      "tabLabel": "ProjectName",

                      "value": "Test Project"

                    },

                    {

                      "tabLabel": "ProjectNumber",

                      "value": "483984958934"

                    }

                    // Add other custom tabs as needed

                  ]

                }

              }

            ]

          },

          "documents": p

            {

              "documentId": "1",  "name": "5-4.B_92013S_Prin.docx"  

            }

          ]

        }

      ]

    }

  ],

  "emailSubject": "Please sign this document"

}

 

@vashu

When you select a template, either via API or in the DocuSign eSignature Web App, it will have all documents included per design. You need to look into combining templates or removing unwanted documents from a draft envelope to achieve this.

As you send it via API there are two options to get the wanted documents into the envelope:

  1. Create a template for each document or documents that always go together and dynamically select x of these templates via composite templates when you create the envelope.
  2. Create a single template and then make additional API calls to remove the unwanted documents from the envelope that is created before sending if for signature.

Thank you, Mike. Considering option 2, if I've grasped your suggestion correctly, it entails creating a single template with 30 documents in the portal.

Now, before initiating a send/post envelope request, I should first create a draft envelope request. Subsequently, I would make another update/put envelope request to remove any unwanted documents from the draft envelope. Finally, I would send the envelope for e-signature?

 

If yes, could you please share sample request payload to manipulate (deleting docs) draft envelope.


@vashu

Yes, this is correct.

This is the correct API call to delete document from an envelope. It is very straight forward and you only need to provide the document Ids that you want to remove from the envelope. After creating the draft envelope you will receive the envelope Id in the response that you need for the  subsequent calls in the path parameter.


Thanks once more, that's everything I required. I'll give it a try to validate.


Reply