Composite Templates and RoutingOrder - Nothing for second signer - docusignapi

I have been experimenting with the DocuSign eSign C# library, and everything has been working as expected for single template envelopes. I now need to use 2 different templates within a single envelope and have run into some issues.
I have 2 templates that I wish to combine. Everything works exactly as expected when I create a composite template, add the necessary recipients, and send the notification. This sends the combined templates to both recipients in parallel.
As soon as I add a RoutingOrder of 1/2 to the recipients, the first recipient gets prompted to sign as expected, and then once signed it is passed on to the second recipient. This is where the problem lies... the second recipient doesn't have any tabs to fill in and/or any place to sign.
If I switch the RoutingOrder of the recipients, I get the same behavior, so it is definitely related to a person being the second recipient.
Any thoughts on what I can do to fix this are greatly appreciated! The JSON generated by the DocuSign eSign API can be found below:
{
"eventNotification": {
"url": "<my_webhook_callback_url>",
"loggingEnabled": "true",
"requireAcknowledgment": "true",
"envelopeEvents": [
{ "envelopeEventStatusCode": "sent" },
{ "envelopeEventStatusCode": "delivered" },
{ "envelopeEventStatusCode": "completed" },
{ "envelopeEventStatusCode": "declined" },
{ "envelopeEventStatusCode": "voided" }
],
"recipientEvents": [
{ "recipientEventStatusCode": "Sent" },
{ "recipientEventStatusCode": "Delivered" },
{ "recipientEventStatusCode": "Completed" },
{ "recipientEventStatusCode": "Declined" },
{ "recipientEventStatusCode": "AuthenticationFailed" },
{ "recipientEventStatusCode": "AutoResponded" }
],
"useSoapInterface": "false",
"includeCertificateWithSoap": "false",
"signMessageWithX509Cert": "false",
"includeDocuments": "true",
"includeEnvelopeVoidReason": "true",
"includeTimeZone": "true",
"includeSenderAccountAsCustomField": "true",
"includeDocumentFields": "true",
"includeCertificateOfCompletion": "true"
},
"compositeTemplates": [
{
"serverTemplates": [
{
"sequence": "1",
"templateId": "1b5230a2-15da-4502-8ea4-9a7a28ae02aa"
}
],
"inlineTemplates": [
{
"sequence": "1",
"recipients": {
"signers": [
{
"name": "<customer_signer_name>",
"email": "<customer_signer_name>",
"recipientId": "1",
"routingOrder": "1",
"roleName": "Customer"
},
{
"name": "<internal_signer_name>",
"email": "<internal_signer_email>",
"recipientId": "2",
"routingOrder": "2",
"roleName": "InternalSigner"
}
]
}
}
]
},
{
"serverTemplates": [
{
"sequence": "1",
"templateId": "ae08ac4b-2d92-43cc-9c18-5eaa0a6cc8c7"
}
],
"inlineTemplates": [
{
"sequence": "1",
"recipients": {
"signers": [
{
"name": "<customer_signer_name>",
"email": "<customer_signer_name>",
"recipientId": "1",
"routingOrder": "1",
"roleName": "Customer"
},
{
"name": "<internal_signer_name>",
"email": "<internal_signer_email>",
"recipientId": "2",
"routingOrder": "2",
"roleName": "InternalSigner"
}
]
}
}
]
}
],
"status": "sent",
"emailSubject": "Test Email Subject"
}

Your server templates have both the recipients at routing order 1. Since the inlineTemplates specify the recipient at routing Order 2, the tabs in the server template will not be associated with the recipient at routing order 2.
Recipient matching is based on Recipient Role and Routing Order. If there are matches, the recipient information is merged together. A final pass is done on all CompositeTemplates, after all template overlays have been applied, to collapse recipients with the same email, username and routing order. This prevents having the same recipients at the same routing order.
You will have to either update the routing order of the recipient on your server template or specify tabs in the inline template.

Related

ENVELOPE_HAS_DUPLICATE_RECIPIENTS when sending document

