Docusign signing url - Showing document 1 of a composite template - docusignapi

Using the docusign rest api i would like to create an envelope with 2 documents.
I will then be using the Post Recipient view to show document 1 to the first recipient (in an iframe) and once signed show document 2 in the same envelope to another recipients.
i have created the templates with different tempalteRoles (different names, order 5 and 10).
Its my understanding using a userId and the right settings in my docusign account, i can show document 1 to recipient 1 and then document 2 to recipient 2.
When i try and create the composite envelope the whole document is shown.
when i call the recipient status for the envelope it only shows one signer.
I have found the envelope will only create when the 2 template roles have the same clientUserId, userName and email, otherwise i get the error "ONESIGNALLSIGN_NOT_SATISFIED"
here is the envelope i am sending through
{
"accountId": "ACCOUNT_ID",
"emailSubject": "Email subject",
"status": "sent",
"templateId": "TEMPLATE_ID",
"templateRoles": [
{
"roleName": "PDS Customer",
"email": "pds#example.com",
"name": "TestFirstName TestSurname",
"clientUserId": "1",
"tabs": {
"textTabs": [
{
"tabLabel": "DocumentNumber",
"value": "123456789",
"locked": true,
"documentId": 1,
"pageNumber": 1
}
...removed some
]
}
},
{
"roleName": "Customer",
"email": "test#example.com",
"name": "mrTestFirstName TestSurname",
"clientUserId": "2",
"tabs": {
"textTabs": [
{
"tabLabel": "StorerEmail_LocalPart",
"value": "test",
"locked": true,
"documentId": 2,
"pageNumber": 1
}
...removed some
]
}
}
],
"compositeTemplates": [
{
"compositeTemplateId": 1,
"serverTemplates": [
{
"sequence": 1,
"templateId": "TEMPLATE_ID_2"
}
]
}
]
}

The error message is due to having Document Visibility enabled. In that scenario, each signer must have at least one tab present. Your second signer (embedded or not) must have at least one tab. In this case it'd probably be on the second document.
Your API call above does refer to a second documentId though so you may be okay there.
I would suggest that you not mix the "simple" sending (using templateRoles at the top level) with composite templates. Instead, add an inline template to the compositeTemplates structure with all of your recipient information. You may be seeing some odd behavior due to mixing those.
Lastly, the default Document Visibility configuration will show a document to a recipient only if they have a tab on that document. If your second signer should see all documents then you must either add a tab for them on each document or explicitly set visibility per document.

Related

Avoid repeating recipient information multiple times while creating DocuSign envelope with composite template

