I am embedding the signing of a set of documents in a web application. Ultimately, the documents will be filled in with answers provided during an online interview. Three or four documents are needed in the envelope. The documents are server-based templates. In the template definitions I have left the name and email fields blank for the Applicant role (signer), as they are generic templates that will be used by many applicants.
In a test scenario, I can load a single template in an envelope and carry it through the process, but when I convert to a composite template, I get the error "errorCode": "RECIPIENTS_NOT_PROVIDED", "message": "No recipients were found in the request." from the envelope request. I have compared the code to many examples and haven't been able to see anything different. There has to be something basic that I'm missing--not surprising, as this is my first attempt with the DocuSign API. Can someone please enlighten me?
The failing code:
{
"accountId":"xxxxxxx",
"emailSubject":"WOTC Certification Documents - Test Dummy",
"emailBlurb":"Documentation to be submitted by Consultant",
"status":"sent",
"compositTemplates":{
"serverTemplates":[{
"sequence":"1",
"templateId":"ca18aba4-49bd-4c28-9dce-fbd2dd3fbb7b",
"recipients":{
"signers":{
"name":"Test Dummy",
"roleName":"Applicant",
"recipientId":"1",
"clientUserId":"Dummy1234",
"email":"dummy#mydomain.com"
}
}
},{
"sequence":"2",
"templateId":"5ed3d600-5a57-4fee-931f-53233858dc65",
"recipients":{
"signers":{
"name":"Test Dummy",
"roleName":"Applicant",
"clientUserId":"Dummy1234",
"email":"dummy#mydomain.com"
}
}
}]
}
}
Thank you.
You're on the right track, but I'd suggest you make the following changes to the JSON that you've posted:
"compositTemplates" is missing an "e" -- should be compositeTemplates
compositeTemplates needs to be an Array of objects
each object within the compositeTemplates Array needs to contain a serverTemplates property (an Array that specifies the template info) and an inlineTemplates property (an Array that specifies the recipient info)
within each recipients object, signers needs to be an Array of objects
each signer object needs a recipientId property
Here's your JSON again, modified to implement the changes I've listed above:
{
"accountId":"xxxxxxx",
"emailSubject":"WOTC Certification Documents - Test Dummy",
"emailBlurb":"Documentation to be submitted by Consultant",
"status":"sent",
"compositeTemplates":[
{
"serverTemplates":[
{
"sequence":"1",
"templateId":"ca18aba4-49bd-4c28-9dce-fbd2dd3fbb7b"
}],
"inlineTemplates":[
{
"sequence" : 2,
"recipients":{
"signers":[{
"name":"Test Dummy",
"roleName":"Applicant",
"recipientId":"1",
"clientUserId":"Dummy1234",
"email":"dummy#mydomain.com"
}]
}
}],
},
{
"serverTemplates":[
{
"sequence" : 3,
"templateId":"5ed3d600-5a57-4fee-931f-53233858dc65"
}],
"inlineTemplates":[
{
"sequence" : 4,
"recipients": {
"signers" : [{
"name":"Test Dummy",
"roleName":"Applicant",
"recipientId": "1",
"clientUserId":"Dummy1234",
"email":"dummy#mydomain.com"
}]
}
}]
}]
}
Related
I am trying to add the new witness functionality to my API call. Heres the json that I am sending now:
POST https://demo.docusign.net/restapi/v2/accounts/[my id]/envelopes
{
"emailSubject":"test",
"status":"sent",
"templateId":"[Valid template id]",
"templateRoles":[
{
"roleName":"sign1",
"email":"valid#email.com",
"name":"John",
"recipientId":"1",
"routingOrder":"1",
"tabs":{}
},
{
"roleName":"Witness for sign1",
"witnessFor":"sign1",
"witnessForGuid":"1",
"recipientId":"2",
"routingOrder":"2",
"recipientType":"witness"
}
]
}
I have configured the template in DocuSign and verified the functionality by sending an envelope via the DocuSign website. However, the envelopes created from my API call does not trigger the witness functionality. I am not sure what I am missing, and I really appreciate any help/feedbacks.
Cheers
Here is a successful Envelopes::create call that includes the witness recipient type:
"recipients": {
"witnesses": [
{
"name": "Witness Name",
"email": "witness#example.com",
"recipientId": "2",
"witnessFor": "1"
}
],
"signers": [
{
"email": "someone#example.com",
"name": "Signer name",
"recipientId": "1",
"clientUserId": "1000",
"tabs": {
"signHereTabs": [
{
"anchorString": "/sig1/",
"anchorXOffset": "20",
"anchorUnits": "pixels"
}
]
}
}
]
},
Suggested changes in your templateRoles attributes:
(Not tested)
I'm assuming that you have a witness role set in the template.
If you don't, then I think you'll need to add the additional witness recipient to the envelope via composite templates.
You can also try your idea of including "recipientType":"witness"
At the API level, the witness is a distinct recipient for the envelope. It could also the case that the DocuSign web tool creates a hidden recipient (and recipient role) for the witness. To determine if this is the case, use API logging to see what the DocuSign web tool is actually doing.
"templateRoles":[
{
"roleName":"sign1",
"email":"valid#email.com",
"name":"John",
"recipientId":"1",
"routingOrder":"1",
"tabs":{}
},
{
"roleName":"Witness for sign1",
"witnessFor":"1",
OMIT THIS: "witnessForGuid":"1",
"recipientId":"2",
OMIT THIS: "routingOrder":"2",
OMIT THIS: "recipientType":"witness"
}
]
Note
Older developer sandbox accounts don't include the witness feature. If you receive the error message of not having the witness feature, contact go-live --at-- docusign.com to have the feature added to your developer account.
Turns out to be a bug in DocuSign, I had to split the creation step into 2.
1st POST /envelopes:
{
"emailSubject":"Template Action Test",
"status":"created",
"templateId":"866fcb03-1342-4678-9dc3-107772c59e89",
"templateRoles":[
{"roleName":"sign1","email":"email#test.com","name":"JK","tabs":{}}
]
}
2nd PUT /envelopes/envelope-id:
{
"status":"sent"
}
Is it possible to create a Docusign envelope without giving a name for the signer?
Here is the sample envelope definition from the REST docs
{
"status":"sent",
"emailSubject":"Example of one recipient, type signer",
"documents":[
{
"documentId":"1",
"name":"contract.pdf",
"documentBase64":"base64 document bytes..."
}
],
"recipients":{
"signers":[
{
"name":"Lisa Simpson",
"email":"lisa#email.com",
"recipientId":"1",
"routingOrder":"1",
"tabs":{
"signHereTabs":[
{
"xPosition":"150",
"yPosition":"200",
"documentId":"1",
"pageNumber":"1"
}]
}
}]
}
}
`
Instead of "Lisa Simpson" I want to have a blank string "" to withhold the persons name. Is this allowed? When I try I get back this error INVALID_USERNAME_FOR_RECIPIENT but am wondering if there is a workaround.
Thanks
No. Signers need to have names defined.
An exception to this is if you are using a 'specify recipients' role prior to the signer. In this case, you can have a blank placeholder signer, but the Specify user will be required to enter both a name and email for the signer.
What is your use case for a signer without a name?
I am currently using the REST api to create an envelope containing a document and a template which I have already set up in Docusign. I get the following error on the web request and can't find this error on the status code/error list provided by DocuSign to try debug the issue. Their support person suggests I ask here..
TAB_REFERS_TO_DOCUMENT_NO_TABS_ALLOWED -- The Tab refers to a document that does not allow tabs.
Has anyone experienced this?
Edit:
The issue appears to be related to the document section.
{
"emailBlurb":"Test Email Body",
"emailSubject": "Test Email Subject",
"status" : "sent",
"compositeTemplates": [
{
"serverTemplates": [
{
"sequence" : 1,
"templateId": "b1eccee3-9c00-4cb2-8d30-0400d51dcfe0"
}],
"inlineTemplates": [
{
"sequence" : 2,
"recipients": {
"signers" : [{
"email": "usera#bah.com",
"name": "usera",
"recipientId": "1",
"roleName": "Producer"
}]
}
}],
"document": {
"documentId": 1,
"name": "Test.docx",
"documentBase64":"[bytesremoved]",
"fileExtension":"docx"
}
}]
}
So you have a template on the server, with a document as part of the template?
But you want the envelope to use a different document with the template, yes?
It is my understanding that the documentId in the document section of the composite template must match the documentId used in the template if you want the document to be substituted for the template's document.
So check the definition of the template. Did you create the template programmatically or did you use the web browser DocuSign app? If the latter, then note that the first document in a template is not always given an id of 1.
I'm currently using the rest api (.../v2/accounts/someId/envelopes) to request a users document. My app currently requests a document that has a corresponding template, with most of the data on that pre-filled using the templateRoles key. When users are prompted for an ID Check they are again asked information that we already have (name, address ect). We would like to have this information pre-filled.
I have looked through the documentation but none of the examples for idCheckInformationInput use templateRoles. Ideally we would not have to change the structure of the current api call since it is quite mature and well tested. I have tried adding the idCheckInformationInput key, but the ID Check is still returned blank.
Our current call is:
.../v2/accounts/someId/envelopes
data => {
"allowMarkup":false,
"allowReassign":false,
"allowRecipientRecursion":false,
"asynchronous":false,
"authoritativeCopy":false,
"autoNavigation":false,
"brandId":"xxxx",
"compositeTemplates":null,
"customFields":null,
"emailBlurb":"",
"emailSubject":"Secure Authorization Document",
"enableWetSign":false,
"enforceSignerVisibility":false,
"envelopeIdStamping":false,
"eventNotification":{
"envelopeEvents":[
{
"envelopeEventStatusCode":"completed",
"includeDocuments":false
},
{
"envelopeEventStatusCode":"declined",
"includeDocuments":false
},
{
"envelopeEventStatusCode":"voided",
"includeDocuments":false
}
],
"loggingEnabled":true,
"includeCertificateWithSoap":false,
"includeDocuments":false,
"includeTimeZone":false,
"includeSenderAccountAsCustomField":false,
"recipientEvents":[
],
"requireAcknowledgment":true,
"signMessageWithX509Cert":false,
"soapNameSpace":"",
"url":"xxxx/external/signing/eventnotification",
"useSoapInterface":false
},
"signingLocation":"Online",
"status":"sent",
"templateId":"xxxx",
"templateRoles":[
{
"accessCode":null,
"clientUserId":"xxxx",
"email":"xxxx#xxxx.com",
"emailNotification":null,
"name":"a a a",
"recipientId":"1",
"roleName":"Client",
"tabs":{
"checkboxTabs":[
{
"name":"Checkbox",
"selected":false,
"tabLabel":"ExchangeEtcEmployed"
},{...}
],
"radioGroupTabs":[
],
"textTabs":[
{
"name":"Text",
"tabLabel":"\\*DOB",
"value":"1/1/1980"
}, {...}
]
},
"idCheckConfigurationName": "ID Check $",
"idCheckInformationInput":{ //new key possibly in the wrong spot
"addressInformationInput":{
"addressInformation":{
"street1":"aaa",
"street2":"",
"city":"San Francisco",
"state":"CA",
"zip":"94102"
},
"displayLevelCode":"Editable"
},
"dobInformationInput":{
"dateOfBirth":"1/1/1980",
"displayLevelCode":"Editable"
},
"ssn4InformationInput":{
"ssn4":"4444",
"displayLevelCode":"Editable"
}
}
}
]
}
I've also noticed that if I add requireIdLookup: true, and turn off the flag on docusign's side (manage -> template -> roles -> Identify -> Identity Check = ID Check $) no ID check shows up. The only way to get it to show up is to check that, and it is always returned empty.
EDIT:
I have more recently tried to use the format specified here but with the same results as before:
{
"allowMarkup":false,
"allowReassign":false,
"allowRecipientRecursion":false,
"asynchronous":false,
"authoritativeCopy":false,
"autoNavigation":false,
"brandId":"xxxx",
"compositeTemplates":[
{
"inlineTemplates":[
{
"sequence":"1",
"recipients":{
"signers":[
{
"accessCode":null,
"clientUserId":"xxxx",
"email":"xxx#xxx.com",
"emailNotification":null,
"name":"a a a",
"recipientId":"1",
"roleName":"Client",
"tabs":{
"checkboxTabs":[...],
"radioGroupTabs":[...],
"textTabs":[...]
},
"idCheckInformationInput":{
"addressInformationInput":{
"addressInformation":{
"street1":"aaa",
"street2":"",
"city":"San Francisco",
"state":"CA",
"zip":"94105"
},
"displayLevelCode":"Editable"
},
"dobInformationInput":{
"dateOfBirth":"1/1/1980",
"displayLevelCode":"Editable"
},
"ssn4InformationInput":{
"ssn4":"xxxx",
"displayLevelCode":"Editable"
}
},
"requireIdLookup":true,
"idCheckConfigurationName":"ID Check $"
}
]
}
}
],
"serverTemplates":[
{
"sequence":"1",
"templateId":"xxx"
}
]
}
],
"customFields":null,
"emailBlurb":"",
"emailSubject":"Secure Authorization Document",
"enableWetSign":false,
"enforceSignerVisibility":false,
"envelopeIdStamping":false,
"eventNotification":{...},
"signingLocation":"Online",
"status":"sent",
"templateId":null,
"templateRoles":null
}
Edit2:
I was able to get it to work-ish with the compositeTemplates format, although I had to remove the roleName. With the roleName set to "Client" it strictly follows what is defined in the Roles section of the template for "Client" (recipients and routing modal), and ignores the passed requireIdLookup key as well as any idCheckInfromationInput. Removing the role also stops any of the document's inputs from being filled with the tabs data--which makes sense considering the tags are role specific.
Ideally I could use the templateRoles version, but I would be happy with the compositeTemplates working with a role. You should be able to specify ID Check $ under the Identify column in the roles modal for a given template, and then have that ID Check filled in if you pass in idCheckInfromationInput.
It looks to me like the idCheckInformationInput is in the right spot, however you are missing the idCheckConfigurationName and requireIdLookup entries. Please check the documentation snippet below and small sample below:
https://www.docusign.com/p/RESTAPIGuide/RESTAPIGuide.htm#REST%20API%20References/Recipients/Signers%20Recipient.htm?Highlight=idCheckInformationInput
"name":"a a a",
"recipientId":"1",
"roleName":"Client",
...
"requireIdLookup" :"true",
"idCheckConfigurationName": "ID Check $",
"idCheckInformationInput": {
"addressInformationInput": {
"addressInformation": {
"street1": "sample string 1",
"street2": "sample string 2",
"city": "sample string 3",
"state": "sample string 4",
"zip": "sample string 5",
"zipPlus4": "sample string 6"
},
"displayLevelCode": "sample string 1",
"receiveInResponse": "sample string 2"
},
To get this to work I needed to switch to the compositeTemplates format, and to get passed the issue with the roleName I had to UNCHECK "Sender Cannot Edit recipient" in the cog dropdown for the recipients and routing modal that is launched when you click on the roles for a template .
I would like to create envelopes using static/composite templates. I have created template, roles and have
configured tags related to the roles into my DocuSign account. I also have retrieved the templateid
of this template to reference this template from API call.
Is there a way to overlay the document from the template with another document at runtime using an
API call?
I tried doing the same using the API Explorer(using REST based API call) but instead of overlaying the
document, it got appended to the document from the template.
My main reason of doing this is to use the tags for recipient roles so that at run time, I do
not need configure the tags for the recipients. In my case, the recipient tags remain the same
for all the recipients/envelopes but the document changes every time I create an envelope.
Please advise,
Yes you can do this. Composite templates are the way to go. When you make the call, create a single composite template structure which references both the server-side template and your document. The inlineTemplate with your document should be in sequence 1 whereas your serverTemplate should be in sequence 2. E.g.:
--f6e755d3-bbcf-44e5-b276-8ae626f97220
Content-Type: application/json
Content-Disposition: form-data
{
"emailSubject":"DocuSign API - Composite Templates",
"emailBlurb":"Composite Templates Sample 1",
"status":"sent",
"compositeTemplates":[
{
"compositeTemplateId": "1",
"inlineTemplates":[
{
"sequence":"1",
"recipients":{
"signers":[
{
"email":"me#u.them",
"name":"My Signer",
"recipientId":1,
"roleName":"Signer1",
"tabs":{
"textTabs":[
{
"tabLabel":"NDACompany",
"value":"ACME Co USA"
}
]
}
}
]
},
"documents": [
{
"documentId": "1",
"name": "Test Doc.txt"
}
]
}
],
"serverTemplates":[
{
"sequence":"2",
"templateId":"83A07CB0-CF0C-4823-B68A-42EE983F301A"
}
]
}
]
}
--f6e755d3-bbcf-44e5-b276-8ae626f97220
Content-Type: text/plain
Content-Disposition: file; filename="Test Doc.txt"; documentid=1; compositeTemplateId=1
Howdy. Please sign!
--f6e755d3-bbcf-44e5-b276-8ae626f97220--