Automatically add tags - docusignapi

Using MS Word documents as our source files, is there a way to include special token characters or MS Word fields inside an uploaded document so that Dousing can read the special tokens or field and replace them with the appropriate tags and signatory data?
This would allow me to adjust our document creation software to insert tokens where we needed tags, along with hidden filed that contained recipient data, and then our users could just click a button to get the contract, upload it to DS and have all the fields and tags populate properly.
Tell me you can do this!

Yes, DocuSign can automatically place DocuSign tabs in documents using "anchor text" that exists in the documents. The "Anchoring tabs" section of the REST API guide (starting on p 292) -- http://www.docusign.com/sites/default/files/REST_API_Guide_v2.pdf -- provides information about how you can achieve this when creating an Envelope with the REST API.
Using "anchor text" with tabs enables you to have DocuSign automatically add/place the tabs in the documents in each place where the text string you specify (i.e., the "anchor text" string) exists in the document. For example, if your documents contained the string ~s1 in each location where the first signer's signature was required, the REST API request you use to create the envelope would include the following tabs information to have DocuSign automatically add a Signature tab for the signer in each location where ~s1 appears in the documents:
"tabs": {
"signHereTabs": [
{
"anchorString": "~s1",
"anchorXOffset": "1",
"anchorYOffset": "0.5",
"anchorIgnoreIfNotPresent": "false",
"anchorUnits": "inches"
}
]
}
Note: The only property absolutely required to use anchor text for tab placement is anchorString -- I've included some additional properties in the sample above that you may or may not want to utilize. See the REST API guide for information about the meaning/purpose of the other properties included in the sample above.