My application lets a user connect their account via OAuth, then can send an envelope to a user based on a template. However, the send fails with a 400 response.
I am making two requests - one POST to create an envelope from a template (which receives a 201 response), and one PUT against the new envelope to send it with some tab data populated. However, the send call fails with the following 400 response:
{
"errorCode": "ENVELOPE_HAS_DUPLICATE_RECIPIENTS",
"message": "The specified envelope has duplicate recipients."
}
The first call to create the envelope contains this body:
{
"eventNotification": {
"envelopeEvents": [
{
"envelopeEventStatusCode": "Completed"
}
],
"includeSenderAccountAsCustomField": "true",
"includeTimeZone": "true",
"loggingEnabled": "true",
"requireAcknowledgment": "true",
"url": "https://mywebsite.com/webhook/receive/docusign"
},
"templateId": "a65ae540-16eb-4078-aab9-2dff5c2eda25",
"templateRoles": [
{
"email": "me#example.org",
"name": "My Name",
"roleName": "Employee"
}
]
}
And the second (failing) call contains this body:
{
"recipients": {
"signers": [
{
"email": "me#example.org",
"name": "My Name",
"recipientId": "92174826",
"tabs": {
"fullnameTabs": [
{
"documentId": "1",
"pageNumber": "1",
"tabId": "eb0c7a2d-5912-4cf1-8e2b-fd17fd7fb63c",
"value": "My Name"
},
{
"documentId": "1",
"pageNumber": "3",
"tabId": "92fb908c-6f84-472a-aa9d-baaa29758c12",
"value": "My Name"
}
]
}
}
]
},
"status": "sent"
}
Some values (names, emails etc) have been changed for privacy. The template contains a single recipient - Employee.
What am I doing wrong?
add a "routingOrder" property with a different number.
You cannot have two recipients with the same email/name and the same routing order.

Docusign webhooks listener not receiving event notification

We have a soap URL which receives webhooks from docusign as per configured status. It was sending webhooks but all of sudden it stopped receiving it. I have enablelogging turned is set to true and checked in admin connect tab and nothing in logs or failure as well. We used to get logs there before. We have a demo account.
Nothing has been changed in our code. Can anyone please suggest what could have cause this issue and how to resolve it
Regards,
Dishant
following request data sent to docusign restapi
{
"documents": [
{
"documentBase64": "<Base64BytesHere>",
"documentId": "1",
"fileExtension": "pdf",
"name": "00098O01.pdf"
}
],
"emailSubject": "Test",
"eventNotification": {
"envelopeEvents": [
{
"envelopeEventStatusCode": "Sent",
"includeDocuments": "false"
},
{
"envelopeEventStatusCode": "completed",
"includeDocuments": "true"
}
],
"includeTimeZone": "true",
"loggingEnabled": "true",
"recipientEvents": [
{
"includeDocuments": "false",
"recipientEventStatusCode": "Sent"
},
{
"includeDocuments": "false",
"recipientEventStatusCode": "Delivered"
}
],
"soapNameSpace": "xxxxx",
"url": "xxxx",
"useSoapInterface": "true"
},
"recipients": {
"signers": [
{
"email": "dishant.arora#caseflowacumen.com",
"name": "Dishant Arora",
"recipientId": "1",
"tabs": {
"signHereTabs": [
{
"documentId": "1",
"pageNumber": "1",
"tabLabel": "Sign Here",
"xPosition": "100",
"yPosition": "500"
}
]
}
}
]
},
"status": "sent"
}

Docusign emails seem to always have the same subject

