Receiving INVALID_EMAIL_ADDRESS_FOR_RECIPIENT on few out of 130 templates. Here is the two JSON requests sent to DocuSign REST API v2:
{"status":"sent","emailBlurb":"","emailSubject":"Please DocuSign this document: blah blah blah",
"templateId":"308B68BB-85B7-42A0-8D11-7DF84F485681",
"customFields":{"textCustomFields":[{"name":"TAMID","value":"XXXXXXX"}]},
"templateRoles":[{"email":"dsmith16#answerfinancial.com","name":"Melinda Nelson","roleName":"Client"}]}
{"status":"sent","emailBlurb":"","emailSubject":"Please DocuSign this document: blah blah blah",
"templateId":"99EAF489-FA43-4943-A5EE-530D5888D078",
"customFields":{"textCustomFields":[{"name":"TAMID","value":"XXXXXXX"}]},
"templateRoles":[{"email":"dsmith16#answerfinancial.com","name":"Melinda Nelson","roleName":"Client"}]}
The first one returns INVALID_EMAIL_ADDRESS_FOR_RECIPIENT error code, while the second one is properly "sent". I looked at the templates and they seem identical besides the content of the document itself. Anyone have experienced similar problems, have solution? Any help is appreciated.
Here are two almost identical template XMLs. The one with "(Bad Code)" in the name returns error 100% of the time. PDFBytes node contents removed.
<?xml version="1.0" encoding="utf-8"?>
<EnvelopeTemplate xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.docusign.net/API/3.0">
<EnvelopeTemplateDefinition>
<TemplateID>3fb25b02-eabc-49c1-b904-3d04a3601abd</TemplateID>
<Name>MO 100 Producer Service Agreement (Bad Code)</Name>
<Shared>true</Shared>
<TemplatePassword/>
<TemplateDescription>MO 100 Producer Service Agreement</TemplateDescription>
<LastModified>2014-01-08T22:21:09.813</LastModified>
<PageCount>1</PageCount>
</EnvelopeTemplateDefinition>
<Envelope>
<AccountId>736c1f32-6c73-4798-b67b-de3f6a1a61bc</AccountId>
<Documents>
<Document>
<ID>1</ID>
<Name>MO_100_R_Producer Service Agreement.pdf</Name>
<PDFBytes/>
</Document>
</Documents>
<Recipients>
<Recipient>
<ID>1</ID>
<UserName/>
<Email/>
<Type>Signer</Type>
<AccessCode/>
<RequireIDLookup>false</RequireIDLookup>
<SAMLAuthentication>
<SAMLAttributes/>
</SAMLAuthentication>
<RoutingOrder>1</RoutingOrder>
<Note/>
<RoleName>Client </RoleName>
<TemplateLocked>true</TemplateLocked>
<TemplateRequired>true</TemplateRequired>
<SignInEachLocation>false</SignInEachLocation>
</Recipient>
</Recipients>
<Tabs>
<Tab>
<DocumentID>1</DocumentID>
<RecipientID>1</RecipientID>
<PageNumber>1</PageNumber>
<XPosition>136</XPosition>
<YPosition>519</YPosition>
<ScaleValue>1</ScaleValue>
<Type>SignHere</Type>
<Name>Sign Here</Name>
<TabLabel>Signature 1</TabLabel>
<Value/>
<TemplateLocked>false</TemplateLocked>
<TemplateRequired>false</TemplateRequired>
<Bold>false</Bold>
<Italic>false</Italic>
<Underline>false</Underline>
</Tab>
<Tab>
<DocumentID>1</DocumentID>
<RecipientID>1</RecipientID>
<PageNumber>1</PageNumber>
<XPosition>120</XPosition>
<YPosition>608</YPosition>
<ScaleValue>1</ScaleValue>
<Type>DateSigned</Type>
<Name>Date Signed</Name>
<TabLabel>Date Signed</TabLabel>
<Value/>
<TemplateLocked>false</TemplateLocked>
<TemplateRequired>false</TemplateRequired>
<Bold>false</Bold>
<Italic>false</Italic>
<Underline>false</Underline>
</Tab>
</Tabs>
<Subject>Please DocuSign this document: Producer Service Agreement MO</Subject>
<EmailBlurb/>
<SigningLocation>Online</SigningLocation>
<CustomFields>
<CustomField>
<Name>TAMID</Name>
<Show>True</Show>
<Required>True</Required>
<Value/>
</CustomField>
</CustomFields>
<AutoNavigation>true</AutoNavigation>
<EnvelopeIdStamping>true</EnvelopeIdStamping>
<AuthoritativeCopy>false</AuthoritativeCopy>
<Notification>
<Reminders>
<ReminderEnabled>false</ReminderEnabled>
<ReminderDelay>0</ReminderDelay>
<ReminderFrequency>0</ReminderFrequency>
</Reminders>
<Expirations>
<ExpireEnabled>true</ExpireEnabled>
<ExpireAfter>120</ExpireAfter>
<ExpireWarn>0</ExpireWarn>
</Expirations>
</Notification>
<EnforceSignerVisibility>false</EnforceSignerVisibility>
<EnableWetSign>true</EnableWetSign>
<AllowMarkup>false</AllowMarkup>
<AllowReassign>true</AllowReassign>
</Envelope>
<?xml version="1.0" encoding="utf-8"?>
<EnvelopeTemplate xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.docusign.net/API/3.0">
<EnvelopeTemplateDefinition>
<TemplateID>f8dba6af-5875-4a81-887a-28096b876c5c</TemplateID>
<Name>MO 100 Producer Service Agreement</Name>
<Shared>true</Shared>
<TemplatePassword/>
<TemplateDescription>MO 100 Producer Service Agreement</TemplateDescription>
<LastModified>2014-01-08T22:23:50.34</LastModified>
<PageCount>1</PageCount>
</EnvelopeTemplateDefinition>
<Envelope>
<AccountId>736c1f32-6c73-4798-b67b-de3f6a1a61bc</AccountId>
<Documents>
<Document>
<ID>1</ID>
<Name>MO_100_R_Producer Service Agreement.pdf</Name>
<PDFBytes/>
</Document>
</Documents>
<Recipients>
<Recipient>
<ID>1</ID>
<UserName/>
<Email/>
<Type>Signer</Type>
<AccessCode/>
<RequireIDLookup>false</RequireIDLookup>
<SAMLAuthentication>
<SAMLAttributes/>
</SAMLAuthentication>
<RoutingOrder>1</RoutingOrder>
<Note/>
<RoleName>Client</RoleName>
<TemplateLocked>true</TemplateLocked>
<TemplateRequired>true</TemplateRequired>
<SignInEachLocation>false</SignInEachLocation>
</Recipient>
</Recipients>
<Tabs>
<Tab>
<DocumentID>1</DocumentID>
<RecipientID>1</RecipientID>
<PageNumber>1</PageNumber>
<XPosition>137</XPosition>
<YPosition>519</YPosition>
<ScaleValue>1</ScaleValue>
<Type>SignHere</Type>
<Name>Sign Here</Name>
<TabLabel>Signature 1</TabLabel>
<Value/>
<TemplateLocked>false</TemplateLocked>
<TemplateRequired>false</TemplateRequired>
<Bold>false</Bold>
<Italic>false</Italic>
<Underline>false</Underline>
</Tab>
<Tab>
<DocumentID>1</DocumentID>
<RecipientID>1</RecipientID>
<PageNumber>1</PageNumber>
<XPosition>120</XPosition>
<YPosition>609</YPosition>
<ScaleValue>1</ScaleValue>
<Type>DateSigned</Type>
<Name>Date Signed</Name>
<TabLabel>Date Signed</TabLabel>
<Value/>
<TemplateLocked>false</TemplateLocked>
<TemplateRequired>false</TemplateRequired>
<Bold>false</Bold>
<Italic>false</Italic>
<Underline>false</Underline>
</Tab>
</Tabs>
<Subject>Please DocuSign this document: MO_100_R_Producer Service Agreement.pdf</Subject>
<EmailBlurb/>
<SigningLocation>Online</SigningLocation>
<CustomFields>
<CustomField>
<Name>TAMID</Name>
<Show>True</Show>
<Required>True</Required>
<Value/>
</CustomField>
</CustomFields>
<AutoNavigation>true</AutoNavigation>
<EnvelopeIdStamping>true</EnvelopeIdStamping>
<AuthoritativeCopy>false</AuthoritativeCopy>
<Notification>
<Reminders>
<ReminderEnabled>false</ReminderEnabled>
<ReminderDelay>0</ReminderDelay>
<ReminderFrequency>0</ReminderFrequency>
</Reminders>
<Expirations>
<ExpireEnabled>true</ExpireEnabled>
<ExpireAfter>120</ExpireAfter>
<ExpireWarn>0</ExpireWarn>
</Expirations>
</Notification>
<EnforceSignerVisibility>false</EnforceSignerVisibility>
<EnableWetSign>true</EnableWetSign>
<AllowMarkup>false</AllowMarkup>
<AllowReassign>true</AllowReassign>
</Envelope>
The only solution I've got so far is to re-create the templates. Not a big deal besides all the related headache associated with it, but this looks like a bug to me. May be DocuSign guys will have time to look at it some time.
I believe I can see the problem- I did a diff of your two template definitions and see one difference that could be causing your issue. If you look at the template role for each template, the GOOD template looks like this:
<RoleName>Client</RoleName>
and the BAD template has it's role like this:
<RoleName>Client </RoleName>
That extra space after Client is most likely causing your issue. To resolve, try exporting the bad template through the UI, remove the space, then re-upload and that should do the trick.
Your JSON looks valid to me, but without also seeing the XML for each of the Templates that you're using to send (the one that fails and the one that succeeds), it's hard to provide much feedback beyond that. (If you can download the Template XML for each template, remove PDF bytes from the XML (for brevity), and update your question to include the XML for each template, I'll be happy to review and provide further feedback.)
These (somewhat recent) posts in the (old) DocuSign Dev Forum seem to describe a similar issue:
http://community.docusign.com/t5/DocuSign-API-Integration-Java/INVALID-EMAIL-ADDRESS-FOR-RECIPIENT/td-p/19037
http://docusign.lithium.com/t5/Announcements/REST-API-Multiple-Templates-with-template-roles/td-p/15807
The final thread in the first of these two posts mentions a DocuSign bug # (26473). Perhaps someone with DocuSign can chime in on this thread with an update on that bug status, on the off chance that it's behind the issues you're experiencing.
You receive the error Invlid_email_address_for_recipient but you haven't used the recipient email in your program just yet.
Use your email address (one for docusign account) and not the docusign guid of the email on your account.
(Hopefully useful to other people)
I got the same error, INVALID_EMAIL_ADDRESS_FOR_RECIPIENT, when the template had roles defined as CC who didn't have an email address defined and I didn't add them to the JSON in the API call. This works fine for roles that need to sign (the created envelope just has less of those), but not for roles that receive a review carbon copy.
Related
Docusign Connect appears to be sending us a duplicate envelope event for the Auto Responded event.
The flow seems to go like this:
AutoResponded event comes through (with no reason attached) indicating to users there is a problem
I now go into the Docusign console, fix the email and 're-send' the envelope
Sent event comes through
AutoResponded event comes through again with reason attached even though envelope was successfully sent
Question:
Why is the second AutoResponded event being sent and how do I stop it? It seems like a bug!
Here are the XML logs:
1. the first AutoResponded event is sent:
<?xml version="1.0" encoding="utf-8"?>
<DocuSignEnvelopeInformation
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.docusign.net/API/3.0">
<EnvelopeStatus>
<RecipientStatuses>
<RecipientStatus>
<Type>Signer</Type>
<Email>bad_email#gmail.com</Email>
<UserName>Agent Sign</UserName>
<RoutingOrder>1</RoutingOrder>
<Sent>2020-04-29T12:18:27.73</Sent>
<DeclineReason xsi:nil="true" />
<AutoRespondedReason />
<Status>AutoResponded</Status>
<RecipientIPAddress />
<AccountStatus>Active</AccountStatus>
<RecipientId>5c0a8b5a-29e6-4202-a2cb-3c1ee8a5dabd</RecipientId>
</RecipientStatus>
</RecipientStatuses>
<TimeGenerated>2020-04-29T12:18:28.8995763</TimeGenerated>
<EnvelopeID>e8a9f23a-e49d-4f51-b960-3e80d20c11b3</EnvelopeID>
<Subject>A subject</Subject>
<UserName>My Account</UserName>
<Email>my_email</Email>
<Status>Sent</Status>
<Created>2020-04-29T12:18:26.123</Created>
<Sent>2020-04-29T12:18:28.23</Sent>
<ACStatus>Original</ACStatus>
<ACStatusDate>2020-04-29T12:18:26.123</ACStatusDate>
<ACHolder>My account</ACHolder>
<ACHolderEmail>my_email</ACHolderEmail>
<ACHolderLocation>DocuSign</ACHolderLocation>
<SigningLocation>Online</SigningLocation>
<SenderIPAddress>52**** </SenderIPAddress>
<EnvelopePDFHash />
<AutoNavigation>true</AutoNavigation>
<EnvelopeIdStamping>true</EnvelopeIdStamping>
<AuthoritativeCopy>false</AuthoritativeCopy>
<DocumentStatuses>
<DocumentStatus>
<ID>1</ID>
<Name>My document</Name>
<TemplateName />
<Sequence>1</Sequence>
</DocumentStatus>
</DocumentStatuses>
</EnvelopeStatus>
<TimeZone>GMT Standard Time</TimeZone>
<TimeZoneOffset>1</TimeZoneOffset>
</DocuSignEnvelopeInformation>
2. After manually fixing email address and resending, the Sent event is sent:
<?xml version="1.0" encoding="utf-8"?>
<DocuSignEnvelopeInformation
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.docusign.net/API/3.0">
<EnvelopeStatus>
<RecipientStatuses>
<RecipientStatus>
<Type>Signer</Type>
<Email>good_email#gmail.com</Email>
<UserName>Agent Sign</UserName>
<RoutingOrder>1</RoutingOrder>
<Sent>2020-04-29T12:20:03.667</Sent>
<DeclineReason />
<Status>Sent</Status>
<RecipientIPAddress />
<AccountStatus>Active</AccountStatus>
<RecipientId>5c0a8b5a-29e6-4202-a2cb-3c1ee8a5dabd</RecipientId>
</RecipientStatus>
</RecipientStatuses>
<TimeGenerated>2020-04-29T12:20:03.8080578</TimeGenerated>
<EnvelopeID>e8a9f23a-e49d-4f51-b960-3e80d20c11b3</EnvelopeID>
<Subject>A subject</Subject>
<UserName>My Account</UserName>
<Email>my_email</Email>
<Status>Sent</Status>
<Created>2020-04-29T12:18:26.123</Created>
<Sent>2020-04-29T12:18:28.23</Sent>
<ACStatus>Original</ACStatus>
<ACStatusDate>2020-04-29T12:18:26.123</ACStatusDate>
<ACHolder>My account</ACHolder>
<ACHolderEmail>my_email</ACHolderEmail>
<ACHolderLocation>DocuSign</ACHolderLocation>
<SigningLocation>Online</SigningLocation>
<SenderIPAddress>52*** </SenderIPAddress>
<EnvelopePDFHash />
<AutoNavigation>true</AutoNavigation>
<EnvelopeIdStamping>true</EnvelopeIdStamping>
<AuthoritativeCopy>false</AuthoritativeCopy>
<DocumentStatuses>
<DocumentStatus>
<ID>1</ID>
<Name>My document</Name>
<TemplateName />
<Sequence>1</Sequence>
</DocumentStatus>
</DocumentStatuses>
</EnvelopeStatus>
<TimeZone>GMT Standard Time</TimeZone>
<TimeZoneOffset>1</TimeZoneOffset>
</DocuSignEnvelopeInformation>
3. Immediately after a second AutoResponded event is sent:
<?xml version="1.0" encoding="utf-8"?>
<DocuSignEnvelopeInformation
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.docusign.net/API/3.0">
<EnvelopeStatus>
<RecipientStatuses>
<RecipientStatus>
<Type>Signer</Type>
<Email>good_email#gmail.com</Email>
<UserName>Agent Sign</UserName>
<RoutingOrder>1</RoutingOrder>
<Sent>2020-04-29T12:20:03.667</Sent>
<DeclineReason />
<AutoRespondedReason>
<![CDATA[smtp; 550-5.1.1 The email account that you tried to reach does not exist. Please try 550-5.1.1 double-checking the recipient's email address for typos or 550-5.1.1 unnecessary spaces. Learn more at 550 5.1.1 https://support.google.com/mail/?p=NoSuchUser r18si2079394ilc.128 - gsmtp]]>
</AutoRespondedReason>
<Status>AutoResponded</Status>
<RecipientIPAddress />
<AccountStatus>Active</AccountStatus>
<RecipientId>5c0a8b5a-29e6-4202-a2cb-3c1ee8a5dabd</RecipientId>
</RecipientStatus>
</RecipientStatuses>
<TimeGenerated>2020-04-29T12:20:05.0110985</TimeGenerated>
<EnvelopeID>e8a9f23a-e49d-4f51-b960-3e80d20c11b3</EnvelopeID>
<Subject>A subject</Subject>
<UserName>My account</UserName>
<Email>my_email</Email>
<Status>Sent</Status>
<Created>2020-04-29T12:18:26.123</Created>
<Sent>2020-04-29T12:20:03.933</Sent>
<ACStatus>Original</ACStatus>
<ACStatusDate>2020-04-29T12:18:26.123</ACStatusDate>
<ACHolder>My account</ACHolder>
<ACHolderEmail>my_email</ACHolderEmail>
<ACHolderLocation>DocuSign</ACHolderLocation>
<SigningLocation>Online</SigningLocation>
<SenderIPAddress>52.**** </SenderIPAddress>
<EnvelopePDFHash />
<AutoNavigation>true</AutoNavigation>
<EnvelopeIdStamping>true</EnvelopeIdStamping>
<AuthoritativeCopy>false</AuthoritativeCopy>
<DocumentStatuses>
<DocumentStatus>
<ID>1</ID>
<Name>document_name</Name>
<TemplateName />
<Sequence>1</Sequence>
</DocumentStatus>
</DocumentStatuses>
</EnvelopeStatus>
<TimeZone>GMT Standard Time</TimeZone>
<TimeZoneOffset>1</TimeZoneOffset>
</DocuSignEnvelopeInformation>
And here is the configuration:
This may be a bug, but the bug is not that you got two AutoResponded messages. That is actually normal in some cases. If the SMTP server takes time to give the reason, but DocuSign already knows the email was not delivered, then the second one is sent to give you the reason which DocuSign only knows later. The first one is sent quickly so you can know as soon as possible that it wasn't delivered, even if no reason is provided.
Now, the bug here may be that the second one already updated the email address as it's coming from an internal database, but the bounce was for a different email address.
I can file a bug on this and ask someone to investigate and fix, if you want, but in the interim I suggest you change your logic of your app. If you got the "sent" notification for a specific recipientID - you can ignore any AutoResponded messages for the same recipient.
Hope this helps.
I'm able to explore most of the methods explained in the SOAP API document and Thanks alot for detailing each of the method.
I've a query on assigning specific form fields to each recipient as part of createandSendEnvelope request. for e.g., as shown in below image I know the form fields for each signer.
Recipient 1 fields: S1_Company, S1_Location, S1_SignHere, S1_PrintHere & S1_DateHere
Recipient 2 fields: S2_Company, S2_Location, S2_SignHere, S2_PrintHere & S2_DateHere
I tried anchor tags but wasn't able to use the form fields mentioned above. The logic I'm looking at is All the forms fields for a form which has to be assigned to a recipient for inputting data to signer is driven based on the static data loaded in Database and upon envelope completion I should be able to read the data inputted in each field assigned to each recipient should be retrievable. i.e., The basic benefit I'm looking at is by using RequestEnvelopeWithDocumentFields I should be able to read the values inputted by recipients in S1_Company, S1_Location etc form fields can be stored in my Database too for Audit purpose and to be in sync with Docusign Data.
Your help in this regard in greatly Appreciated!! let me know if you need any additional information for this query
Attached Payload for
<?xml version="1.0" encoding="utf-16" ?>
<arrayofcompositetemplate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<compositetemplate>
<inlinetemplates xmlns="http://www.docusign.net/API/3.0">
<inlinetemplate>
<sequence>1</sequence>
<envelope>
<accountid>4af47e96-b342-45f2-9fcb-ab3c031780f1</accountid>
<recipients>
<recipient>
<id>1</id>
<username>Signer 1</username>
<email>*******#*****.com</email>
<type>Signer</type>
<accesscode xsi:nil="true" />
</recipient>
</recipients>
<tabs>
<tab>
<recipientid>1</recipientid>
<type>DateSigned</type>
<tablabel>Client1_DocuSignDateSigned</tablabel>
</tab>
<tab>
<recipientid>1</recipientid>
<type>SignHere</type>
<tablabel>Client1_DocuSignSignHere</tablabel>
</tab>
<tab>
<recipientid>1</recipientid>
<type>FullName</type>
<tablabel>Client1_DocuSignFullName</tablabel>
</tab>
</tabs>
</envelope>
</inlinetemplate>
</inlinetemplates>
<document xmlns="http://www.docusign.net/API/3.0">
<id>1</id>
<name>DocumentOne</name>
<pdfbytes>JVBERi0x</pdfbytes>
<fileextension>.pdf</fileextension>
</document>
</compositetemplate>
</arrayofcompositetemplate>
PDF form transformation is much more efficient than using anchors. To take advantage of this feature you must use either CreateEnvelopeFromTemplates or CreateEnvelopeFromTemplatesAndForms. The first is legacy and is limited to assigning all fields ("Tabs" in our API) to one recipient. CreateEnvelopeFromTemplatesAndForms (CEFTAF) is built around composite templates. I strongly recommend building all solutions around composite template composition, both in SOAP and REST. It gives you full API capabilities so you can expand your integration without totally redesigning the envelope assembly.
CompositeTemplates are themselves not templates, but rather, "units of contribution" to the envelope construction process. They can contain one or more templates, usually server templates (stored in DocuSign) and inline templates (contributed via code). They also support PDF Form Transformation along with wild-card Tab matching.
Here is an example:
<CompositeTemplate>
<Document>
<ID>1</ID>
<Name>Application form</Name>
<PDFBytes>JVBERi0xLjYNJeL...(snipped)</PDFBytes>
<TransformPdfFields>true</TransformPdfFields>
<FileExtension>pdf</FileExtension>
</Document>
<InlineTemplates>
<InlineTemplate>
<Sequence>1</Sequence>
<Envelope>
<AccountId>87312c39-f11d-4cdf-a7de-905cfbe774e6</AccountId>
<Recipients>
<!-- the "S1" recipient -->
<Recipient>
<ID>1</ID>
<UserName>Iwana Getthat</UserName>
<Email>iwana#example.com</Email>
<Type>Signer</Type>
<RoutingOrder>1</RoutingOrder>
<RoleName>S1</RoleName>
<!-- (option)<DefaultRecipient>true</DefaultRecipient> -->
</Recipient>
<!-- the "S2" recipient -->
<Recipient>
<ID>2</ID>
<UserName>Ice Screen</UserName>
<Email>ice#example.com</Email>
<Type>Signer</Type>
<RoutingOrder>2</RoutingOrder>
<RoleName>Approver</RoleName>
</Recipient>
</Recipients>
<Tabs>
<!-- Tabs for Recipient 1 -->
<Tab>
<RecipientID>1</RecipientID>
<TabLabel>S1_\*</TabLabel>
<Type>SignHere</Type>
</Tab>
<Tab>
<RecipientID>1</RecipientID>
<TabLabel>S1_\*</TabLabel>
<Type>DateSigned</Type>
</Tab>
<Tab>
<RecipientID>1</RecipientID>
<TabLabel>S1_FullName\*</TabLabel>
<Type>FullName</Type>
</Tab>
<Tab>
<RecipientID>1</RecipientID>
<TabLabel>S1_Email\*</TabLabel>
<Type>Custom</Type>
<CustomTabValidationPattern>^\w+#[a-zA-Z_]+?\.[a-zA-Z]{2,3}$</CustomTabValidationPattern>
<CustomTabRequired>true</CustomTabRequired>
</Tab>
<Tab>
<!-- Catch all for all other CustomTab types not covered above -->
<RecipientID>1</RecipientID>
<TabLabel>S1_\*</TabLabel>
<Type>Custom</Type>
<CustomTabRequired>true</CustomTabRequired>
</Tab>
<!-- Tabs for Recipient 2 -->
<Tab>
<RecipientID>2</RecipientID>
<TabLabel>S2_\*</TabLabel>
<Type>SignHere</Type>
</Tab>
<Tab>
<RecipientID>2</RecipientID>
<TabLabel>S2_\*</TabLabel>
<Type>DateSigned</Type>
</Tab>
</Tabs>
</Envelope>
</InlineTemplate>
</InlineTemplates>
</CompositeTemplate>
Notice the convenient use of "*" as a wildcard, matching the Form Field name of S1_{anything} that resulted in a Tab with TabLabel of S1_{anything} to assign to the "S1" related recipient.
I have created a template on my account and am now trying to post a new document to sign using the signature tabs in that template.
I'm trying to use inline composite templates to do this. I've successfully added a new document to the envelope but this document does not display the signature tabs i configured in the template. Additionally, the original document in my template persists as the "next envelope" when the user goes to sign.
Here is my current xml body for reference:
<envelopeDefinition xmlns="http://www.docusign.com/restapi">
<emailBlurb>Email Blurb</emailBlurb>
<emailSubject>Inline Template Test</emailSubject>
<status>Sent</status>
<compositeTemplates>
<compositeTemplate>
<serverTemplates>
<sequence>1</sequence>
<templateId>TEMPLATE ID</templateId>
</serverTemplates>
<inlineTemplates>
<inlineTemplate>
<sequence>1</sequence>
<documents>
<document>
<name>..\..\tester.pdf</name>
<documentId>1</documentId>
</document>
</documents>
<recipients>
<signers>
<signer>
<roleName>Developer</roleName>
<recipientId>1</recipientId>
<email>Signer Email</email>
<name>Signer Name</name>
</signer>
</signers>
</recipients>
</inlineTemplate>
</inlineTemplates>
</compositeTemplate>
</compositeTemplates>
As mentioned, using this body in conjunction with a multipart form results in the document being uploaded but the template not being applied.
If your intention is for the Template to define the tabs and recipient role, and the API request to supply Recipient info and the Document itself for each specific Envelope, then I'd suggest the following changes to your XML:
Add <serverTemplate> inside <serverTemplates>.
Change value of <sequence> to 2 for inline template.
Remove <documents> element, since each inline template can contain at
most ONE document a <documents> element is not needed/expected.
Move <document> outside of <inlineTemplates>.
Remove the backslashes in the value of the document's <name> property (they may be problematic, not sure. This value is simply the display name of the document within the Envelope.
After these changes are made, the <compositeTemplates> portion of your request will look like this:
<compositeTemplates>
<compositeTemplate>
<serverTemplates>
<serverTemplate>
<sequence>1</sequence>
<templateId>TEMPLATE ID</templateId>
<serverTemplate>
</serverTemplates>
<inlineTemplates>
<inlineTemplate>
<sequence>2</sequence>
<recipients>
<signers>
<signer>
<roleName>Developer</roleName>
<recipientId>1</recipientId>
<email>Signer Email</email>
<name>Signer Name</name>
</signer>
</signers>
</recipients>
</inlineTemplate>
</inlineTemplates>
<document>
<name>tester.pdf</name>
<documentId>1</documentId>
</document>
</compositeTemplate>
</compositeTemplates>
Finally, for the tabs that the Template defines to be assigned to the recipient you specify in the API request, make sure that the spelling and CASE of the <roleName> value matches exactly in your API request as it's specified in the Template itself.
I'm continuing to work with the scenario described in this question and thus far I do have the ability as the insured (first recipient) to edit all secure fields that were created when I initially created my server templates. What doesn't happen, however is the second recipient (producer-who is also a signer) does not have those fields that were designated as required visible. This only seems to happen when I send an API call for signature on composite templates. When working with a single template both parties have designated fields available to edit. I understand this may be a configuration issue but wanted to rule out the possibility of essential parameters in my call being omitted. I have gone into console account features and set secure fields visible to all recipients (see Molly's comment in the forum).
Here is my call XML. There may be some redundancy (e.g. type, routing order) but I'm working from various examples. Thanks in advance.
<envelopeDefinition xmlns=\"http://www.docusign.com/restapi\">
<accountId>123456</accountId>
<status>sent</status>
<emailSubject>another test</emailSubject>
<emailBlurb>This comes from Me</emailBlurb>
<compositeTemplates>
<compositeTemplate>
<serverTemplates>
<serverTemplate>
<sequence>1</sequence>
<templateId>894ed334-4183-4b68-857e-01fe4829f79e</templateId>
</serverTemplate>
</serverTemplates>
<inlineTemplates>
<inlineTemplate>
<sequence>2</sequence>
<recipients>
<signers>
<signer>
<type>Signer</type>
<email>insured#email.com</email>
<name>test insured</name>
<RoutingOrder>1</RoutingOrder>
<recipientId>1</recipientId>
<roleName>Insured</roleName>
</signer>
<signer>
<email>producer#email.com</email>
<type>Signer</type>
<roleName>Producer</roleName>
<name>Test Agent</name>
<recipientId>2</recipientId>
<RoutingOrder>2</RoutingOrder>
</signer>
</signers>
</recipients>
</inlineTemplate>
</inlineTemplates>
</compositeTemplate>
</compositeTemplates>
I'm unable to repro the issue you describe. I can successfully create an Envelope from a single template (using Composite Templates in my XML request), where a data field is required/editable for the first Recipient, and the same data field is editable for the second Recipient (but optional -- since the field is 'owned' by the first Recipient). Here's my request XML:
<envelopeDefinition xmlns="http://www.docusign.com/restapi">
<accountId>ACCOUNT_ID</accountId>
<status>sent</status>
<compositeTemplates>
<compositeTemplate>
<serverTemplates>
<serverTemplate>
<sequence>1</sequence>
<templateId>TEMPLATE_ID</templateId>
</serverTemplate>
</serverTemplates>
<inlineTemplates>
<inlineTemplate>
<sequence>2</sequence>
<recipients>
<signers>
<signer>
<email>johnsemail#outlook.com</email>
<name>John Doe</name>
<recipientId>1</recipientId>
<roleName>signer</roleName>
<routingOrder>1</routingOrder>
</signer>
<signer>
<email>janesemail#outlook.com</email>
<name>Jane Doe</name>
<recipientId>2</recipientId>
<roleName>signer2</roleName>
<routingOrder>2</routingOrder>
</signer>
</signers>
</recipients>
</inlineTemplate>
</inlineTemplates>
</compositeTemplate>
</compositeTemplates>
</envelopeDefinition>
Here are a few suggestions for troubleshooting...
First, make a couple of changes to your request XML:
Try using routingOrder (lower-case 'r') instead of RoutingOrder (upper-case 'r') in your XML. In my (limited) testing just now, DocuSign seems to be ignoring the RoutingOrder element if it starts with an uppercase 'r'.
Remove the type element from the XML request -- this isn't
necessary because you're mapping each recipient to a Template
role (which defines recipient type).
Also, if you want both recipients to be able to Edit a field, double-check the field properties in the Template via the DocuSign web console to confirm that the field has "Allow All to Edit" selected.
Finally, it wouldn't hurt to double-check the Account settings (Preferences >> Features) to confirm that the Display Initial SecureField property is selected. (Occasionally I've seen it where someone enables a setting, but forgets to Save the change (by clicking the SAVE button that's located at the very bottom of the page.))
I'm currently sending my signature request call in XML and have referred to the REST API guide as well as the example in Rules for Composite Template Usage and although I was able to successfully pull in the additional server templates in the appropriate sequence, the secure tabs in these templates were not editable; the only template that exposed these was the 'primary' template (not included in the composite templates object). From page 104 in the API guide it appears that the essence of inline templates is to augment the server templates declared (add documents, etc.). Here is my XML sample:
<envelopeDefinition xmlns=\"http://www.docusign.com/restapi\">
<accountId>#####</accountId>
<status>sent</status>
<emailSubject>testing 11/18 -3</emailSubject>
<emailBlurb>Email Blurb</emailBlurb>
<templateId>TEMPLATE ID 1</templateId>
<templateRoles>
<templateRole>
<email>insured#email.com</email>
<name>Insured Test</name>
<roleName>Signer</roleName>
</templateRole>
<templateRole>
<email>test#email.com</email>
<name>Test Agent</name>
<roleName>Agent</roleName>
</templateRole>
</templateRoles>
<compositeTemplates>
<compositeTemplate>
<serverTemplates>
<serverTemplate>
<sequence>1</sequence>
<templateId>TEMPLATE ID 2</templateId>
</serverTemplate>
</serverTemplates>
</compositeTemplate>
<compositeTemplate>
<serverTemplates>
<serverTemplate>
<sequence>2</sequence>
<templateId>TEMPLATE ID 3</templateId>
</serverTemplate>
</serverTemplates>
</compositeTemplate>
<compositeTemplate>
<serverTemplates>
<serverTemplate><sequence>3</sequence>
<templateId>TEMPLATE ID 4</templateId>
</serverTemplate></serverTemplates>
</compositeTemplate>
</compositeTemplates>
</envelopeDefinition>
Basically I need to be able to append server templates based upon parameters selected by the user to the primary.
EDIT: I'm assuming that I'd need to pass in template roles for each of the subsequent ID's, but the only place to pass that in would be an inline---which doesn't appear to be applicable for this use case.
EDIT2: Here's my request body with the updates. This time I'm getting INCOMPLETE_ENVELOPE..
I ran this against the API Explorer and for some reason when I added in the original top-level template ID and respective roles, I didn't get an error. When sending the updated XML I was able to create the envelope but the added composite templates weren't editable..
<envelopeDefinition xmlns=\"http://www.docusign.com/restapi\">
<accountId>1232456</accountId>
<status>sent</status>
<emailSubject>testing inline 11/18 -5</emailSubject>
<emailBlurb>This comes from me</emailBlurb>
<compositeTemplates>
<compositeTemplate>
<serverTemplates>
<serverTemplate>
<sequence>1</sequence>
<templateId>894ed334-4183-4b68-857e-01fe4829f79e</templateId>
</serverTemplate>
</serverTemplates>
<inlineTemplates>
<inlineTemplate>
<sequence>2</sequence>
<recipients>
<recipient>
<signers>
<signer>
<email>email#email.com</email>
<name>Test insured</name>
<roleName>Signer</roleName>
<recipientId>1</recipientId>
</signer>
<signer>
<email>test#gmail.com</email>
<name>Test Agent</name>
<roleName>Agent</roleName>
<recipientId>2</recipientId>
</signer>
</signers>
</recipient>
</recipients>
</inlineTemplate>
</inlineTemplates>
</compositeTemplate>
<compositeTemplate>
<serverTemplates>
<serverTemplate>
<sequence>3</sequence>
<templateId>d1c43bee-2c6b-4910-89f0-64e3fbcce19a</templateId>
</serverTemplate>
</serverTemplates>
<inlineTemplates>
<inlineTemplate>
<sequence>4</sequence>
<recipients>
<recipient>
<signers>
<signer>
<email>email#email.com</email>
<name>Test insured</name>
<roleName>Signer</roleName>
<recipientId>1</recipientId>
</signer>
<signer>
<email>test#gmail.com</email>
<name>Test Agent</name>
<roleName>Agent</roleName>
<recipientId>2</recipientId>
</signer>
</signers>
</recipient>
</recipients>
</inlineTemplate>
</inlineTemplates>
</compositeTemplate>
</compositeTemplates>
</envelopeDefinition>
First, I'm not sure that it's possible to use Composite Templates and also specify a templateId and templateRoles at the top-level of the request (i.e., outside of the compositeTemplates collection). So, my first suggestion would be to modify your request such that all templates (including your first one) are specified within the compositeTemplates collection.
Next, I suspect that the reason none of the tabs are visible within the documents represented by the templates you're referencing in the compositeTemplates collection is that you're not supplying recipient information for each template. As you mentioned in your 'EDIT', this should be accomplished by using an inlineTemplate within each compositeTemplate item. For example, the following request using an InlineTemplate to supply recipient information for the Signer1 role and the Cc1 role that the Server Template defines.
POST https://{{env}}.docusign.net/restapi/{{version}}/accounts/{{acctId}}/envelopes
<envelopeDefinition xmlns="http://www.docusign.com/restapi">
<accountId>ACCOUNT_ID</accountId>
<status>sent</status>
<compositeTemplates>
<compositeTemplate>
<serverTemplates>
<serverTemplate>
<sequence>1</sequence>
<templateId>3C9D42D3-3E76-4669-861E-9670415E1AD3</templateId>
</serverTemplate>
</serverTemplates>
<inlineTemplates>
<inlineTemplate>
<sequence>2</sequence>
<recipients>
<signers>
<signer>
<email>johnsemail#outlook.com</email>
<name>John Doe</name>
<recipientId>1</recipientId>
<roleName>Signer1</roleName>
</signer>
</signers>
<carbonCopies>
<carbonCopy>
<email>janesemail#outlook.com</email>
<name>Jane Doe</name>
<recipientId>2</recipientId>
<roleName>Cc1</roleName>
</carbonCopy>
</carbonCopies>
</recipients>
</inlineTemplate>
</inlineTemplates>
</compositeTemplate>
</compositeTemplates>
</envelopeDefinition>
If you update your request to include recipient information for each compositeTemplate item (by using inlineTemplates like I've shown above), I'd suspect that the tabs within the template documents should be assigned to the appropriate recipients (per the information you supply within each inlineTemplate).
RE "EDIT 2":
Regarding the XML you posted in your question under "EDIT 2", remove the recipent tags that I've highlighted here -- doing so should result in a valid request that creates the Envelope using the specified Template(s) and assigns the tags appropriately to the recipients you specify in the request.