I am creating an envelope from a template and then getting the URL for the recipient view.
During my request DocuSign sends an email to the recipient and that is merged and ready to sign but the signing url goes to an unmerged version of the document that cannot be signed.
I dont really want the email sent, I just want to redirect the customer straight into the signing session.
What am I missing here?
ENVELOPE CREATION REQUEST:
{
"emailSubject": "Agreement",
"templateId": "xxx",
"templateRoles": [
{
"email": "johndoe#inter.net",
"name": "john doe",
"roleName": "Customer",
"tabs": {
"textTabs": [
{
"tabLabel": "Name",
"value": "john doe"
},
{
"tabLabel": "Date",
"value": "1/18/2019"
}
]
}
}
],
"status": "sent"
}
RESPONSE:
{
"envelopeId": "yyy",
"uri": "/envelopes/yyy",
"statusDateTime": "2019-01-18T19:45:04.2870000Z",
"status": "sent"
}
RECIPIENT VIEW REQUEST:
{
"userName": "john doe",
"email": "johndoe#inter.net",
"recipientId": "1",
"authenticationMethod": "email",
"returnUrl": "http://www.inter.net/docusign.asp?Status=complete"
}
RESPONSE:
{
"url": "https://demo.docusign.net/Signing/StartInSession.aspx?t=zzzz"
}
To indicate that you want to use an embedded signing ceremony for the template role, add the clientUserId attribute to the templateRole object.
Example of doing this: line 203 of the Number 17 example workflow (for PHP). This example workflow is also available for Node.js.
For a general example of using embedded signing, see example workflow 1 of the eg-03 series of example launchers--see the list of repositories at the bottom of the page.
Related
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"
}
I need some help to identify how to send Document Custom Fields' values at the stage of creating an envelope. Below is the workflow:
Create the Document Custom Fields (account specific) with name, type and initial value through API (POST [BaseURI]/tab_definitions)
Create a template with document through API and place the required Document Custom Fields in the document through DocuSign UI
Create an envelope and send specific values for the Document Custom Fields through API (POST [BaseURI]/envelopes)
Creating an envelope is working fine referring (https://developers.docusign.com/esign-rest-api/reference/Envelopes/Envelopes/create). I have tried sending the values through:
document -> documentFields
customFields -> textCustomFields
{
"templateId": "51234567-1244-1234-1234-12345a857203",
"templateRoles": [
{
"roleName": "Role1",
"name": "Jane Doe",
"email": "jane#doe.com"
},
{
"roleName": "Role2",
"name": "John Doe",
"email": "john#doe.com"
}
],
"customFields": {
"textCustomFields": [
{
"name": "Account.Name",
"value": "account-name1234"
},
{
"name": "Candidate.FullName",
"value": "candidate-name1234"
},
{
"name": "Candidate.Mobile",
"value": "0412345678"
}
]
},
"status": "sent"
}
The CustomFields parameter is for Envelope Custom Fields. If you want to define tag values for a recipient, the tag parameters should be nested under the TemplateRole. You'll also want to use the tabLabel parameter to identify tabs instead of the name. Finally, make sure your Role Names and TabLabels match exactly between your template and your API call. Try this:
{
"templateId": "51234567-1244-1234-1234-12345a857203",
"templateRoles": [
{
"roleName": "Role1",
"name": "Jane Doe",
"email": "jane#doe.com"
"tabs": {
"TextTabs": [
{
"tabLabel": "Account.Number",
"value": "00000000"
},
{
"tabLabel": "Account.Name",
"value":"ExampleAccount"
}
],
},
{
"roleName": "Role2",
"name": "John Doe",
"email": "john#doe.com"
}
],
"status": "sent"
}
Finally, you may want to consider using a Composite Template instead of the basic Envelope Creation call. Details as to why are available here: https://www.docusign.com/blog/dsdev-why-use-composite-templates/
i am able to create an envelope with the DocuSign api. according to the documentation there is the attribute to specify the folderid in which you want to put the envelope. i have tried many things and the envelope never goes to the specified folder it only goes to the sent folder. how do we make sure the envelope is created in the specified folder id? there seems to be no sample code / syntax on how to do this via the documentation.
i've tried folder.folderId and folder[0].folderId and folders[0].folderId
[
{
"emailSubject": "This request is sent from a Template",
"emailBlurb": "Please sign...thanks!",
"templateId": "hidden",
"envelopeIdStamping": "false",
"templateRoles": [
{
"roleName": "Signer 1",
"name": "Matt",
"email": "email#email.com",
"recipientId": "1",
"tabs": {
"textTabs": [
{
"tabLabel": "dateField",
"value": "July 19, 2019"
}
]
}
}
],
"folders": [
{
"folderId": "folderIDhere"
}
],
"status": "sent"
}
]
no errors at all it just doesnt save in the folder
I'm not sure that you can create an envelope directly into a folder. I believe you'll need to take the Envelope ID you get in response to the Envelope Creation call, then plug it in to a Folders::MoveEnvelopes call like so:
PUT /v2.1/accounts/{accountId}/folders/{folderId}
{
"envelopeIds": [
"{envelope_id}"
],
}
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"
}
]
}
}
]
}
]}
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.