I have an embedded signing application where users going through a web interview have to sign certain documents at the end. The documents are generic templates, currently defined with the user name and email address left blank. I am providing the user name, email address and a clientUserId in the envelope creation, matching the role that is defined in the template. But I keep getting the error UNKNOWN_ENVELOPE_RECIPIENT - The recipient you have identified is not a valid recipient of the specified envelope. What constitutes a "valid recipient" of a generic template? Am I supposed put something in the user and email fields of the template? I'm confused.
In answer to Larry K below, that appears to be exactly what I have done. Here's the JSON for the create envelope request that results in the error:
{
"accountId":"1234567",
"emailSubject":"Certification Documents",
"status":"sent",
"compositeTemplates":[
{
"serverTemplates":[
{
"sequence":"1",
"templateId":"5ed3d600-5a57-4fee-931f-53233858dc65"
}
],
"inlineTemplates":[
{
"sequence":"1",
"recipients":{
"signers":[
{
"name":"John Doe",
"roleName":"Applicant",
"recipientId":"1",
"clientUserId":"62",
"email":"jd#mydomain.com",
"tabs":{
"textTabs":[
{
"tabLabel":"EmplName",
"value":"John Doe"
},{
"tabLabel":"SSN",
"value":"123456789"
},{
"tabLabel":"DoB",
"value":"08\/26\/1991"
}
]
}
}
]
}
}
]
}
]
}
Here is the Get Recipients response:
{
"signers": [
{
"isBulkRecipient": "false",
"name": "",
"email": "",
"recipientId": "63543029",
"recipientIdGuid": "29a731f6-2f82-490f-9589-f551727414d9",
"requireIdLookup": "false",
"smsAuthentication": {},
"routingOrder": "1",
"note": "",
"roleName": "Applicant",
"status": "created",
"declinedReason": "",
"deliveryMethod": "email",
"templateLocked": "false",
"templateRequired": "false"
}
],
"agents": [],
"editors": [],
"intermediaries": [],
"carbonCopies": [
{
"name": "Real Person",
"email": "rp#mydomain.com",
"recipientId": "83856197",
"recipientIdGuid":
"0f80a5ab-2050-472a-b072-7a18794a4726",
"requireIdLookup": "false",
"smsAuthentication": {},
"routingOrder": "1",
"note": "",
"roleName": "Mancon",
"status": "created",
"declinedReason": ""
}
],
"certifiedDeliveries": [],
"inPersonSigners": [],
"recipientCount": "2"
}
I've got it. Too many iterations of messing with code, mixing live code with debug stuff. It looked like the error was coming from the envelope creation because I had stepped on a debug message. But in fact the code was going through to the signing view request, which actually was generating the error. And there, as you might guess, was a debug clientUserId, which did not match the envelope. I hate it! Thanks for the coaching. It eventually led me to the real problem.
To troubleshoot, I'd suggest executing a Get Template Recipients request for the Template you're using (GET /v2/accounts/{accountId}/templates/{templateId}/recipients), then compare the contents of that response with the recipients portion of your Create Envelope From Template request that's resulting in the error UNKNOWN_ENVELOPE_RECIPIENT. If you can't spot a difference, feel free to update your post (question above) with the trace of your original Create Envelope request as well as the response from Get Template Recipients (removing any sensitive info, of course), and perhaps someone here can spot the issue.
Another answer from a second DocuSign consultant:
He suggests that perhaps the reason you received the error was that you didn't use the exact same triplet of {recipient/signer name, email, client id} in both your call to Envelopes: create and to EnvelopeViews: createRecipient
The following should work:
Call to Envelopes: create:
{
"emailSubject":"My subject",
"emailBlurb":"My blurb",
"templateId":"My template id",
"templateRoles":[
{
"clientUserId":"123456789",
"roleName":"My role",
"name":"Name",
"email":"email"
}
],
"status":"sent"
}
Call to EnvelopeViews: createRecipient:
{
"authenticationMethod": "password",
"email": "email",
"returnUrl": "https://www.docusign.com",
"userName": "Name",
"clientUserId": "123456789"
}
A solution from one of our DocuSign consultants is below. He recommends compositing the recipient information with the template. Here's the json for the Envelopes: create call:
{
"emailSubject": "Create Envelope with embedded recipient",
"status": "sent",
"compositeTemplates": [
{
"serverTemplates": [
{
"sequence": "1",
"templateId": "{Template ID}"
}
],
"inlineTemplates": [
{
"sequence": "2",
"recipients": {
"signers": [
{
"clientUserId": "Unique Identifier",
"email": "signer1#example.com",
"name": "Signer One",
"recipientId": "1",
"roleName": "Customer"
}
]
}
}
]
}
]}
Related
How do I create a recipient with both email and SMS?
I've been unable to find example JSON that addresses this issue. The documentation on Docusign's website shows either email or SMS, not both together (that I can find, anyway). I found a note somewhere that suggested it's possible, but I can't find it again.
If your account has SMS Delivery enabled, you can make an API Request in the following format to send an envelope with Email + SMS Delivery
{
"documents": [
{
"documentBase64": "Base 64 here",
"documentId": 1,
"fileExtension": "txt",
"name": "Filename"
}
],
"emailSubject": "Blurb",
"recipients": {
"signers": [
{
"email": "Recipient Email Here",
"name": "DocuSigner",
"recipientId": "1",
"tabs": {
"signHereTabs": [
{
"xPosition": "10",
"yPosition": "10"
}
]
},
"additionalNotifications": [
{
"secondaryDeliveryMethod": "SMS",
"phoneNumber": {
"countryCode": "Code",
"number": "Phone number"
}
}
]
}
]
},
"status": "sent"
}
Using the following POST request and body to send an envelope (source https://developers.docusign.com/docs/esign-rest-api/how-to/request-signature-template-remote)
https://demo.docusign.net/restapi/v2.1/accounts/4f4xxxx-xxxxxx-xxxxxx/envelopes
{
"templateId": "dbexxxx-xxxxx-xxxxx",
"templateRoles": [
{
"email": "test#gmail.com",
"name": "John Doe",
"roleName": "signer1",
"tabs": {
"textTabs": [
{
"tabLabel": "cname",
"value": "name"
}
]
}
}
],
"status": "sent"
}
Is there a way to specify the email message, email subject and/or email language? I tried adding "emailSubject": "Please sign ..." next to "email" but cannot seem to make it work. It is a requirement that I need to manually make this post request so I cannot use the SDK.
Where you placing the "emailSubject" field exactly in your JSON?
You can specify the the email message and subject by specifying the following fields at the root level (where you "status" is defined):
{
"emailBlurb": "げりト画首ロ百照ょリっ毎現イタヱア掲全らいに",
"emailSubject": "Subject of agreement",
"templateId": "867a37*****",
"templateRoles": [
{
"email": "email#domain.com",
"name": "name_of_person",
"roleName": "Seller"
}
],
"status": "sent"
}
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.
I'm attempting to add a recipient to a draft envelope and althought the recipient does get added I receive an error message related to the notification. Could someone explain the USER_LACKS_RECIPIENTEMAILNOTIFICATION_PERMISSION error is exactly?
POST /restapi/v2/accounts/123456/envelopes/3a20bef6-0d88-431a-aaf1-e27baa9b59a6/recipients HTTP/1.1
{
"carbonCopies": [
{
"email": "my#emailaddress.com",
"name": "Mike",
"accessCode": "xyz",
"addAccessCodeToEmail": true,
"emailNotification": {
"emailBody": "Custom email message different than the envelope body",
"emailSubject": "Custom email subject",
"supportedLanguage": "en"
},
"inheritEmailNotificationChange": false,
"note": "Sample note",
"recipientId": "1",
"routingOrder": "1"
}
]
}
And here is the response that I receive back:
{
"signers": [],
"agents": [],
"editors": [],
"intermediaries": [],
"carbonCopies": [
{
"name": "Mike",
"email": "my#emailaddress.com",
"recipientId": "1",
"accessCode": "xyz",
"requireIdLookup": "false",
"routingOrder": "1",
"note": "Sample note",
"status": "error",
"emailNotification": {
"emailSubject": "Custom email subject",
"emailBody": "Custom email message different than the envelope body",
"supportedLanguage": "en"
},
"errorDetails": {
"errorCode": "USER_LACKS_RECIPIENTEMAILNOTIFICATION_PERMISSION",
"message": "Account or user does not have permission to set recipient email notifications."
}
}
],
"certifiedDeliveries": [],
"inPersonSigners": [],
"recipientCount": "1"
}
The only permission setting that I can see might pertain to this is the following, but I can not change it's value.
The answer to get around this issue is to not supply the ""supportedLanguage" property for the recipient. This is a feature that will need to be turned on for your sending user in order to use it.
Check the "Reminders & Expirations" section to make sure you don't have the "Do NOT allow users to override these settings" setting checked?
I am facing issue while trying to enable "ID Check $" through docusign Rest API.
I could see there were lot of work arounds provided. Still following I am not successful.
It would be great if someone can comment if the issue with KBA is still there or any sample code for REST JSON would be greatly appreciated.
Due to this I am thinking of TWO templates one with KBA enabled and other without. So I can take a decision to use the template based on my business rule
Appreciate your time
The following way of creating the envelope did not result in KBA to the signer
{
"accountId": "YYY",
"templateId":"ZZZ",
"status": "SENT",
"templateRoles": [
{
"name": "AAA",
"roleName": "CCC",
"email": "test#test.com",
"tabs": {
"textTabs": [],
"checkBoxTabs": [],
"emailTabs": [],
"dateTabs": [],
}
},
{
"name": "BBB",
"roleName": "DDD",
"email": "example#example.com",
"accessCode": "A380",
"requireIdLookup": "true",
"idCheckConfigurationName": "ID Check $",
"tabs": {
"textTabs": [],
"checkBoxTabs": [],
"emailTabs": [],
"dateTabs": []
}
}
]
}
If you're creating an Envelope using a DocuSign Template, and want to sometimes require ID Check authentication and other times not, the way you can accomplish this is to use Composite Templates in your Create Envelope API call.
In your template (i.e., via the DocuSign UI), don't select any form of advanced recipient authentication (i.e., simply set Identify = "Email").
Then, to create an envelope using the template via the API, and specify ID Check as the recipient authentication method, the Create Envelope request would look like this:
POST https://{{env}}.docusign.net/restapi/{{version}}/accounts/{{acctId}}/envelopes
{
"emailSubject": "Please sign",
"emailBlurb": "Please sign...thanks!",
"status": "sent",
"compositeTemplates": [
{
"serverTemplates": [
{
"sequence": 1,
"templateId": "YOUR_TEMPLATE_ID"
}
],
"inlineTemplates": [
{
"sequence": 2,
"recipients": {
"signers": [
{
"email": "sallysemail#test.com",
"name": "Sally Adamson",
"recipientId": "1",
"roleName": "Signer1",
"requireIdLookup": "true",
"idCheckConfigurationName": "ID Check $"
}
]
}
}
]
}
]
}
The request for creating an envelope (using the same template) that does NOT require any advanced form of recipient authentication would look identical to the request above -- except that it would NOT include the requireIdLookup property or the idCheckConfigurationName property.