Is previewing possible composite documents without sending it out by eMail - docusignapi

Is it necessary to send out an eMail to recipients to fill a template with tabs?
At the moment I create an envelope with status=sent that will obviously sent the filled documents to recipients. I would not like to send the document's, when creating.
If I use status=created the preview shows just empty documents. The templates are not filled with the tabs and not send.
How can I preview, but not sent an eMail. And sent when I think I am ready. In total the recipient would just get on eMail to sign their documents.
{
"emailSubject": "DocuSign: Multi Document",
"status": "sent",
"eventNotification": {
"url": "http://fake.com",
"envelopeEvents": [
{
"envelopeEventStatusCode": "Completed"
}
],
"recipientEvents": [
{
"recipientEventStatusCode": "Completed"
}
]
},
"brandId": "11111-my-brand-id---1111",
"compositeTemplates": [
{
"serverTemplates": [
{
"sequence": 1,
"templateId": "myTemplate-id-1"
}
],
"inlineTemplates": [
{
"sequence": 1,
"recipients": {
"signers": [
{
"email": "adv+docusign#test.test",
"name": "Dev",
"recipientId": 1,
"roleName": "Advisor",
"tabs": {
"textTabs": [
{
"tabLabel": "Subscription_Amount",
"value": "100000",
"documentId": 1
}
],
"radioGroupTabs": []
}
}
]
}
}
]
},
{
"serverTemplates": [
{
"sequence": 2,
"templateId": "myTemplate-id-2"
}
],
"inlineTemplates": [
{
"sequence": 2,
"recipients": {
"signers": [
{
"email": "adv+docusign#test.test",
"name": "Dev",
"recipientId": 1,
"roleName": "Advisor",
"tabs": {
"textTabs": [
{
"tabLabel": "Subscription_Amount",
"value": "100000",
"documentId": 1
}
],
"radioGroupTabs": []
}
}
]
}
}
]
},
{
"serverTemplates": [
{
"sequence": 3,
"templateId": "myTemplate-id-3"
}
],
"inlineTemplates": [
{
"sequence": 3,
"recipients": {
"signers": [
{
"email": "other+docusign#test.test",
"name": "Dev",
"recipientId": 1,
"roleName": "Other",
"tabs": {
"textTabs": [
{
"tabLabel": "Subscription_Amount",
"value": "100000",
"documentId": 1
}
],
"radioGroupTabs": []
}
}
]
}
}
]
}
]}
Sending (short version)
{
emailSubject: 'DocuSign: Multi Document',
status: 'sent',
eventNotification:
exports {
url: 'https://host/o/fsg11/hook',
envelopeEvents: [ [Object] ],
recipientEvents: [ [Object] ] },
brandId: 'brand-id',
compositeTemplates:
[ { serverTemplates: [Object], inlineTemplates: [Object] },
{ serverTemplates: [Object], inlineTemplates: [Object] },
{ serverTemplates: [Object], inlineTemplates: [Object] } ]
}
Receiving
{
envelopeId: 'envelope-id',
status: 'sent',
statusDateTime: '2017-06-13T01:10:08.3100000Z',
uri: '/envelopes/envelope-id'
}

Please make sure the tabLabel, recipientId and documentId match the server templates values. The tabs should be created successfully once those values are correct.
You can obtain those values using the listTemplateDocuments && listTemplateRecipients apis.
For documentId
GET https://demo.docusign.net/v2/accounts/{accountId}/templates/{templateId}/documents
For tabLabel, recipientId
GET https://demo.docusign.net/v2/accounts/{accountId}/templates/{templateId}/recipients?include_tabs=true

Related

Error when using EU Advanced Signature with Templates