Yes you can do this with DocuSign, as long as you insert these tokens into the document content itself, once the document is uploaded the DocuSign platform will scan through the content and insert any anchor tags where applicable.
For instance, if you have an invisible string in your Word document that is \s1 and you have a Custom Tag saved in your DocuSign account that has \s1 set for its anchor string then signature tabs (or whatever type of tab you'd like) will be inserted wherever \s1 is found in the document. Or if you don't want to save anchor tags at the account level (which means they are applied on all of your envelopes) you can anchor your tabs through api call(s) so that they are only applied to that envelope.
For more information please see the Tab Positioning section under Explore -> Features in the DocuSign Dev Center:
http://www.docusign.com/developer-center/explore/features/stick-etabs
You'll see that one common approach is to set the font color of these special tokens to the same color as the document background (usually white) which in turn makes them invisible so that you only see the DocuSign tabs at those locations.

Related

DocuSign SOAP API duplicates tabs when using Composite Templates

We have a DocuSign integration in which users can create an Envelope consisting of multiple documents and each document referencing a DocuSign Template. This worked fine when we were using the CreateEnvelopeFromTemplates method and TemplateReference object.
We've since modified the integration to use CreateEnvelopeFromTemplatesAndForms and the Composite Templates as recommended by DocuSign. We've noticed that when creating an Envelope where 2 or more documents use the same Server Template that Template's anchor tags are duplicated for each instance of the Template.
We're following the pattern:
"compositeTemplates": [
3 {
4 "document": {...},
5 "serverTemplates": [{...}],
6 "inlineTemplates": [{...}]
7 },
{
4 "document": {...},
5 "serverTemplates": [{...}],
6 "inlineTemplates": [{...}]
7 }
8 ]
We are providing the 'document' field to use instead of the server template's document field, the inline template for recipient information, and the server template for signature location information. If both composite templates in the above example reference the same server template and that server template has 1 anchor tab each document has 2 anchor tabs in the same location.
How can we limit each server template instance to its own composite template in this case?
You stated you were using anchor tabs with your server template. So first, let's make sure the processing of anchor tabs is understood.
When processing an envelope for tab placements, the first anchor tab will require loading all the text of the envelope documents so that a text search can be run. Each subsequent anchor tab text is searched for and the tabs placed. Notice this is done across the entire text of all documents, not on a per-document basis!
Usually, a server template is used to visually place tabs at x/y coordinates and save the tabs as related to a signer Role, which can then be dynamically mapped to an actual signer recipient at envelope creation time. It appears you are using anchor tabs. This is normally seen when human users use a template as a collection of anchor tabs to apply manually in the DocuSign Web application. If the template is applied more than once in a single envelope, the anchor texts are being searched for repeatedly and each pass results in a duplicate tab. This is what you are seeing.
For your particular use case, if anchors must be used because the layout and locations of tabs on each document are different, then only apply the ServerTemplate in the last CompositeTemplate in the sequence, or conversely, specify the anchors in the InlineTemplate of the last CompositeTemplate.

How to remove non-matching DocuSign generic template anchor field from signing document c#?

I am sending the document in an envelope to sign along with the template Id to be applied. In this case, I have defined SignHere tabs for 10 signers using AnchorString. Sometimes the signer's count passed to sign the document would 2 sometime it would be 10.
What I am trying to achieve is, when there is only 1 matching signer then the rest of the AnchorString should be removed from documents, and space for those fields should also be managed accordingly.
Like, In below screen, there is only one signer passed for document as Signer2. So, in this case Signer and Signer3 should be removed.
Is that possible to remove those non-matched AnchorString from document and manage the space accordignly using c# DocuSign SDK?
Do I need to set any Envelope property to handle that case or any other configuration need to be done while sending an Envelope?
DocuSign does not remove information from the documents provided so it can not remove the anchor strings that you didn't use in your document. As a workaround you can create your anchor strings with a white font so it matches the background and it will not be noticeable to the user. This will still leave the empty space in the document, to remove the empty space you will need to provide different documents based on the scenario

How to use Automated anchor tags feature on the Embedded Sending View

I have a question regarding the Embedded Sending View. Through our program, the user selects documents which are sent to the Embedded Sending View where the user then selects recipients and has the option to add fields on the documents. The documents can have automated anchor tags such as \s1\, \s2\, and so on. What we need is for the tabs, such as Sign Here or Initial, to be displayed in the add fields page of Embedded Sending, which is not happening. Templates are not an option at this time as the documents are defined by our users. I tested this in the DocuSign Console and it didn’t work there at all, no tabs came up automatically on the add fields page despite anchor tags existing on the page.
This is the document that I tested
This is a screenshot of the Embedded Sending View. There were two signature anchors in the document and two signers/recipients were created in the Embedded Sending View.
This is a screenshot of the Tagging View - The Sign Here tabs do not come in automatically.
This is a screenshot of the page to actually sign the document through the email is sent. There are no Sign Here tabs displayed.
Automated anchor tags rely on the number in the tag text matching a recipient ID in the signer's definition. In order for \s1\ and \s2\ to map to your recipients, they'll need to have recipient IDs 1 and 2.
Automated anchor tags do not work if the document is uploaded through the web console - only if the envelope is created through the API with the document and recipients defined.
The 'stock' automatic anchor tags only work through DocuSign for Salesforce. Upon closer inspection, it looks like DFS includes a set of tags in its API traffic to create an envelope.
To approximate this behavior, I created a custom anchor tag that did work. To create these tags yourself:
Navigate to Go to Admin > Document Custom Fields
Add Field
Name: Anchor Signature
Type: Sign Here (or Initial Here if desired)
Shared: Checked (makes tag available to all users on the account)
AutoPlace Text: \s{r}\
In practice, the {r} gets replaced with the recipient ID.
This tag definition:
Results in tags being placed in my example draft that I created through the API:

Using Docusign REST API to attach document to SignerAttachmentTab

We have defined a template that will be filled in and signed by our customers. In this template we have some fields that we pre-populate along with some documents that we will attach. The customer will fill in other fields and attach more documents. We are using the REST API to generate the sign request. We are able to generate the correct REST request to fill the tabs in the template, set the recipients and successfully send the signature request. All this works great. But now we're trying to get a document attached to the appropriate SignerAttachmentTab in the template and we cannot get REST to accept it.
We've tried using the Documents field but that doesn't work with templates it seems. We created a composite template and then defined a document for the document, server template for the template itself and an inline template to contain the tab data we want to populate. This keeps generating errors about the tab page number not being right. We've tried different values and we've looked over all the forum posts and documentation related to attaching documents to templates and none of them seem to work.
For the document we specify the file to upload, set the document ID and name. In the server template we specify the template ID. In the inline template we create a recipient, set their information, build up the envelope tabs with the data and then add a SignerAttachmentTab for the document. In this tab we set the document ID to match the document ID from the Document element. We set the tabLabel to the label used in the template itself. We've tried setting pagenumber but that doesn't change anything. All we want is for the document to be sent to the customer. When the open it they can double click the attachment field and view the document we're trying to send.
I'm trying to use the recipe explorer to get this to work using raw REST and it keeps failing with the TAB_PAGENUMBER_IS_NOT_IN_DOCUMENT error. It seems like the document is taking precedence over the template. Unfortunately I cannot change the order of the templates in the editor other than setting the sequence # on the server and inline templates. Here's the request that is generated using DocuSign's test system.
{
"compositeTemplates":[{
"document": {
"documentBase64":"<Base64BytesHere>",
"documentId":"2",
"name":"Test.pdf"
},
"inlineTemplates":[{
"recipients":{
"signers":[{
"email":"abc#def.org",
"name":"Person",
"recipientId":"1",
"roleName":"Sender 1",
"tabs":{
"signerAttachmentTabs":[{
"documentId":"2",
"tabLabel":"MyAttachment"
}],
"textTabs":[{
"tabLabel":"someText",
"value":"Value1" }
]}
}]},
"sequence":"2"
}],
"serverTemplates":[{
"sequence":"1",
"templateId":"guid}]
}],
"emailBlurb":"A message",
"emailSubject":"Test",
"status":"sent"
}
I've looked at the existing posts in the forums and either they don't work for my case or they aren't trying to actually attach the documents to the template but simply include them as a document in addition to the template.
Update
Re:
...associate [a] document to the tab so that the signer will be able to click the attachment field in the document and see the document
Yes, you can now do this by using Smart Sections with a documentHtmlDisplaySettings object in the Envelopes:create request. The collapsed (or collapsible) section can be displayed in different ways:
inline
collapsible
collapsed
continue_button
responsive_table
responsive_table_single_column
print_only
Live examples that you can try online
HTML source document
Word source document
Original answer
Re:
But now we're trying to get a document attached to the appropriate SignerAttachmentTab in the template and we cannot get REST to accept it.
You're trying to use the API to add a document to a SignerAttachmentTab?
This is not supported. Only signers themselves add documents to a SignerAttachmentTab. The API can't do it for them.
Is the issue that you want to make sure that a signer attaches (uploads) a document to the envelope as part of the signing ceremony? You can make the tab non-optional (required). But that won't check the contents of the attached file.
You could use a web hook / Connect to check the file(s) that were attached and, if the right files weren't attached, generate another enveloper for the signer.
I figured out what I was doing wrong. For a template without attachments I was using TemplateRole and EnvelopeTabs. But for attachments, trying to include any document would cause the document to override the template. So I switched to composite template with server and inline templates for the template and data. Trying to add documents in various combinations in the various areas where they are allowed generally caused the request to be sent but with no documents.
The final solution was to go back to the original TemplateRole approach but to create the envelope as a draft. After the draft envelope was created I could then add the document to the envelope. But unfortunately to send the envelope you then have to reattach the recipients. I'm looking to clean that up but otherwise it is working for me now.

Docusign: Creating a Document with dynamic content

I have a document that is very similar to a Purchase Order that needs to be sent out for a signature through DocuSign.
There's header type data that is fixed and can easily be placed on the document and then filled with tabs.
Along with this, there are Details which may be 1 or more. I'm wondering what the best strategy to use is to create this type of Document with Docusign API?
Edit: Including a sample of the PDF that needs to be produced:
TIA
Anchor strings would be a good option to explore, even moreso if all you need from DocuSign is a Signature (and/or Date Signed) tab.
EDIT: For example, on your document you could whitetext "sig1" where you want the recipient to sign.
"signers": [
{
"email": "testsigner#test.com",
"name": "John Doe",
"recipientId": "1",
"routingOrder" : "1",
"tabs" : {
"signHereTabs" : [
{
"tabLabel" : "SignHere",
"anchorString" : "sig1"
}
]
}
}
]
},
See the screenshot I've attached. However, I did not white out my anchor.
One more thing to note. I created the test below from the WebApp. If using the API the bottom left of the tag will apply to the bottom left of the text.
You're really asking about dynamically creating a document first and foremost, then getting it signed via DocuSign.
You have a number of options:
Create a pdf dynamically. There are many libraries available for doing this. Just google for "creating a pdf ".
Create an html document dynamically, then either send it to DocuSign directly or first send it to a company that specializes in making nice documents from dynamic data. I like WebMerge for this.
When you send the doc to DocuSign, I agree with Rickey that Anchor Strings are a good way to have the signature in the right place. There's a recipe for placing DocuSign fields by using anchor strings.

Resources