Docusign Transform Pdf Fields For multiple recipients? - docusignapi

I saw the DocuSign API can automatically transform and assign pdf fields to a single default recipient (Docusign Transform Pdf Fields For single recipient?).
Is it possible to do the assignment for multiple recipients?
I am hoping to leverage the auto transform feature but at the same time assign different pdf fields to different recipients during envelope creation.
Thanks.

The following sample creates an envelope using the REST API using base64 encoded pdfBytes that represents a PDF document that contains a number of adobe form fields: option field, check boxes, signature fields. We use name of the adobe field to map this field to a DocuSign tag created for each recipient.
Note that the key here is to name each PDF form field with a format that it is easily assignable to recipient by using a wildcard.
Please refer to the Document Parameters (under note) for the rules used to match adobe fields to DS fields. We will be transforming all adobe fields and assigning them to two recipients, to do this we will be creating each signer and tags, the way we will be binding each DS tag created by using wildcards on the tabLabel. We will be also setting values for some of the data fields and we will be selecting radio button grouped in a parent and selecting check boxes that we have created as a result of transforming these fields.
HTTP Headers:
Accept: application/json
X-DocuSign-Authentication: {"Username": "your_sender#mail", "Password":"your_password", "IntegratorKey":"your_integration_key"}
Content-Type: multipart/form-data; boundary=e6e95273-cafb-4dbf-86b8-a1c0ed85b5c5
Resource: https://{env}.docusign.net/restapi/{version}/accounts/{accountId}/envelopes
Method: POST
Payload:
--e6e95273-cafb-4dbf-86b8-a1c0ed85b5c5
Content-Type: application/json
Content-Disposition: form-data
{
"status":"sent",
"emailSubject":"Test transforming pdf forms and assigning them to each user",
"compositeTemplates":[
{
"inlineTemplates":[
{
"sequence":1,
"recipients":{
"signers":[
{
"email":"[replace this with a valid email]",
"name":"Signer One",
"recipientId":"1",
"routingOrder":"1",
"tabs":{
"textTabs":[
{
"tabLabel":"PrimarySigner\\*",
"value":"Signer One"
}
],
"checkboxTabs":[
{
"tabLabel":"PrimarySigner\\*",
"selected":true
}
],
"signHereTabs":[
{
"tabLabel":"PrimarySigner\\*"
}
],
"dateSignedTabs":[
{
"tabLabel":"PrimarySigner\\*"
}
],
"radioGroupTabs":[
{
"groupName":"PrimarySigner\\*",
"radios":[
{
"value":"M",
"selected":true
}
]
}
]
}
},
{
"email":"[replace this with a valid email]",
"name":"Signer Two",
"recipientId":"2",
"routingOrder":"2",
"tabs":{
"textTabs":[
{
"tabLabel":"SecondarySigner\\*",
"value":"Secondary One"
}
],
"checkboxTabs":[
{
"tabLabel":"SecondarySigner\\*",
"selected":true
}
],
"signHereTabs":[
{
"tabLabel":"SecondarySigner\\*"
}
],
"dateSignedTabs":[
{
"tabLabel":"SecondarySigner\\*"
}
],
"radioGroupTabs":[
{
"groupName":"SecondarySigner\\*",
"radios":[
{
"value":"F",
"selected":true
}
]
}
]
}
}
]
}
}
],
"document":{
"documentId":1,
"name":"test.pdf",
"transformPdfFields":true
}
}
]
}
--e6e95273-cafb-4dbf-86b8-a1c0ed85b5c5
Content-Type: application/pdf
Content-Disposition: file; filename="test1.pdf"; documentId=1
Content-Transfer-Encoding: base64
[replace this with a base64 encoded]
--e6e95273-cafb-4dbf-86b8-a1c0ed85b5c5--

Related

Customized html message in microsoft azure guest invitation

This is the request body I am using to send email to the guests. However, I want to customize the customizedMessageBody using html tags and elements.
{
"invitedUserDisplayName": "Invited User",
"invitedUserEmailAddress": "invited1234#yopmail.com",
"invitedUserMessageInfo": {
"messageLanguage": "string",
"ccRecipients": [
{
"emailAddress": {
"name": "xyz#yopmail.com",
"address": "xyz#yopmail.com"
}
}
],
"customizedMessageBody": "<html>hello tiger</html>"
},
"sendInvitationMessage": true,
"inviteRedirectUrl": "https://myapps.microsoft.com"
}
As Message itself a text area. Due to the Security reason, Customizing the customizedMessageBody using html tags and elements will not be processable.
This document details the available options you have for invitation messages