I'm getting an error when finishing a DocuSign Ceremony using EU Advanced Signature with Templates. The odd thing is that it was working before and still working for ceremonies that have an embedded PDF.
When finishing a ceremony the following error is popping up:
The envelope history shows more details:
It mentions the userEmail, so I've double-checked the JSON and everything seems to be fine, after all, I didn't get any error when creating the envelope.
Here's the JSON using a Template that is failing:
{
"status": "sent",
"eventNotification": {
"recipientEvents": [
{
"recipientEventStatusCode": "delivered"
},
{
"recipientEventStatusCode": "completed"
},
{
"recipientEventStatusCode": "sent"
},
{
"recipientEventStatusCode": "declined"
}
],
"envelopeEvents": [
{
"envelopeEventStatusCode": "delivered"
},
{
"envelopeEventStatusCode": "completed"
},
{
"envelopeEventStatusCode": "sent"
},
{
"envelopeEventStatusCode": "declined"
}
]
},
"emailSubject": "Contract",
"compositeTemplates": [
{
"serverTemplates": [
{
"templateId": "TEMPLATE_ID",
"sequence": "1"
}
],
"inlineTemplates": [
{
"sequence": "1",
"recipients": {
"signers": [
{
"routingOrder": "2",
"roleName": "Signer 2",
"recipientSignatureProviders": [
{
"signatureProviderOptions": {
"sms": "+00999555585"
},
"signatureProviderName": "UniversalSignaturePen_OpenTrust_Hash_TSP"
}
],
"recipientId": "2",
"name": "Axel Foley",
"emailNotification": {
"supportedLanguage": "en",
"emailSubject": "CUSTOM_MESSAGE",
"emailBody": "CUSTOM_MESSAGE"
},
"email": " axel.foley#email.com"
},
{
"routingOrder": "2",
"roleName": "Signer 3",
"recipientSignatureProviders": [
{
"signatureProviderOptions": {
"sms": "+00123456789"
},
"signatureProviderName": "UniversalSignaturePen_OpenTrust_Hash_TSP"
}
],
"recipientId": "3",
"name": "Alex Murphy",
"emailNotification": {
"supportedLanguage": "en",
"emailSubject": "CUSTOM_MESSAGE",
"emailBody": "CUSTOM_MESSAGE"
},
"email": "alex.murphy#email.com"
}
],
"inPersonSigners": [
{
"signerName": "Leeroy Jenkins",
"signerEmail": "leeroy.jenkins#email.com",
"routingOrder": "1",
"roleName": "Signer 1",
"recipientSignatureProviders": [
{
"signatureProviderOptions": {
"sms": "+00666888777"
},
"signatureProviderName": "UniversalSignaturePen_OpenTrust_Hash_TSP"
}
],
"recipientId": "1",
"hostName": "Lightning McQueen",
"hostEmail": "lightning.mcqueen#email.com",
"emailNotification": {
"supportedLanguage": "en",
"emailSubject": "CUSTOM_MESSAGE",
"emailBody": "CUSTOM_MESSAGE"
},
"clientUserId": "SFDC_CLIENT_USER_ID"
}
]
},
"customFields": {
"textCustomFields": [
{
"value": "SFDC_ID",
"show": "false",
"required": "false",
"name": "##SFContract"
}
]
}
}
]
}
]
}
And here's the JSON with an embedded PDF that works fine:
{
"status": "sent",
"recipients": {
"inPersonSigners": [
{
"tabs": {
"signHereTabs": [
{
"anchorYOffset": "0",
"anchorXOffset": "0",
"anchorUnits": "inches",
"anchorString": "\\s1\\",
"anchorIgnoreIfNotPresent": "false"
}
]
},
"signerName": "Vincent Vega",
"signerEmail": "vicent.vega#email.com",
"routingOrder": "1",
"roleName": "Signer 1",
"recipientSignatureProviders": [
{
"signatureProviderOptions": {
"sms": "+00789456123"
},
"signatureProviderName": "UniversalSignaturePen_OpenTrust_Hash_TSP"
}
],
"recipientId": "1",
"hostName": "Lightning McQueen",
"hostEmail": "lightning.mcqueen#email.com",
"emailNotification": {
"supportedLanguage": "en",
"emailSubject": "CUSTOM_MESSAGE",
"emailBody": "CUSTOM_MESSAGE"
},
"clientUserId": "SFDC_CLIENT_USER_ID"
}
]
},
"eventNotification": {
"recipientEvents": [
{
"recipientEventStatusCode": "delivered"
},
{
"recipientEventStatusCode": "completed"
},
{
"recipientEventStatusCode": "sent"
},
{
"recipientEventStatusCode": "declined"
}
],
"envelopeEvents": [
{
"envelopeEventStatusCode": "delivered"
},
{
"envelopeEventStatusCode": "completed"
},
{
"envelopeEventStatusCode": "sent"
},
{
"envelopeEventStatusCode": "declined"
}
]
},
"documents": [
{
"name": "Form.pdf",
"fileExtension": "pdf",
"documentId": "1",
"documentBase64": "BASE64_PDF"
}
],
"customFields": {
"textCustomFields": [
{
"value": "SFDC_ID",
"show": "false",
"required": "false",
"name": "##SFAccount"
}
]
}
}
Am I missing something? Have anyone ever seen this error before?
It's worth to mention that I'm getting the error right in the first signature (InPerson).
Kind regards
It turned out that is a known issue of DocuSign.
There is a known issue during an in-person signing session when the signer clicks on Finished, he should get the following popup
If you don’t set any email, it will fail with the CONSTRAINT_VALIDATION_ERROR
The workaround is to specify an email.