This is thru the Docusign api. Here is the envelope definition:
{
"eventNotification": {
"requireAcknowledgment": "true",
"envelopeEvents": [
{
"envelopeEventStatusCode": "Delivered"
},
{
"envelopeEventStatusCode": "Completed"
},
{
"envelopeEventStatusCode": "Declined"
},
{
"envelopeEventStatusCode": "Voided"
},
{
"envelopeEventStatusCode": "Sent"
}
],
"useSoapInterface": "false",
"includeCertificateWithSoap": "false",
"signMessageWithX509Cert": "false",
"includeDocuments": "false",
"includeEnvelopeVoidReason": "false",
"includeTimeZone": "true",
"includeSenderAccountAsCustomField": "true",
"includeDocumentFields": "true",
"includeCertificateOfCompletion": "false"
},
"compositeTemplates": [
{
"serverTemplates": [
{
"sequence": "1",
"templateId": "c110d14a-3690-4ed1-921d-a7bef9524ed6"
}
],
"inlineTemplates": [
{
"sequence": "2",
"recipients": {
"signers": [
{
"name": "Kathy Lori",
"email": "kathylori#xxx.com",
"recipientId": "1",
"accessCode": "12345",
"customFields": [],
"routingOrder": "1",
"note": "",
"roleName": "##Buyer1"
}
],
"certifiedDeliveries": []
},
"customFields": {
"textCustomFields": [
{
"name": "EnvelopeInfo",
"value": "my data"
}
]
}
}
],
"document": {
"documentId": "1",
"name": "c:\three of the test.docx",
"fileExtension": ".docx",
"documentFields": [],
"documentBase64": [bytearray]
}
}
],
"status": "sent",
"emailSubject": "This is the new subject"
}
The subject still shows as "Please DocuSign: sign this". I would have thought setting the subject would have addressed this, but I must be missing something.
You have most likely configured per recipient email subject in your server template. In such a case the emailSubject that is specified at the root level of the postEnvelope request is ignored.
You can confirm that by making a getTemplates call using your server template Id. It will look something like below. Look specifically for recipients.signers.emailNotification property. I have removed some of the properties for simplicity.
{
"envelopeTemplateDefinition": {
"templateId": "xxxxxxxx-xxxx-xxxx-xxxx-e672c4efd436",
},
"documents": [ ],
"emailSubject": "This is the subject on the server template.",
"emailBlurb": "",
"recipients": {
"signers": [
{
"tabs": {},
"roleName": "RoleOne",
"emailNotification": {
"emailSubject": "Please DocuSign: sign this",
"emailBody": "",
"supportedLanguage": "en"
},
}
]
}
}
To override the per recipient email subject specified in the server template, specify the emailNotification property in the inlineTemplate.
{
"compositeTemplates": [
{
"serverTemplates": [
{
"sequence": "1",
"templateId": "c110d14a-3690-4ed1-921d-a7bef9524ed6"
}
],
"inlineTemplates": [
{
"sequence": "2",
"recipients": {
"signers": [
{
"name": "Kathy Lori",
"email": "kathylori#xxx.com",
"recipientId": "1",
"accessCode": "12345"
"routingOrder": "1",
"roleName": "##Buyer1",
"emailNotification": {
"emailSubject": "This is email subject to Buyer1",
"emailBody": "",
"supportedLanguage": "en"
},
}
],
}
}
],
"document": { }
}
],
"status": "sent",
}

DocuSign REST API v2 returning error ONESIGNALLSIGN_NOT_SATISFIED

