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.
Related
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
We want to integrate docusign functionality in our product where we allow our product users to map PDF Forms to database fields and populate the PDF form as per the mapping.
We want our users to populate PDF forms with appropriate data as per the configured mapping in our application, before they send the filled PDF form to get it signed from different associated recipients. Original PDF form will be same but its fields will contain different data as per the intended recipient.
We do not want users to repeatedly configure Signing Tabs (Tags) for the same PDF forms again and again.
So we thought trying Templates feature available in docusign. I just want to confirm before implementing Templates feature, whether Template feature will allow me to Send the same PDF form with associated recipeints data filled up from our application and send the filled PDF form to recipients to sign.
As per the documentation it is not clear, whether I can upload the document’s bytes of the document to be signed while using the template feature.
Yes you can definitely populate different values for different recipients when using the same DocuSign template. They would not be very useful if you could not.
This has been answered through other posts, see here for example:
Not able to pass in values to docusign template
You just need to use the tabLabel to identify the tab you want to populate and then use the value field to populate it's value dynamically. For instance, to populate to two text fields (ie data tabs) you would do:
{
"accountId": "221765",
"emailSubject": "DocuSign Templates Webinar - Example 2",
"emailBlurb": "Example #2 - Dynamically Populate Form Fields",
"templateId": "44D9E888-3D86-4186-8EE9-7071BC87A0DA",
"templateRoles": [
{
"email": "jondow#email.com",
"name": "Jon Dow",
"roleName": "RoleOne",
"tabs": {
"textTabs": [
{
"tabLabel": "ApplicantName",
"value": "John Doe"
},
{
"tabLabel": "ApplicantSSN",
"value": "12-345-6789"
}
]
}
}
],
"status": "sent"
}
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.
In docusign interface, there is an option to change the order of the documents in a template. Is it possible to re-order the documents in a template using REST APIs?
I have a requirement where end-user should be able to
a) select the templates
b) re-order the documents in selected templates
c) Application should form envelope using selected templates and send it.
Both (a) and (c) features are working fine using REST APIs but when it comes to re-ordering the documents within the template, I am unable to find a solution.
This is the JSON request I am using for composite templates:
{"serverTemplates": [
{
"sequence": "1",
"templateId": "'.$template_id.'"
}
],
"inlineTemplates": [
{
"sequence": "2",
"recipients": {
"signers": [
{
"email": "'.$emp_rec['email_id'].'",
"name": "'.$emp_rec['name'].'",
"recipientId": "1",
"roleName": "Employee",
"routingOrder": "1"
}
]
}
}
]
}
Let me know if any more information required.
The order of documents appearing in an envelope is based on the order used when creating the envelope. The only exception to this is if building a draft envelope and using the PUT .../envelopes api call to add documents to the draft. This method supports the use of "order". Therefore, if creating an envelope via composite templates, the order of documents in the envelope is based on the order of the composites.
For Composite Template envelope construction, you should think of each composite as a "unit of document contribution". In your snippet of a single composite, the lowest numbered sequence is the server template, so it will contribute the document(s) from the server template. All other referenced templates will be "applied" to that document.
It isn't clear from your question whether you want to add documents from server templates or if you are saying that the particular server template has 2 or more documents in the template. If the latter, I strongly recommend breaking them apart into their own individual templates. This will give you maximum flexibility. Since a multi-document server template can't really be applied to a contributed document, I view them as only useful when creating an envelope from that single template.
I have a template with a known first signer, then a second signer who is defined by templateRoles. The first signer needs to know the name of the second signer. I have not found a way to do this via the DocuSign console, since prefilled tabs are specific to the current receiver, or to someone who has already signed or reviewed the document. I need to prefill a tab when I create the envelope. How can I assign a prefilled tab for a known recipient, since templateRoles requires a roleName and I have a recipientId?
Revised: I am able to explore an existing template via the API. In order to get a list of tabs for recipient, I use a recipientId in a request to envelopes/{envelope}/recipients/{recipientId}/tabs. I can then associate a tab with the recipientId. But in the process of prefilling a tab when creating an envelope from a template, the recipientId is rejected and a roleName is required, which makes this much more complicated.
[I'm not exactly clear on your scenario, but I'll take a stab at answering anyway. Please clarify the question (via Comments) if I've missed the mark.]
How you inform one recipient of other recipient(s) name(s) will depend on whether or not you want that information (i.e., the recipient names) to actually appear somewhere in the documents themselves.
If you do NOT want the name(s) of subsequent recipient(s) to appear anywhere within the documents themselves, but still need a way to inform the first signer of subsequent recipient(s) name(s), then you can achieve this by specifying a note for the first recipient. Contents of the "note" will appear only in the email that the recipient receives and in a popup dialog when the recipient first enters the Envelope -- it will not appear anywhere in the Envelope's document(s). For example, here's what a note looks like when the recipient accesses the Envelope:
If the Envelope is being created/sent via the DocuSign console, then the sender can manually add a NOTE for the first recipient that indicates the name of the subsequent signer(s), and/or whatever other information the first recipient needs to know.
If you're creating/sending the envelope via the API, then you can specify a NOTE for the first recipient simply by populating the note property for the first recipient (in the Create Envelope request):
POST https://{{env}}.docusign.net/restapi/{{version}}/accounts/{{acctId}}/envelopes
{
"emailSubject": "Please sign",
"emailBlurb": "Please sign...thanks!",
"status": "sent",
"compositeTemplates": [
{
"serverTemplates": [
{
"sequence" : 1,
"templateId": "9C848429-3C12-4C5E-BDD1-681C4FE25A2A"
}],
"inlineTemplates": [
{
"sequence" : 2,
"recipients": {
"signers" : [{
"email": "johnsEmail#outlook.com",
"name": "John Doe",
"recipientId": "1",
"roleName": "Signer 1",
"note": "Hi John -- the second signer's name is: Mary Adams.",
"routingOrder": "1"
},
{
"email": "marysEmail#outlook.com",
"name": "Mary Adams",
"recipientId": "2",
"roleName": "Signer 2",
"routingOrder": "2"
}
]
}
}]
}]
}
Alternatively -- if you DO want the second recipient's name to actually appear in the document(s) when the first recipient views the Envelope documents, then you should be able to simply create the Template (in the DocuSign console) with a FullName tab assigned-to / owned-by the second recipient, like this:
Then, when the first recipient views the envelope, he should see the second recipient's name where you placed the Fullname tab in the Template:
Note: If you use the "Fullname" tab approach that I've described, you might also need to make sure that this account setting (in Preferences >> Features) is enabled:
It appears I need to use the roleName in the send envelope request, even though I get the tab information using the recipientId. This is cumbersome, since I have to track two specific and unique values that refer to the same record while integrating the tab information into my application.
However, the behavior of setting tabs using the roleName appears to be extremely buggy. I can successfully set the tabs on one template, but it does not appear to work for other templates. Is there a known bug with this? I will have to abandon this approach and trying something different, so the original question still stands.