Docusign API - Inserting new pages on documents created using templates - docusignapi

I am trying to create envelope using templates. I have a unique use case where I would need to repeat one of the pages on the template based on the user input upfront before generating the docusign envelope to sign.
My template-1 has 12 pages with sign tab on 12th page. Based on user input I might have to include multiple page#4 and multiple pag#10 in between at the time of envelope creation. So my final docusign document for signature will be having pages 1,2,...4, 4a, 4b, 5, ........9, 10, 10a, 10b, 1oc, 11,12.
One suggestion I got was to use composite templates and have the pages added on the fly. But my question is, then wouldn't that require my template-1 to be broken down into multiple templates based off where new pages need to be inserted? Is there any other way I can achieve this, as I might end up having quite a bunch of split templates out of a single template.

Related

List all the envelopes created from a template in DocuSign

I'm trying to get the list of all the envelopes created from a specific template in java.
EnvelopeTemplateResults envTempResults = templatesApi.listTemplates(accountId);
I can get the list of all the templates in the account by iterating through envTempResults and calling the method getTemplateId(). Is there a way for me to get the envelopes created from these templates?
Alternatively, is there a way to get all the bulk envelopes sent out (specifically I want to get all the Batch IDs) or a list of all the envelopes in the account?
An envelope and a template are the same thing conceptually, they are both a set of documents, recipients and fields.
The only difference is that you take a template and use it as a "boilerplate", which basically means you duplicate/copy the template into an envelope.
From that point on the envelope lives in the system independently, and there's no direct means to track what template was used to create it.
The solution that most customers/developers found is to use unique values or characteristics of the template/envelope to find out. It can be anything, from the type/number of recipients or documents, to the location of tags etc.
The best way to do it is by using metatdata, or custom fields. These are copied (just like everything else is copied) and you can add one called "templateName" which will always have the templateName in it and then you can use that to find the list of envelopes created from this template.
https://www.docusign.com/blog/developers/the-trenches-track-your-templates-envelope-custom-fields Shows you how to do that.
However, if you want to do this, it will only work for envelopes created from that point onwards. It will not be possible to search for envelopes created from the templates before you added the custom fields to them.

Can I use auto place anchor strings in DocuSign with Document Visibility on?

I have a working application where a generic document is defined in the DocuSign template with auto-place anchor strings. In creating the envelope I replace the generic document with a document generated by my application.
A new requirement is to have multiple documents in the template with document visibility turned on so as to control recipients only seeing certain documents.
I have successfully created envelopes replacing the multiple documents with my generated documents using composite templates.
The problem I'm having is with using auto-place anchors. I either receive a response from the API that anchors must be specifically placed on the document or when the recipient receives the document, the process repeatedly loops thru the anchors and never allows the recipient to finish the signing of the document.
The question is can I use auto-place anchors with document visibility?
The documents I am generating are the same as in the template, but now have been populated with customer information that may change the location of where a signature is needed
I suggest you try with multiple composite template, each with 1 document.
See my article for more template ideas.

Is it possible to conditionally display DocuSign template parts/sections?

I would like to know if it is possible to show/hide parts of DocuSign document template depending on the data which is passed in as a request.
I already have document template created and uploaded to DocuSign. I then use templateId to create envelope for that document and I also send some data (as json) to prepopulate certain fields inside the envelope.
The thing I am asking now is:
If the template has, let's say, 3 paragraphs, is it possible to hide one of them completely, based on the passed in json data?
Creating and uploading multiple templates is not an option due to large number of conditionally displayed sections.
I have been reading DocuSign API documentation, but couldn't find an answer to this.
To do that you will have to use Responsive Signing.
This feature change the format of the document you sign from PDF to HTML.
With HTML being the format, there are a lot more things you can do.
For example, you can use what we call "Smart Sections" which is exactly what you want. Sections that can be shown off/on based on logic you set.
Find out more about the responsive signing API here - https://developers.docusign.com/esign-rest-api/guides/responsive-signing/api-overview

How to add a table to Docusign template via API?

I have a template in docusign and can use it to create an envelope using all fields available.
The problem is one of the fields should be a table with a variable length of rows, so I cannot use auto placing because I don't know how many will exists upfront.
The only solution I found till now is to create a brand new word document and upload it to create the envelope, but this is causing problems since this document is taking at lest 10 seconds to be parsed by docusign, probably due to its size.
The best solution will be to have a template and it could be possible to send a "table" field.
Anyone got this before? Any suggestion is welcome.
Perhaps put the table on a second document that you create dynamically? Remember that an envelope can have multiple documents. The signing experience proceeds from one document to the next.

Adding additional pages to envelope created from a template

Is it possible to add extra pages to the middle of the document on envelope created and ready to send from a set template.
Use case:
Using DocuSign UI, Template-Sample saved with 4 pages, signing tab at the end of 4th page
Using API on code, envelope is created with the Template-Sample
Add 1 or more pages (with data contents) after 3rd page on template
Send for signing.
Yes. While the envelope is in the Created status (draft), it is no problem to change the envelope's contents.
Changing a specific document within the envelope is only supported by changing the entire document. That's possible, but the easier way is to have a series of separate documents in the envelope, and then only insert the new document.
Eg, if you still want the signing page at the end of all the pages, you'd have three documents:
The front matter document
The document that you're changing on the fly
The final document, including the signature page
Doing this sort of document manipulation usually involves the use of composite templates. Please ask additional questions if you'd like more help.

Resources