Filling out documents with DocuSign embeded - docusignapi

We would like to redirect a user from our portal to sign documents. But one of the documents, a skills checklist, also needs to be completed and signed. Is it possible for the user to go through the document and complete form fields within DocuSign ? i.e., the same way a user might fill out an editable PDF. These are mostly check boxes and the forms can vary in length from 30 check boxes to several hundred.

Yes you can easily do this with the DocuSign REST API. DocuSign helps you manage your entire document workflow through Stick-eTabs:
http://www.docusign.com/developer-center/explore/features/stick-etabs.
You can add checkboxes, text fields, dates, etc. to your documents and templates and you can use the REST API to programmatically add them when needed, especially when you have a lot like the several hundred you have mentioned. To add Stick-eTabs (such as Check Boxes) through the API all you have to do is add them in your JSON or XML formatted request bodies. Generically, it would be a list for each different tab type you want to add, such as:
"tabs": {
"signHereTabs": [{
}],
"checkboxTabs": [{
}],
"dateSignedTabs": [{
}],
...
}
However please note that there are slightly different properties for the different types of tabs. See this page from the REST API guide that has more info for each tab type:
http://www.docusign.com/p/RESTAPIGuide/Content/REST%20API%20References/Tab%20Parameters.htm

Related

JSON request for envelope with single document, two signers, pre-fill fields

I have an envelope with a single document and two signers saved as a server-side template. The signers execute the agreement in a specific order. The document has a number of pre-fill fields in it.
I am trying to automate sending this agreement out using Integromat. Unfortunately, Integromat's module doesn't allow for pre-fill fields in templates, leaving me to create the API request manually. This is where I get stuck.
The closest I have come is the JSON request below, POSTed to:
…/v2.1/accounts/{accountId}/envelopes, with capitalised values filled in automatically:
{
"templateId": "TEMPLATE_ID",
"templateRoles": [
{
"email": "CLIENT_EMAIL",
"name": "CLIENT_NAME",
"roleName": "Recipient",
"tabs": {
"prefillTabs": {
"textTabs": [{
"tabLabel": "Prefill: Purpose",
"value": "PURPOSE_FIELD_DATA"
}]
}
}
}, {
"email": "STAFF_EMAIL",
"name": "STAFF_NAME",
"roleName": "Company"
}
],
"status": "sent"
}
The response from the API is:
The operation failed with an error. [400] A Required field is
incomplete. TabId: GUI_HERE
What I can't figure out is how to get the pre-fill data submitted since it's not tied to a particular signer. I have scoured the v2.1 API documentation but there is no scenario simple enough for this request.
Apologies if I am missing something obvious here; this is my first rodeo with DocuSign's API.
Do you have any idea what I am doing wrong or, better yet, what the body of the request should be for this (presumably) simple scenario?
Update: For pre-fill tabs, you need to have both the tabId and tabLabel, not enough to just have tabLabel like regular tabs.
My guess is a mismatch of the tabId field for the tabs on your template vs. what's in the API request:
You had this value in your request:
Prefill: Purpose
Does it match how the template was set?
I just tried this with composite templates.
When I added the prefill tabs to a recipient I received the error
Error code: INVALID_TAB_OPERATION.
Message: The Tab specified is not valid for the requested operation.
PrefillTab not allowed for recipient.
which makes sense since prefill tabs are associated with a document, not a recipient.
I tried by adding a document to the composite template, but that didn't work either.
I suggest that you use regular tabs. Mark them locked so they can't be changed. Mark them shared so every signer will see them. Then fill in their values as part of your Envelopes:create call.
Here's a live example of doing this. Note the text2 tab which is locked. (It should have the shared attribute set to true. You can add that from the Tabs/text toolbox on the left.)
Also see this blog post about templates.
Integromat does even without using DocuSign Rest APIs.
You can use Powerforms, it will save your cost for Rest APIs.
I recently did this, but issue is for first recipient, you need to send email manually with powerform link.
Here I dynamically construct PowerForm URL where I pass values to pre populate template fields.
To send email from integromat, you can configure Gmail module or any other email module and create html template where you can append Powerform URL in anchor tag