Composite Template: can't prefill first tabs

Using the below code, everything works except I am only able to fill the Tabs from whatever document I attach second. Tabs from the first don't even show up on the "Form Data" list. I'm sure this is something minor that I am overlooking, but I can not see a differance between what I have and what I have seen elsewhere on this forum, and I can not find another post with this problem. Any help would be appreciated.
{
"emailSubject": "DocuSign API - Composite Test",
"status": "sent",
"compositeTemplates": [
{
"serverTemplates": [
{
"sequence": "1",
"templateId": "TEMPLATEID"
}
],
"inlineTemplates":[
{
"sequence":"1",
"recipients": {
"inPersonSigner": [
{
"hostEmail": "HOTEMAIL",
"hostName": "HOSTNAME",
"inPersonSigningType": "inPersonSigner",
"recipientId": "1",
"roleName": "Primary",
"signerName": "John Doe",
"signerEmail": "Test#Test.com",
"clientUserId": "1001"
}
]
},
"tabs": {
"textTabs": [
{
"tabLabel": "Address",
"value": "221 Cherry St"
}
]
}
}
]
},
{
"serverTemplates":[
{
"sequence": "2",
"templateId": "TEMPLATEID"
}
],
"inlineTemplates":[
{
"sequence":"2",
"recipients": {
"inPersonSigners": [
{
"hostEmail": "HOSTEMAIL",
"hostName": "HOSTNAME",
"inPersonSigningType": "inPersonSigner",
"recipientId": "1",
"roleName": "Primary",
"signerName": "John Doe",
"signerEmail": "test#test.com",
"clientUserId": "1001"
}
]
},
"tabs": {
"textTabs": [
{
"tabLabel": "ApplicantPhone",
"value": "123-456-7890"
}
]
}
}
]
}
]
}
A couple of comments about the JSON you've posted:
the property name for the inPersonSigners should be plural (in your JSON, it's singular InPersonSigner in the first composite template object)
tabs should be a property of each inPersonSigner object (in your JSON, it's a property of the inlineTemplate object)
With this feedback in mind, here's how your inPersonSigners section should be structured:
"inPersonSigners": [
{
"hostEmail": "HOSTEMAIL",
"hostName": "HOSTNAME",
"inPersonSigningType": "inPersonSigner",
"recipientId": "1",
"roleName": "Primary",
"signerName": "John Doe",
"signerEmail": "Test#Test.com",
"clientUserId": "1001",
"tabs": {
"textTabs": [
{
"tabLabel": "...",
"value": "..."
}
]
}
}
]
And, here's your entire JSON request, modified to reflect the changes I've described above:
{
"emailSubject": "DocuSign API - Composite Test",
"status": "sent",
"compositeTemplates": [
{
"serverTemplates": [
{
"sequence": "1",
"templateId": "TEMPLATEID"
}
],
"inlineTemplates":[
{
"sequence":"2",
"recipients": {
"inPersonSigners": [
{
"hostEmail": "HOSTMAIL",
"hostName": "HOSTNAME",
"inPersonSigningType": "inPersonSigner",
"recipientId": "1",
"roleName": "Primary",
"signerName": "John Doe",
"signerEmail": "Test#Test.com",
"clientUserId": "1001",
"tabs": {
"textTabs": [
{
"tabLabel": "Address",
"value": "221 Cherry St"
}
]
}
}
]
}
}
]
},
{
"serverTemplates":[
{
"sequence": "1",
"templateId": "TEMPLATEID"
}
],
"inlineTemplates":[
{
"sequence":"2",
"recipients": {
"inPersonSigners": [
{
"hostEmail": "HOSTEMAIL",
"hostName": "HOSTNAME",
"inPersonSigningType": "inPersonSigner",
"recipientId": "1",
"roleName": "Primary",
"signerName": "John Doe",
"signerEmail": "test#test.com",
"clientUserId": "1001",
"tabs": {
"textTabs": [
{
"tabLabel": "ApplicantPhone",
"value": "123-456-7890"
}
]
}
}
]
}
}
]
}
]
}

Docusign REST composite templates and embedded signing creates duplicate recipients

I'm having a problem creating an envelope from a composite template and having it not duplicate the recipient. Here is a sample of my call.
{
"emailSubject": "Please complete the following forms",
"status": "sent",
"compositeTemplates": [
{
"serverTemplates": [
{
"sequence": "1",
"templateId": "5ff1b987-dc38-49b1-b394-840f10ad08bb"
}
],
"inlineTemplates": [
{
"sequence": "2",
"recipients": {
"signers": [
{
"name": "Bob Sample",
"email": "bob.sample#example.com",
"roleName": "Client",
"clientUserId": "bob.sample#example.com",
"recipientId": "1"
}
]
}
}
]
},
{
"serverTemplates": [
{
"sequence": "1",
"templateId": "02d947aa-6320-4a6b-b4b4-79c4c733d0d0"
}
],
"inlineTemplates": [
{
"sequence": "2",
"recipients": {
"signers": [
{
"name": "Bob Sample",
"email": "bob.sample#example.com",
"roleName": "Client",
"clientUserId": "bob.sample#example.com",
"recipientId": "1"
}
]
}
}
]
}
]
}
When I look at the envelope it has Bob Sample twice in the signing flow. How do I make this call so that only one Bob Sample is required to sign?

How to pre-fill data tag with a date mask

I am creating an envelope using the RES API and have a tag on the document to capture a date (not the date signed, another recipient-supplied date). I can successfully pre-fill the value of this when the mask on the field is Text, but when I switch it to be Date it's blank. "DOBField" is the label of the tag below. Anyone know what I'm doing wrong here?
{
"accountId": "xxxxxx",
"emailSubject": "DocuSign API - Embedded Signing Example",
"compositeTemplates": [
{
"serverTemplates": [
{
"sequence": 1,
"templateId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx"
}
],
"inlineTemplates": [
{
"sequence": 1,
"recipients": {
"signers": [
{
"email": "123#456.com",
"name": "Rick James",
"clientUserId": "3",
"recipientId": 0,
"roleName": "Signer"
}
]
}
}
]
},
{
"serverTemplates": [
{
"sequence": 1,
"templateId": "xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
],
"inlineTemplates": [
{
"sequence": 1,
"recipients": {
"signers": [
{
"email": "123#456.com",
"name": "Rick James",
"clientUserId": "3",
"recipientId": 0,
"roleName": "Signer",
"tabs": {
"textTabs": [
{
"tabLabel": "DOBField",
"value": "12/24/1976"
}
]
}
}
]
}
}
]
}
],
"enableWetSign": false,
"status": "sent"
}
If you've specified mask of "Date" for the field, then it's no longer a textTab -- it's now a dateTab. So, try changing textTabs to dateTabs in your API request. i.e., the tabs portion of the request will look like this:
"tabs": {
"dateTabs": [
{
"tabLabel": "DOBField",
"value": "12/24/1976"
}
]
}

Custom Fields on envelope via API with Composite Templates

I am trying to create 2 custom fields when creating an Envelope from templates using composite templates below is the json.
{
"emailSubject": "This is a new",
"status": "sent",
"compositeTemplates": [
{
"inlinetemplates": [
{
"sequence": "2",
"recipients": {
"signers": [
{
"email": "email#email.com",
"name": "Jimmy Nobody",
"clientuserid": "1",
"recipientid": "1",
"rolename": "signer",
"dfaultrecipient": "true",
"tabs": {
"texttabs": [
{
"name": "Text",
"tabLabel": "name",
"value": "Joe Smith"
},
{
"name": "Text",
"tabLabel": "address",
"value": "987 apple lane"
}
]
}
}
]
}
}
],
"servertemplates": [
{
"sequence": "1",
"templateId": "52be0f34-d8aa-420f-8283-4e9cc2bb499f"
}
]
},
{
"inlinetemplates": [
{
"sequence": "2",
"recipients": {
"signers": [
{
"email": "email#email.com",
"name": "Jimmy Nobody",
"clientuserid": "1",
"recipientid": "1",
"rolename": "signer",
"dfaultrecipient": "true",
"tabs": {
"texttabs": [
{
"name": "Text",
"tabLabel": "name",
"value": "Joe Smith"
},
{
"name": "Text",
"tabLabel": "address",
"value": "987 apple lane"
}
]
}
}
]
}
}
],
"servertemplates": [
{
"sequence": "1",
"templateId": "e00b896b-4ac7-48b1-8280-bfe3830a61f1"
}
]
}
],
"customFields": {
"textCustomFields": [
{
"name": "callingsystem",
"required": "true",
"show": "false",
"value": "3e56cabd-6211-4203-a462-a7ff960a6b9c"
},
{
"name": "callingsystemid",
"required": "true",
"show": "false",
"value": "crm"
}
]
}
}
The problem is that this JSON is accepted and and envelope is created but no custom fields are on the envelope. What am i doing wrong?
You want to put it inside the inline templates tag. Also your formatting was a bit off and you had a typo in defaultRecipient
Try this:
{
"emailSubject": "This is a new",
"status": "sent",
"compositeTemplates": [
{
"serverTemplates": [
{
"sequence": "1",
"templateId": "52be0f34-d8aa-420f-8283-4e9cc2bb499f"
}
]
},
{
"serverTemplates": [
{
"sequence": "1",
"templateId": "e00b896b-4ac7-48b1-8280-bfe3830a61f1"
}
]
},
{
"inlineTemplates": [
{
"sequence": "2",
"customFields": {
"textCustomFields": [
{
"name": "callingsystem",
"required": "true",
"show": "false",
"value": "3e56cabd-6211-4203-a462-a7ff960a6b9c"
},
{
"name": "callingsystemid",
"required": "true",
"show": "false",
"value": "crm"
}
]
},
"recipients": {
"signers": [
{
"email": "email#email.com",
"name": "Jimmy Nobody",
"clientuserid": "1",
"recipientid": "1",
"rolename": "signer",
"defaultrecipient": "true",
"tabs": {
"texttabs": [
{
"name": "Text",
"tabLabel": "name",
"value": "Joe Smith"
},
{
"name": "Text",
"tabLabel": "address",
"value": "987 apple lane"
}
]
}
}
]
}
}
]
}
]
}

Resources