I am having an issue with the DocuSign REST api (v2) attempting to create an envelope from a set of server templates (template stored with DS). I connect with DS and they accept my JSON, however, I get an error message back:
ONESIGNALLSIGN_NOT_SATISFIED => Freeform signing is not allowed for your account because it conflicts with other settings, please place signing tabs for each signer.
I cannot figure out what the message is actually referring too. I am in fact NOT including tabs for each signer in the JSON request, just the signer information and roleName. This is very similar to the way we are generating envelopes with the SOAP api successfully (aka, we are not including tab information with the signer information for each document).
I based my JSON on this example:
https://github.com/Ergin008/DocuSign-REST-API-Webinar-April2013/blob/master/example3.json
I have done some extensive searching and reading on this problem, and have tried many different ways for structuring the request JSON per examples I have found, but it seems that this error is blocking any forward progress. The only other place I could find a reference to another person struggling with this error was here:
Docusign signing url - Showing document 1 of a composite template
I tried to use some of that information to work out the kink to no avail. I am not completely sure what they are referencing with "Document Visability" etc... This could be my problem...
Any help that could be provided is greatly appreciated! Thank you!
JSON:
{
"status": "sent",
"emailSubject": "Testing DocuSign REST",
"emailBlurb": "",
"compositeTemplates": [
{
"serverTemplates": [
{
"sequence": 1,
"templateId": "9F712D11-2524-433F-98F0-D3ADCC041B42"
}
],
"inlineTemplates": [
{
"sequence": 1,
"recipients": {
"signers": [
{
"recipientId": "28214",
"clientUserId": "28214",
"email": “test1#yahoo.com",
"name": "COLBY",
"roleName": "BORROWER1",
"requireIDLookup": false
},
{
"recipientId": "13020",
"clientUserId": "13020",
"email": “test2#YAHOO.COM",
"name": “CHEESE”,
"roleName": "BORROWER3",
"requireIDLookup": false
}
]
},
"customFields": {
"textCustomFields": [
{
"name": "PDF_CLIENT",
"value": "108"
}
]
}
}
]
},
{
"serverTemplates": [
{
"sequence": 2,
"templateId": "06E28E05-FF6F-4CD0-962A-7EBF3EE78BC5"
}
],
"inlineTemplates": [
{
"sequence": 2,
"recipients": {
"signers": [
{
"recipientId": "28214",
"clientUserId": "28214",
"email": “test1#yahoo.com",
"name": "COLBY",
"roleName": "BORROWER1",
"requireIDLookup": false
},
{
"recipientId": "13020",
"clientUserId": "13020",
"email": “test2#YAHOO.COM",
"name": “CHEESE”,
"roleName": "BORROWER3",
"requireIDLookup": false
}
]
},
"customFields": {
"textCustomFields": [
{
"name": "PDF_CLIENT",
"value": "108"
}
]
}
}
]
},
{
"serverTemplates": [
{
"sequence": 3,
"templateId": "B702BFAD-DE2C-411E-A7EF-EA1E12805341"
}
],
"inlineTemplates": [
{
"sequence": 3,
"recipients": {
"signers": [
{
"recipientId": "28214",
"clientUserId": "28214",
"email": “test1#yahoo.com",
"name": "COLBY",
"roleName": "BORROWER1",
"requireIDLookup": false
},
{
"recipientId": "13020",
"clientUserId": "13020",
"email": “test2#YAHOO.COM",
"name": “CHEESE”,
"roleName": "BORROWER3",
"requireIDLookup": false
}
]
},
"customFields": {
"textCustomFields": [
{
"name": "PDF_CLIENT",
"value": "108"
}
]
}
}
]
}
],
"eventNotification": {
"url": “oureventhandlingprogramurl”,
"loggingEnabled": true,
"envelopeEvents": [
{
"envelopeEventStatusCode": "Sent",
"includeDocuments": false
},
{
"envelopeEventStatusCode": "Delivered",
"includeDocuments": false
},
{
"envelopeEventStatusCode": "Completed",
"includeDocuments": false
},
{
"envelopeEventStatusCode": "Declined",
"includeDocuments": false
},
{
"envelopeEventStatusCode": "Voided",
"includeDocuments": false
}
]
}
}
And the response
{
"errorCode": "ONESIGNALLSIGN_NOT_SATISFIED",
"message": "Freeform signing is not allowed for your account because it conflicts with other settings, please place signing tabs for each signer."
}
After some research, we found the issue in the DocuSign admin panel settings.
"Document Visibility" is one of the settings (its a dropdown) and setting it to "off" got us past the issue.
Hope this helps someone in the future!
In my case, I had two signers for a template but one of the signers didnt have any associated data tabs. After assigning data tabs to both signers, that fixed the above issue for us, and we were able to leave "Document Visibility" turned on.

Get recipient view not working for composite envelope