Recipients Not Provided error from DocuSign API using composite template

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"
}]
}
}]
}]
}

Pre-populating user's ID Check - Personal Information in DocuSign when using templateRoles

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 .

DocuSign API - create envelopes using composite templates

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--

Mix and match templates with documents

I have the following requirement:
Five of my documents are generated from our system dynamically. The sixth document is an appendix. It's just a static pdf file. That appendix is 55 pages long.
So far I've been creating the envelope with the five documents, then I pull the appendix from a shared folder on our server, then I send it to docusign. The appendix takes about half of the upload time.
It would be more efficient if I had a template on Docusign that only includes the appendix, then I call it and add my five documents. My concerns are:
Is mixing and matching templates with stand alone documents supported?
The number of recipients and the signing tags change dynamically depending on our business rules. A template requires predefined roles and tags on the template. Is there a way to inject more recipients and tags to an Envelope that uses a template?
Using a "Composite Template" structure in your Create Envelope API request will allow you to create an Envelope using a combination of document(s) from DocuSign template(s) and document(s) specified at runtime via the API request, and gives you fairly dynamic control over recipients as well. For more information about using Composite Templates in a Create Envelope API request, search the API guide (either REST or SOAP) for "Composite".
When you use Composite Templates in your Create Envelope request, each individual Composite Template object in your request has to provide information required for a complete envelope (i.e., at least 1 recipient and 1 document...or a Server Template that defines the documents and/or recipients). Then DocuSign essentially combines all of the recipient and document info from all of your Composite Template objects in the request to form the Envelope. In the case of the example JSON request below, the resulting envelope contains:
3 recipients (populated dynamically via the API request: 1-Abby, 2-Bob, 3-Charlie)
3 documents (the first specified via the API request, the second specified via the API request, the third specified via a DocuSign template)
POST https://demo.docusign.net/restapi/v2/accounts/YOUR_ACCOUNT_NUMBER/envelopes
X-DocuSign-Authentication: {"Username":"YOUR_USER_NAME","Password":"YOUR_PASSWORD","IntegratorKey":"YOUR_INTEGRATOR_KEY"}
Content-Type: multipart/form-data; boundary=MY_BOUNDARY
Accept: application/json
--MY_BOUNDARY
Content-Type: application/json
Content-Disposition: form-data
{
"status" : "sent",
"emailSubject" : "Test Envelope",
"compositeTemplates": [
{
"inlineTemplates": [
{
"sequence" : 1,
"recipients": {
"signers" : [{
"email": "abbysEmailAddr#outlook.com",
"name": "Abby Abbott",
"recipientId": "1"
}, {
"email": "bobsEmailAddr#outlook.com",
"name": "Bob Burns",
"recipientId": "2",
"routingOrder":"2"
},
{
"email": "charliesEmailAddr#outlook.com",
"name": "Charlie Carlson",
"recipientId": "3",
"routingOrder":"3"
}]
}
}],
"document": {
"documentId": 1,
"name": "Customer Agreement",
"fileExtension": "pdf"
}
},
{
"inlineTemplates": [
{
"sequence" : 2,
"recipients": {
"signers" : [{
"email": "abbysEmailAddr#outlook.com",
"name": "Abby Abbott",
"recipientId": "1"
}]
}
}],
"document": {
"documentId": 2,
"name": "Test File",
"fileExtension": "pdf"
}
},
{
"serverTemplates": [
{
"sequence" : 1,
"templateId": "YOUR_TEMPLATE_ID"
}],
"inlineTemplates": [
{
"sequence" : 2,
"recipients": {
"signers" : [{
"email": "abbysEmailAddr#outlook.com",
"name": "Abby Abbott",
"recipientId": "1",
"roleName": "Customer",
"routingOrder":"1"
}
]
}
}]
}
]}
--MY_BOUNDARY
Content-Type: application/pdf
Content-Disposition: file; filename="CustomerAgreement.pdf"; documentid="1"
**pdf bytes removed for brevity**
--MY_BOUNDARY
Content-Type: application/pdf
Content-Disposition: file; filename="TestFile.pdf"; documentid="2"
**pdf bytes removed for brevity**
--MY_BOUNDARY--
Using Composite Templates is kind of tricky (and not well documented), so it may require some trial and error to get things to work exactly as you require -- but hopefully this example sheds some light on how Composite Templates can be used to create an envelope from a combination of DocuSign templates and documents specified dynamically via the API request.

Resources