Filling template textTab, how to wrap text value?

I'm using a template with a bunch of standard text fields defined via the browser UI placing fields on a document background. I've selected the "fixed" option for each of these fields, however the text when programmatically filled in via an api call is not wrapping and instead extending outside the prescribed area. How can i have this programmatic value entry of fields but still have them respect the width of the field?
Have tried setting the "fixed" attribute on the field in the template definition UI.
I won't paste the full json I'm passing as it's huge, but I'm using the same tabLabel/value format from the DocuSign example as seen here:
{
"accountId": "301424",
"emailSubject": "API Example - Populating Data in Templates",
"templateId": "44D9E888-3D86-4186-8EE9-7071BC87A0DA",
"templateRoles": [{
"email": "john.doe#email.com",
"name": "John Doe",
"roleName": "Customer",
"tabs": {
"textTabs": [{
"tabLabel": "CustomerAddress",
"value": "123 Main St. San Francisco, CA 94105"
},
{
"tabLabel": "CustomerSSN",
"value": "12-345-6789"
}]
}
}],
"status": "sent"
}
Expected result would be a wrapped text in the field, however am actually getting text running into subsequent fields:
What I've defined in the template:
What I'm getting in the output (obviously not ideal):
For text fields (text tabs) if you want multiple lines give the field a larger height to enable two (or more) lines of text. The text should wrap automatically.
The height a line of text takes up depends on the text size for the field, which you can set.
You're setting the initial value via the API--will the signer be able to change it? That's a common use case for setting the initial values--enable the signer to update/correct the data as needed. (And DocuSign will tell your app whether the signer changed the value or not.)
If you're setting the value of the field and the signer can not change the value, then you're using using DocuSign as a custom document (not form) generator. That's fine, many apps do that.
If you run into an issue that DocuSign doesn't support then an alternative is to create the custom document using a different technique.
For example, you could create the document in HTML (programmatically) and DocuSign will convert it to a PDF for signing. Or you can create a customized PDF
document yourself, there are many libraries available.

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.

DocuSign API auto convert PDF fields to SecureFields

When using the DocuSign API to create a new template, is there a way to automatically convert PDF fields to DocuSign SecureFields like there is when using the web console?
Posting to:
https://demo.docusign.net/restapi/v2/accounts/{account_id}/templates
Request body:
{
"emailsubject":"Please sign this",
"templateId":"",
"recipients":{
"signers":[{
"routingOrder":1,
"roleName":"RoleOne",
"recipientId":"1"
}]
},
"envelopeTemplateDefinition":{
"name":"test",
"templateId":""
},
"documents":[{
"documentId":"1",
"name":"Agreement8_7_2012",
"transformPdfFields":"true"
}]
}
I get a successful response and the template is created, just without any DocuSign SecureFields.
First, try setting the defaultRecipient property to true for the recipient:
"recipients":{
"signers":[{
"routingOrder":1,
"roleName":"RoleOne",
"recipientId":"1",
"defaultRecipient":"true"
}]
}
This will tell DocuSign that all PDF fields that are transformed into DocuSign fields should belong to that recipient.
If that change doesn't resolve your issue, then I'd suspect that perhaps it's the properties of the PDF fields that are preventing the transformation from being successful. To troubleshoot, I'd suggest that you do the following:
Verify that the fields in your PDF are amongst the Field Types that DocuSign will convert (i.e.: CheckBox, DateTime, ListBox, Numeric, Radio, Text, Signature, and Password).
Examine field properties in the PDF. Seems like DocuSign may not transform PDF fields that have certain protective properties set (for example, Visible=false -- or for signature fields, Read-Only=true). Perhaps start experimenting with various property settings on a single field, to see if changing field properties in the PDF enables DocuSign to transform that field.
The "Transform PDF Fields" section [starting on page 105] of the DocuSign REST API Guide (http://www.docusign.com/sites/default/files/REST_API_Guide_v2.pdf) contains info about the field transformation process.

Automatically add tags

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.

Resources