I am working with composite template because I need to include multiple templates in the envelope. In all templates, signing roles are same. I have following roles and signing order.
I also have need to provide custom email subject and body for each role, when I create envelope.
Here is my request json to create envelope using composite template. Purposefully left second composite template section empty so that its not too big.
{
"status": "created",
"compositeTemplates": [
{
"serverTemplates": [
{
"sequence": "1",
"templateId": "de231abb-4566-4433-8c10-6fae41d5f36e"
}
],
"inlineTemplates": [
{
"envelope": {
"customFields": {
"textCustomFields": [
{
"name": "policy",
"value": "12345"
}
]
}
},
"sequence": "1",
"recipients": {
"carbonCopies": [
{
"recipientId": "1",
"email": "email2#domain.com",
"name": "Supervisor Name",
"roleName": "Supervisor",
"routingOrder": "2",
"emailNotification": {
"supportedLanguage": "en",
"emailSubject": "Custom email subject for supervisor",
"emailBody": "Custom email body for supervisor"
}
},
{
"recipientId": "2",
"email": "email1#domain.com",
"name": "Admin Name",
"roleName": "Admin",
"routingOrder": "4",
"emailNotification": {
"supportedLanguage": "en",
"emailSubject": "Custom email subject for admin",
"emailBody": "Custom email body for admin"
}
}
],
"signers": [
{
"recipientId": "3",
"email": "email3#domain.com",
"name": "Data entry person Name",
"roleName": "DataEntry",
"routingOrder": "1",
"emailNotification": {
"supportedLanguage": "en",
"emailSubject": "Custom email subject for data entry person",
"emailBody": "Custom email body for data entry person"
},
"tabs": {
"textTabs": [
{
"tabLabel": "field name",
"value": "field value"
}
]
}
},
{
"recipientId": "4",
"email": "email4#domain.com",
"name": "client Name",
"roleName": "Client",
"routingOrder": "3",
"emailNotification": {
"supportedLanguage": "en",
"emailSubject": "Custom email subject for the client",
"emailBody": "Custom email body for the client"
},
"tabs": {
"textTabs": [
{
"tabLabel": "other field name",
"value": "other value"
},
{
"tabLabel": "other2 field name",
"value": "other2 value"
}
]
}
}
]
}
}
]
},
{
"serverTemplates": [
{
"sequence": "1",
"templateId": "de231abb-4566-4433-8c10-6fae41d5f36e"
}
],
"inlineTemplates": [
{
.
- repeat same recipient information again
.
}
]
}
]
}
When I am preparing envelope create request json, I have to create one CompositeTemplate for each template I need to include. Within compositeTemplates[x]/inlineTemplates[0]/recipients I have specify information (name, email, roleName, routingOrder, email subject, email body and tabs if applicable) for all 4 recipients. I have to repeat same compositeTemplates[x]/inlineTemplates[0]/recipients for with in CompositeTemplate with duplicate information (name, email, roleName, routingOrder, email subject, email body) which sounds not right to me.
Question#1 - Do you know if there is any way to provide recipient at one single place instead of duplicating it under each CompositeTemplate?
My next question is about proving recipient and tab information but from different viewpoint. In Composite template under inlineTemplates I have to use EnvelopeRecipients to specify recipient and it’s tabs. In this case I need to know signing authority of each recipient/role because I need to put them under signers, corbonCopy etc. In case of envelope with single template I can easily use templateRole under EnvelopDefinition to specify recipient and their tab information just by role. I don’t need to know role’s signing authority.
Question#2 – Is there way to specify recipient information by role in CompositeTemplate without knowing signing authority like we can do with single template envelope?
Answer # 1
I do not believe so. If this workflow is a common occurrence, you might consider creating a third template containing the documents & tabs of the first two templates.
Then, you could simply send an envelope containing just that third template. In this case, you would only have to specify the recipient's information once.
However, we usually advise the composite templates pattern since it's far easier to customize and scale when your use case changes in the future.
Answer # 2
No. You are mixing two different DocuSign design patterns, i.e you should not mix Composite Template and TemplateRole.
Template Role is needed when you have one server template and you want to prepopulate the signer information and/or any DocuSign tab information present in the template from your application.
What you can do (which I'm sure you've realized) is to retrieve the signing authorities for the templates with a GET /template before making your POST /envelopes containing composite templates.

POSTMan sample - creating envelope from a template is not populating the user tags

I created a DocuSign template that contains two roles: Provider and Recipient. I did this via the DocuSign Sandbox UI.
In my template, I have one document, with four tabs on it:
1. ProviderName
2. ProviderAddress1
3. RecipientName
4. RecipientAddress
Should I be using CustomFields vs. Tabs?
What's the API call(s) that I should be making to do the following, given a template with a document in it:
create an envelope for specific users
update the text within the document in the template for the specific users
send it out?
In the POSTMan sample, I tried using this URL, doing a POST:
{{baseUrl}}/envelopes
passing in a templateId, and the following JSON below in the POST body:
JSON:
{
"templateRoles": [{
"email": "{{signer1Email}}",
"name": "The Provider",
"roleName": "Provider",
"tabs": {
"textTabs": [{
"tabLabel": "ProviderName",
"value": "This is the provider!"
},
{
"tabLabel": "ProviderAddress1",
"value": "10 Provider Street, Baltimore, MD 21212"
}]
}
},
{
"email": "{{otherEmail}}",
"name": "Test Recipient",
"roleName": "Recipient",
"tabs": {
"textTabs": [{
"tabLabel": "RecipientName",
"value": "This is the recipient!"
},
{
"tabLabel": "RecipientAddress",
"value": "10 Main Street, Baltimore, MD 21212"
}]
}
}],
"emailSubject": "DocuSign API - Signature Request on Document Call",
"templateId": "<<template ID>>",
"status": "sent"
}
This does return an Envelope Id in the response, and I do receive the email with the DocuSign document to sign.
However, the tabs are NOT populated, they're blank.
Are the roles in the Template empty placeholders? If a name/email is defined on the template, the API call won't populate them as you might expect.
Try to add the documentId and pageNumber properties to your tabs. Also, ensure the label matches what is in the original template.
Lastly, you may need to add recipientId as well to each of the recipients to match what is in the template (this one may not be required since you have the roleName but just in case)

