DocuSign API create envelope in XML with Recipient Custom Fields - docusignapi

I am trying to use recipient custom fields in xml. I have tested the solution in JSON and it works, but it needs to work in XML for the client's system.
I can find no online examples of such a payload and what the translated value should be. I have tried a few different versions, with none of them working. Please see below for details.
Working JSON version:
"recipients": {
"signers": [
{
"email": "person#email.com",
"name": "ExternalDocuSign",
"roleName": "External Signer 1",
"routingOrder": "1",
"recipientId": "External Signer 1",
"customFields": [ "Rolename: External Signer 1" ], - Recipient Custom Field
},
However, it does not work in XML. To be clear, everything else but recipient custom fields works as expected.
XML version with Recipient Custom Fields not working:
<recipients>
<signers>
<signer>
<recipientId>External Signer 1</recipientId>
<email>person#email.com</email>
<name>ExternalDocuSign</name>
<routingOrder>1</routingOrder>
<roleName>External Signer 1</roleName>
<CustomFields><CustomField>Rolename: External Signer 1</CustomFields></CustomFields> - One example of a failed attempt
</signer>
</signers>
</recipients>

Note the DocuSign eSignature REST API uses camelCase and not PascalCase, so it should be:
<recipients>
<signers>
<signer>
<recipientId>External Signer 1</recipientId>
<email>person#email.com</email>
<name>ExternalDocuSign</name>
<routingOrder>1</routingOrder>
<roleName>External Signer 1</roleName>
<customFields><customField>Rolename: External Signer 1</customFields></customFields> - One example of a failed attempt
</signer>
</signers>
</recipients>

Related

Docusign - Setting tabs in HTML documents - concealValueOnDocument

Need help with using the attribute ConcealValueOnDocument. Document in the envelope is a html document
Following syntax was tried and it did not work.
<input name="color" data-ds-type="text" data-ds-role="Signer1" style="width:120px;" concealValueOnDocument="true" />");
And in the developer console the option is "Hide text with asterisks". I am looking for examples or directions on how to conceal a value when uploading as HTML.
Also is it possible to hide the text box completely when value is entered?
Edited to show how the document is submitted
Document document = new Document();
document.setHtmlDefinition(documentHtmlDefinition);
document.setName(signatureRequest.getDocumentName());
document.setDocumentId(signatureRequest.getDocumentId());
....
envelopesApi.createEnvelope(accountId, envelopeDefinition);
And the html has appropriate tags for different fields.
You are setting the tab via inline HTML. Inline HTML can be used to set many tab properties, but not all of them. concealValueOnDocument cannot be set via inline HTML. The list is on page Setting tabs in HTML documents in section Configuring HTML tabs.
Solution
Use an Inline JSON marker for the tab. See page Setting tabs in HTML documents.
Example
API request:
"textTabs": [
{
"name": "color",
"tabLabel": "signer1Color",
"width": "120",
"concealValueOnDocument: "true"
}
]
Within the HTML:
{{ "tabLabel": "signer1Color" }}

DocuSign Api - TextTab size

I am having trouble with creating texttabs via the docusign REST API.
The creation succeed, but when I open the DocuSign page to sign the document, the created texttabs have not the defined size.
Interestingly the created notetabs with the same size work properly.
I compare the texttab with a Textbox with the size 100 px * 100 px.
How can I fix this issue?
"textTabs": [
{
"height": 100,
"name": "Test1",
"width": 100,
"disableAutoSize": "true",
"documentId": "1",
"pageNumber": "1",
"xPosition": "291",
"yPosition": "244"
}
]
DocuSign adds some additional offsets based on the Tab Type that is being used.
See this answer for more information.
Troubleshooting Tip:
I suggest, you use the DocuSign Web Sending UI to tag your documents and use the lisEnvelopeRecipients to retrieve the Tab positions. You can then use the Tab positions for your subsequent API calls.

Docusign - Create envelope from PDF form

We have a document, a PDF Form, and we have labelled one of the fields in the PDF form as “prescriber_signature” where we want to place a signature placeholder.
We are sending a document to create the envelope and here is my request body. Attached is the document that we are sending as part of this multipart request.
We are not successful so far in getting the signature placeholder placed per the label name “prescriber_signature”. Can you look into the xml and suggest us what needs to be done please?
XML Body:
?xml version="1.0" encoding="UTF-8"?>
<envelopeDefinition xmlns="http://www.docusign.com/restapi">
<emailSubject>DocuSign API - Signature Request on Document</emailSubject>
<status>sent</status>
<documents>
<document>
<documentId>1</documentId>
<name>Samplefileflattenedfalse.pdf</name>
</document>
</documents>
<recipients>
<signers>
<signer>
<recipientId>1</recipientId>
<clientUserId>1234</clientUserId>
<email>prasanna112#gmail.com</email>
<name>POC Prescriber Name</name>
<tabs>
<signHereTabs>
<signHere>
**
<anchorString>prescriber_signature</anchorString>
**
<anchorXOffset>1</anchorXOffset>
<anchorYOffset>0</anchorYOffset>
<anchorIgnoreIfNotPresent>true</anchorIgnoreIfNotPresent>
<anchorUnits>inches</anchorUnits>
</signHere>
</signHereTabs>
</tabs>
</signer>
</signers>
</recipients>
</envelopeDefinition>
I think you're combining to unique DocuSign features here. The first feature is the ability to transform PDF form fields into DocuSign fields - such as signature fields, data fields, etc.
The second feature, which is completely separate, is the Anchor Tagging feature (also called AutoPlace). With this feature you can tell DocuSign to place any types of fields at certain locations in your documents. Those locations are based on the actual document content itself (i.e. what the viewer sees), not the PDF form field names.
From what I can tell I think you are trying to use the first feature listed above (PDF Form fields transformed into DocuSign fields). As such, please see the following page from the API Guide which explains the transform rules:
DocuSign API Guide - Document Parameters
The following information can be found through this page:
When extrapolating Adobe text fields, the following Adobe names correspond to DocuSign names:
Adobe name contains DocuSignSignHere or eSignSignHere = DocuSign Signature
Adobe name contains DocuSignSignHereOptional or eSignSignHereOptional = DocuSign Optional Signature
Adobe name contains DocuSignInitialHere or eSignInitialHere = DocuSign Initials
Adobe name contains DocuSignInitialHereOptional or eSignInitialHereOptional = DocuSign Optional Initials
Adobe name contains DocuSignEnvelopeID or eSignEnvelopeID = DocuSign EnvelopeID
Adobe name contains DocuSignCompany or eSignCompany = DocuSign Company
*Adobe name contains DocuSignDateSigned or eSignDateSigned = DocuSign DateSigned
Adobe name contains DocuSignTitleor eSignTitle = DocuSign Title
Adobe name contains DocuSignFullNameor eSignFullName = DocuSign FullName
Adobe name contains DocuSignSignerAttachmentOptional or eSignSignerAttachmentOptional = DocuSign Optional Attachment
Any other name will default to a DocuSign data (text) field

Docusign REST v2 API : Populating Tab text data when creating an envelope via template

First time that I've used the Docusign API and it seems great.. but am having issues...
I've tried a number of various changes to my XML format and just cannot get any tabs to populate with data via my API call. I created a simple template & a single Signer, called "Checker". I added a label to the template called lblTest. I've verified that the "Checker" is a signer and can see the tabs that I add.
All that I'm trying to do is pass through a value that I want to display on a single template in an envelope.. that's it.. should be very simple!
I'm following the code here --> http://iodocs.docusign.com/APIWalkthrough/requestSignatureFromTemplate
The document is being sent, but the tab data is not being populated.
The XML I'm POSTing to ~/envelopes is as follows
<envelopeDefinition xmlns=\http://www.docusign.com/restapi\>
<status>sent</status>
<emailSubject>DocuSign API - Signature Request from Template</emailSubject>
<templateId><<redacted>></templateId>
<templateRoles>
<templateRole>
<name>Some Fake Person</name>
<email><<redacted>></email>
<roleName>Checker</roleName>
<tabs>
<textTabs>
<textTab>
<tabLabel>lblTest</tabLabel>
<value>12345678</value>
</textTab>
</textTabs>
</tabs>
</templateRole>
</templateRoles>
</envelopeDefinition>;
I've posted my API call, to show envelope recipients, as suggested in other posts.
API call result for
https://demo.docusign.net/restapi/v2/accounts/749390/envelopes/08C591B3-F6A4-4A9B-80DA-F7B542E58FE2/recipients?include_tabs=true&include_extended=false
API Call Result: 1 1 789ccf19-7dea-4e1a-bb50-9d273d128105 false Checker 1 created false 1 1 1 56cbbdfd-4f97-492f-9612-015f5ab19843 42 6 false false lblTest false false false false 8 false 60 false false 11
Thank you -- I've spent way too much time on this and am pulling my hair out in frustration!!!
Try changing <textTab> to <text> -- like this:
<textTabs>
<text>
<tabLabel>lblTest</tabLabel>
<value>12345678</value>
</text>
</textTabs>
Since you're using XML format with the REST API, this page will be helpful >> https://www.docusign.net/restapi/help -- it lists the format of all API requests and responses, in both JSON and XML.

Dynamic Company Name on PDF

I have a place on my pdf that says, I authorize .....
I would like to dynamicly put in the Company Name here that will be use in the same template
is there a way like how I pass recipientName, I can also pass company Name so that it can display here.
Please research the DocuSign Developer Center, as it answers this question and many more you may have. If you look at the Explore -> Features section you'll see in the Stick-eTabs section an area that describes Tab Positioning. Here it explains the two main ways of placing tabs on your documents.
https://www.docusign.com/developer-center/explore/features/stick-etabs
The Tab Positioning in the above page describes how you can place tags using Absolute positioning (i.e. 100 pixels to the left, 50 pixels down), or you can use Relative (aka Anchor) positioning. With anchor tabs you can place tabs based on document content. For your example of placing a company tab at or near the text "I authorize...", you can use the following (partial) JSON:
"tabs": {
"companyTabs": [
{
"anchorString": "I authorize...",
"anchorXOffset": "1",
"anchorYOffset": "0",
"anchorIgnoreIfNotPresent": "false",
"anchorUnits": "inches"
}
]
}
This would in turn place a companyName tab 1-inch to the right of the text "I authorize..." in your document. You can place any DocuSign tab using the Anchor Tagging method, but one thing to note is that it will place those tags at ANY and EVERY location it finds the anchorString text in the envelope.

Resources