Many questions address portions of my request, but I cannot seem to make a complete solution work. I have created a template on my site (it has various text fields, initial fields, and signature block). Single recipient, using anchor tags for the fields. When I take a .docx file, create an envelope via the api, I want to apply the template previously mentioned, and then prefill 4 text fields on the document/template.
Anchor tags are not placing the fields appropriately.
Any advise/suggestions?
Working request call is:
{
"documents":
[
{
"documentBase64":"<BASE64STREAM>",
"documentId":"3",
"fileExtension":"docx",
"name":"10001000_20170803_FILE"
}
],
"emailSubject": "TEST - Group Audit - 10001000",
"templateId": "TEMPLATE_ID",
"templateRoles" :
[
{
"email": "JDOE#email.com",
"name": "JOHN DOE",
"roleName": "signer1",
"tabs":
{
"textTabs":
[
{
"documentId": "3",
"recipientId": "1",
"tabLabel": "groupname",
"value": "TEST GROUP ONE"
},
{
"documentId": "3",
"recipientId": "1",
"tabLabel": "groupnumber",
"value": "10001000"
},
{
"documentId": "3",
"recipientId": "1",
"tabLabel": "txt",
"value": "my#email.com"
},
{
"documentId": "3",
"recipientId": "1",
"tabLabel": "fein",
"value": "870142380"
},
{
"documentId": "3",
"recipientId": "1",
"tabLabel": "physicaladdress",
"value": "1 STREET WAY, , MY CITY, CA, 98001"
}
]
}
}
],
"status":"sent"
}
Based on the information you've provided, I understand your scenario to be as follows:
You've created a template via the DocuSign UI; that template contains a 'placeholder' document (which you will replace at run-time via your Create/Send Envlope API call) and defines the recipient(s) and tabs for that document.
When you create/send the envelope via API, you want to specify the document as part of the API request (i.e., to be used instead of the 'placeholder' document that the DocuSign template contains) and also auto-populate some of the tabs that the template defines.
If that's an accurate description of what you're trying to achieve, then you need to use Composite Templates in the API request structure. Here's an example of a Create/Send Envelope JSON request that uses composite templates (and contains data based upon the information you provided in your question):
{
"compositeTemplates": [
{
"serverTemplates": [
{
"sequence": "1",
"templateId": "TEMPLATE_ID"
}
],
"inlineTemplates": [
{
"sequence": "2",
"recipients": {
"signers": [
{
"name": "JOHN DOE",
"email": "JDOE#email.com",
"roleName": "signer1",
"tabs":
{
"textTabs":[
{
"tabLabel" : "groupname",
"value" : "TEST GROUP ONE"
},
{
"tabLabel" : "groupnumber",
"value" : "10001000"
},
{
"tabLabel" : "txt",
"value" : "my#email.com"
},
{
"tabLabel" : "fein",
"value" : "870142380"
},
{
"tabLabel" : "physicaladdress",
"value" : "1 STREET WAY, , MY CITY, CA, 98001"
}
]
}
}
]
}
}
],
"document": {
"documentId": "3",
"name": "10001000_20170803_FILE.docx",
"fileExtension": "docx",
"documentBase64": "BASE64STREAM"
}
}
],
"status": "sent",
"emailSubject": "TEST - Group Audit - 10001000"
}
Related
I am able to send a POST request to send an existing template for signing. What I'm trying to do now is attach a PDF to the signature template. The attached PDF does not need to be signed / is not a template. It is just a PDF copy of a document as an appendix to the contract.
The request is going through ok, but I'm getting the error: "TAB_PAGENUMBER_IS_NOT_IN_DOCUMENT",\r\n "message": "The pagenumber specified in the tab element is not in the document that the tab refers to. Tab on Page 8 of Document 1 for Recipient 1"
JSON:
{
"emailSubject": "Please sign this document set",
"templateId": "xxxxxxx",
"templateRoles": [
{
"email": "email#example.com",
"roleName": "Buyer",
"name": "Buyer Name"
}
],
"documents": [
{
"signerMustAcknowledge": "no_interaction",
"order": "asc",
"name": "MyCompany Quote",
"includeInDownload": true,
"documentId": "2",
"documentBase64": "<base64string>",
"display": "inline"
},
],
"status": "sent"
}
How to attach a document to an online template?
The error you are seeing is because DocuSign will try to replace the document in the template with the file you are providing.
You should be able to add this additional document by using composite templates instead. https://developers.docusign.com/docs/esign-rest-api/how-to/request-signature-composite-template-embedded/
Here is a sample:
{
"compositeTemplates": [
{
"compositeTemplateId": "1",
"inlineTemplates": [
{
"recipients": {
"signers": [
{
"email": "email#example.com",
"roleName": "Buyer",
"name": "Buyer Name"
}
]
},
"sequence": "1"
}
],
"serverTemplates": [
{
"sequence": "1",
"templateId": "xxxxxxx"
}
]
},
{
"compositeTemplateId": "2",
"document": {
"documentBase64": "<base64string>",
"documentId": "2",
"fileExtension": "pdf",
"name": "MyCompany Quote"
},
"inlineTemplates": [
{
"sequence": "1"
}
]
}
],
"emailSubject": "Please sign this document set",
"status": "sent"
}
The first composite template is used to populate your existing template with the signers information. The second composite template is where you add the additional document you want your users to sign. You can also include additional tabs inside the inlineTemplates if they are needed in the future
Is it possible to transform PDF text field (not signature field) to initialHereTab ?
Note : it works well with signature field but not with text filed
Here is my JSON request:
{
"compositeTemplates": [
{
"compositeTemplateId": "1",
"document": {
"documentBase64": "PDFDocumentInBase64",
"documentId": "1",
"fileExtension": "pdf",
"name": "Merge_2020310203633868.pdf",
"transformPdfFields": "true"
},
"inlineTemplates": [
{
"recipients": {
"signers": [
{
"clientUserId": "1",
"email": "myEmail#email.ca",
"name": "Paul J Smith",
"recipientId": "1",
"tabs": {
"initialHereTabs": [
{
"tabLabel": "\\applicant1\\*"
}
]
}
}
]
},
"sequence": "1"
}
]
}
],
"emailSubject": "Please sign this legal form at your convenience",
"status": "created"
}
Yes, per the documentation:
If: Adobe name contains DocuSignInitialHere or eSignInitialHere
Then: a DocuSign Initials tab will be created
My goal is to make SignHereTab location and size the same as one of my Pdf Form Field. Docusign guide
tells me that I can transform Pdf Form fields into DocuSign tabs. And according to the guide I shoud use CompositeTempates.
I have two recipients and two Pdfs. One pdf should be signed by both recipients, the second pdf should be signed by the first. Here is JSON example of envelop. I'm usign CreateEnvelop method from Docusign.eSign.dll (https://www.nuget.org/packages/DocuSign.eSign.dll/)
{
"compositeTemplates": [
{
"document": {
"documentBase64": "base64 data",
"documentId": "1",
"name": "MainPart.pdf",
"transformPdfFields": "True"
},
"inlineTemplates": [
{
"recipients": {
"signers": [
{
"accessCode": "1239",
"email": "insured#gmail.com",
"name": "Insured ",
"recipientId": "1",
"routingOrder": "1",
"tabs": {
"signHereTabs": [
{
"recipientId": "1",
"tabLabel": "insured_sign_parta\\*"
}
]
}
},
{
"accessCode": "1212",
"email": "owner#gmail.com",
"name": "Owner",
"recipientId": "2",
"routingOrder": "2",
"tabs": {
"signHereTabs": [
{
"recipientId": "2",
"tabLabel": "owner_sign_parta\\*"
}
]
}
}
]
},
"sequence": "1"
}
]
},
{
"document": {
"documentBase64": "base64 data",
"documentId": "2",
"name": "AdditionalPart.pdf",
"transformPdfFields": "True"
},
"inlineTemplates": [
{
"recipients": {
"signers": [
{
"accessCode": "1239",
"email": "insured#gmail.com",
"name": "Insured",
"recipientId": "1",
"routingOrder": "1",
"tabs": {
"signHereTabs": [
{
"recipientId": "1",
"tabLabel": "insured_sign_parta\\*"
}
]
}
}
]
},
"sequence": "2"
}
]
}
],
"emailBlurb": "Email Text",
"emailSubject": "Subject",
"status": "sent"
}
When I open documents SignHereTabs doesn't appear :(
Could anybody help me, please? What am I doing wrong?
I have seen tutorials from Docusign website and all related issues on StackOverflow, but still it didn't help. I've been investigating this issue for almost two days and I got nothing...
tabs should have a documentId as well as a recipientId so that they can refer to both the recipient that needs to sign them and the specific document that they should be in.
see here for full reference - https://developers.docusign.com/esign-rest-api/reference/Envelopes/EnvelopeDocumentTabs
This is my JSON code so far:
{
"status": "sent",
"emailSubject": "This is an api Demo Doc, sent for signature",
"recipients": {
"carbonCopies": [
{
"email": "nila#gmail.com",
"name": "Nilashree",
"recipientId": "2"
}
],
"signers": [
{
"email": "{{signer1Email}}",
"name": "Nilashree Nandkumar shirodkar",
"recipientId": "1"
}
]
},
"compositeTemplates": [
{
"inlineTemplates": [
{
"sequence": "1",
"recipients": {
"signers": [
{
"email": "nshiro2#students.towson.edu",
"name": "Nila Joseph",
"recipientId": "1",
"defaultRecipient": "true"
}
]
}
}
],
"documents": {
"documentId": "1",
"name": "application_form.pdf",
"transformPdfFields": "true",
"documentBase64": "{{}}"
}
}
]
}
But I am getting the following error:
"errorCode": "ENVELOPE_IS_INCOMPLETE",
"message": "The Envelope is not Complete. A Complete Envelope Requires Documents, Recipients, Tabs, and a Subject Line."
Can anyone please let me know what am I doing wrong?
Why are you using a composite template? Perhaps you are planning towards a later, more complicated envelope definition.
Your mistake is that each composite template can optionally contain only one document. The field name is document, not documents.
Instead of
"documents": {
"documentId": "1",
"name": "application_form.pdf",
"transformPdfFields": "true",
"documentBase64": "{{}}"
}
use
"document": {
"documentId": "1",
"name": "application_form.pdf",
"transformPdfFields": "true",
"documentBase64": "{{}}"
}
Also, I don't believe there's a need for the recipients outside of the composite templates structure. I'm not 100% sure about this issue though.
I am trying to develop the following workflow in DocuSign:
There are two documents to be signed. The first is a template with 4 signatures required by 4 roles. The second document is uploaded, docx or pdf, and will be signed after the first document is complete.In the first document the first two signers need to be provided to the template and I could make this work when all I had in the envelope was the template document. After converting this to a compositeTemplate I don't see a place to add the roles to the template document. I am also unsure how to add the signature to the second document to the workflow for the template document.
The following is the json I am generating:
{
"templateRoles": [
{
"email": "EMAIL1",
"roleName": "ROLE1",
"name": "NAME1"
},
{
"email": "EMAIL2",
"roleName": "ROLE2",
"name": "NAME2"
}
],
"compositeTemplates": [
{
"serverTemplates": [
{
"sequence": "1",
"templateId": "TEMPLATE-ID"
}
]
},
{
"inlineTemplates": [
{
"sequence": "2",
"documents": [
{
"documentId": "1",
"name": "Contract",
"documentBase64": <DOC DATA>
}
]
}
]
}
],
"emailSubject": "[DocuSign C# SDK] - Sample Signature Request"
}
The template roles aren't picked up by the servertemplate and the documents are sent to the third person in the workflow.
Any help with this will be much appreciated.
You will have to use multiple composite templates to add a new document.
The templateRoles specified at the root level are ignored when your envelope definition contains composite templates. The templateRoles have to be spcified within the inlineTemplate.
The tabs can be added in the second composite template.
{
"compositeTemplates": [
{
"serverTemplates": [
{
"sequence": "1",
"templateId": "<Specify the serverTemplateId here>"
}
],
"inlineTemplates": [
{
"sequence": "1",
"recipients": {
"signers": [
{
"name": "NAME1",
"email": "EMAIL1",
"roleName": "ROLE1",
"recipientId": "1"
},
{
"name": "NAME2",
"email": "EMAIL2",
"roleName": "ROLE2",
"recipientId": "2"
}
]
}
}
]
},
{
"inlineTemplates": [
{
"sequence": "2",
"recipients": {
"signers": [
{
"name": "NAME1",
"email": "EMAIL1",
"roleName": "ROLE1",
"recipientId": "1",
"tabs": {
"signHereTabs": [
{
"documentId": "2",
"pageNumber": "1",
"xPosition": "50",
"yPosition": "50"
}
]
}
}
]
}
}
],
"document": {
"documentId": "2",
"name": "DocumentName",
"fileExtension": "docx",
"documentBase64": "<Specify document bytes here>"
}
}
],
"emailSubject": "[DocuSign C# SDK] - Sample Signature Request",
"status": "sent"
}