Set data fields on the document / template, for all users to see as Read-only

I have a Word document that serves as the Document template. It only has an outline on it. I then added text fields to the template.
for example, the template JSON, it looks like this:
"recipients":
{ ...
"signers": [
{ ...
"tabs":
{
"listTabs": [
{
"documentId": "1",
"pageNumber": "1",
"recipientId": "55177519",
"tabType": "list",
"tabLabel": "##parentf2e8b853-3ef1-4872-af19-4f1e3c60a3a7##recipient",
"listItems": [
{
"text": "Dealer",
"value": "Dealer"
},
{
"text": "Customer",
"value": "Customer"
}
],
"required": "true",
"shared": "true",
"value": ""
}
],
"textTabs": [
{
"documentId": "1",
"height": "19",
"pageNumber": "1",
"recipientId": "55177519",
"tabId": "55ab5a10-54d6-4ca0-a66b-7c637c8ad61a",
...
"tabLabel": "DealerPhone",
...
},
My questions are:
How can I get all of the text fields to display the data, no matter who the recipient is- for example, the DealerPhone above? Under "Collaboration", I have set the fields set to "Recipients can Collaborate".
Once the first user selects the user from the drop-down list (the listTab below), I do not want subsequent users to go in and change that selection, but I do need the users to see who the previous / first user selected in that drop-down list.
I can share JSON files of both the template and what I'm sending to create the envelope. The template displays, but the text data is blank.
Sample JSON request body:
{
"email": "...email....",
"name": "Test Dealer",
"roleName": "Dealer",
"tabs": {
"textTabs": [
{
"tabLabel": "DealerPhone",
"value": "1-800-111-2222"
},
{
"tabLabel": "DealerContact",
"value": "Billy Dealer"
}]
}
}],
"emailSubject": "DocuSign API - TEST!!!",
"templateId": "{{templateId}}",
"status": "sent"
}
There's an account-level setting that's relevant here, available from Go to Admin > Sending Settings > When an envelope is sent, write the initial value of the field for all recipients. With that enabled, all pre-populated data will be visible to all recipients. With that disabled, data only gets 'burned in' to the PDF when the assigned recipient completes their role.
If you do not want later recipients to be able to change the value of the dropdown, you will want to disable Collaboration on it. Later signers will be able to see that selection regardless of if Collaboration is enabled or not.
Finally, you'll want to avoid using Conditional Logic on fields that should always appear. Setting a tag to be a conditional child means that it will only appear if circumstances are met.
If recipients sign sequentially (increasing routing order) then every subsequent recipient can see the tabs that prior recipients have filled and they cannot modify them. If you have all tabs assigned to your first recipient, all the other recipients will see them but they'll be read-only for them.

DocuSign REST API not creating Supplemental Documents

Attempting to use the REST API Envelope Create to include Supplemental Documents in the envelope [no templates], so with the first object in the Documents array having a display value of ‘inline’ and the signerMustAcknowledge set to ‘null’ we have for the second object in the array used the display value of ‘modal’ and the signerMustAcknowledge set to ‘no_interaction’ or to ‘view’. When the recipient reviews the envelop online the supplemental document is not shown as grey strip below the primary document offering the reviewer any options, instead the document is expanded and shown in full. What other options do we need to set to get DocuSign to treat the second document as supplemental, as described in https://support.docusign.com/en/guides/ndse-user-guide-send-supplements.
Spoke to DocuSign Support yesterday to get the ‘Supplemental Documents’ functionality added to our Demo Account and the Permission Set on the User being used for this REST API connection has the ‘Disable document upload’ unchecked and the Allow supplemental documents option (and all related options below) is checked.
Example anonymised JSON:
{
"recipients": {
"signers": [
{
"routingOrder": 1,
"recipientId": "1",
"name": "Person-A",
"email": "person-a#website.com"
}
]
},
"emailSubject": "Test subject",
"emailBlurb": "Test blurb",
"documents": [
{
"signerMustAcknowledge": null,
"order": "asc",
"name": "MyCompany Quote",
"includeInDownload": null,
"documentId": "1",
"documentBase64": "JVBERi0xLjMKJcTl8uXrp/Og0M……",
"display": "inline"
},
{
"signerMustAcknowledge": "no_interaction",``
"order": "asc",
"name": "MyCompany Quote",
"includeInDownload": false,
"documentId": "2",
"documentBase64": "JVBERi0xLjQKJeLjz9MKMiAw……",
"display": "modal"
}
]
}
You are not assigning any DocuSign tabs to the signer? your documents part of JSON is correct, just not assigning tabs might be creating an issue. If you don't assign tabs then it is called free form signing which is not allowed in most of the plans and might not work for supplemental docs. Try by assigning atleast one tab to signer in the non-supplemental document. Lack of tabs is causing the issue.

How do I docuSign multiple documents in an envelope once using docuSign Rest API?

I am creating composite templates that work correctly and I'm running into this issue.
I am adding 2 templates to sign via docusign. I set the routing orders for both of them as shown below:
Form 1
Order 1 RoleName signer test1#gmail.com
Order 2 RoleName signer2 test2#gmail.com
Form 2
Order 1 RoleName dataEntry test1#gmail.com
Order 2 RoleName dataEntry2 test2#gmail.com
This will send one email to test#gmail.com. This user completes all of his fields for both Form 1 and Form 2 in one request. This is what I want and expect. However, when test1#gmail.com completes their process, test2#gmail.com will receive 2 different emails. One to sign form 1 and the other to sign form 2. I'm trying to understand why test2#gmail.com doesn't work the same as test1#gmail.com. Can someone help explain what the reason is for receiving 2 separate emails for test2#gmail.com may be and if there's a way to fix it?
Note: When I do this via the docuSign website, it doesn't allow for the same recipient to be in that same routingOrder. It will bring up the error:
The role 'signer' conflicts with 'dataEntry'
The role 'signer2' conflicts with 'dataEntry2'
This behavior seemed strange to me since I'm able to send the envelope using the docusign rest API. If somebody could give me some clarification on this as well I'd appreciate it.
Thank you!
I am unable to repro the issue you describe. Here's what I did, and the Result:
I created two separate templates in DocuSign, each having a single document and two recipients/signers (with Role Names and Routing Orders that you specify above in your question).
I used the REST API (JSON request included below) to create/send an Envelope from these two Templates, specifying identical recipient information (name/email/recipient ID/routing order) for Recipient 1 and Recipient 2 across both Inline Template structures.
Result: Recipient 1 receives an email first, opens the envelope, and signs both documents at once. Then Recipient 2 receives an email, opens the envelope, and signs both documents at once. The Envelope status is "Completed" at that point.
I've included my API request below for your reference -- perhaps compare/contrast this with what you're doing? Also -- make sure that Recipient information (Name / Email / Recipient ID / Routing Order) is identical (including case) for each recipient between the first Inline Template and the second Inline template within the API Request -- any small difference in Name/Email/Recipient Id/Routing Order, and DocuSign will treat them as different/separate people (recipients).
POST https://{{env}}.docusign.net/restapi/{{version}}/accounts/{{acctId}}/envelopes
{
"emailSubject": "Please sign",
"emailBlurb": "Please sign...thanks!",
"status": "sent",
"compositeTemplates": [
{
"serverTemplates": [
{
"sequence" : 1,
"templateId": "TEMPLATE_ID_1"
}],
"inlineTemplates": [
{
"sequence" : 2,
"recipients": {
"signers" : [{
"email": "adamsemail#outlook.com",
"name": "Adam Adamson",
"recipientId": "1",
"roleName": "signer",
"routingOrder": "1"
},
{
"email": "bobsemail#outlook.com",
"name": "Bob Burns",
"recipientId": "2",
"roleName": "signer2",
"routingOrder": "2"
}
]
}
}]
},
{
"serverTemplates": [
{
"sequence" : 1,
"templateId": "TEMPLATE_ID_2"
}],
"inlineTemplates": [
{
"sequence" : 2,
"recipients": {
"signers" : [{
"email": "adamsemail#outlook.com",
"name": "Adam Adamson",
"recipientId": "1",
"roleName": "dataEntry",
"routingOrder": "1"
},
{
"email": "bobsemail#outlook.com",
"name": "Bob Burns",
"recipientId": "2",
"roleName": "dataEntry2",
"routingOrder": "2"
}
]
}
}]
}]
}

Resources