I want to create a composite envelope and then do an embedded signing. The issue is that the envelope is created but the call to get the url fails.
First I create the composite envelope:
https://demo.docusign.net/restapi/v2/accounts/ACCOUNT/envelopes
{
"emailSubject": "DocuSign API - Composite Templates",
"emailBlurb": "Composite Templates Sample 1",
"status": "sent",
"compositeTemplates": [
{
"serverTemplates": [
{
"sequence": "1",
"templateId": "1AA7BA0B-9079-4F8C-915B-739576297D62"
}
],
"inlineTemplates": [
{
"sequence": "1",
"recipients": {
"signers": [
{
"email": "email#email.com",
"name": "Signer Name",
"recipientId": "1",
"roleName": "Account Holder"
}
]
}
}
]
},
{
"serverTemplates": [
{
"sequence": "2",
"templateId": "77343ECC-391F-46A1-BFC3-92A3CD8C93E3"
}
],
"inlineTemplates": [
{
"sequence": "2",
"recipients": {
"signers": [
{
"email": "email#email.com",
"name": "Signer Name",
"recipientId": "1",
"roleName": "Account Holder",
"tabs": {
"textTabs": [
{
"tabLabel": "AccountFirstName",
"value": "Client"
},
{
"tabLabel": "AccountLastName",
"value": "Name"
},
{
"tabLabel": "Email1",
"value": "someEmail#email.com"
}
]
}
}
]
}
}
]
},
{
"serverTemplates": [
{
"sequence": "3",
"templateId": "ADADDD87-E831-4EF3-A160-BBE73F449C8E"
}
],
"inlineTemplates": [
{
"sequence": "3",
"recipients": {
"signers": [
{
"email": "email#email.com",
"name": "Signer Name",
"recipientId": "1",
"roleName": "Account Holder"
}
]
}
}
]
}
]
}
The response is:
{
"envelopeId": "99f4c73d-6420-4e3b-88eb-2447139a2616",
"uri": "/envelopes/99f4c73d-6420-4e3b-88eb-2447139a2616",
"statusDateTime": "2014-08-14T21:09:09.0430000Z",
"status": "sent" }
Next I try to get the recipient view
https://demo.docusign.net/restapi/v2/accounts/ACCOUNT/envelopes/99f4c73d-6420-4e3b-88eb-2447139a2616/views/recipient
{
"authenticationMethod": "email",
"email": "email#email.com",
"returnUrl": "www.someUrl.com",
"userName": "Signer Name"
}
And I get this error:
{
"errorCode": "UNKNOWN_ENVELOPE_RECIPIENT",
"message": "The recipient you have identified is not a valid recipient of the specified envelope. Envelope recipient could not be determined. 'clientUserId', 'email', or 'userName' in request and envelope may not match."
}
The email and the names match up so I do not understand why I am unable to get the url. I should point out that this all works if I use the same name and email that is on the DocuSign account, but this needs to work for an external recipient.
To designate a recipient as an embedded/captive recipient when creating an Envelope, such that you'll subsequently be able to submit a "Get Recipient View" request to retrieve a URL that can be used to initiate the recipient's signing session, your "Create Envelope" request must specify the clientUserId property for the recipient. This property should appear as a peer to the other recipient properties (i.e.: email, name, etc.) -- like this:
"signers": [
{
"email": "email#email.com",
"name": "Signer Name",
"recipientId": "1",
"roleName": "Account Holder",
"clientUserId": "12345"
}
]
Then, when you submit the "Get Recipient View" request, you'll need to specify the same value for clientUserId there:
POST https://{{env}}.docusign.net/restapi/{{version}}/accounts/{{acctId}}/envelopes/ENVELOPE_ID/views/recipient
{
"authenticationMethod": "Email",
"email": "email#email.com",
"returnUrl": "www.someUrl.com",
"userName": "Signer Name",
"clientUserId": "12345"
}
The value of clientUserId can be anything you wish, but max length is 100 characters. See the DocuSign REST API Guide for more details about embedded signing.

Resources