0

Here is the scenario. I have a single PDF document that is composed of say 3 server side templates.

When I submit the document for signing via the DocuSign API, I will specify this document and I will supply the names, email address and role name for each signer.

I would then specify the server templates in the CompositTemplates section. And I want Docusign the match the singing locations from each template on the PDF document.

However, samples and documentation on this is sparse. Here is what I am using now and getting a "BadRequest" message when attempting to submit it.

    Dim xmlBody As String = "<envelopeDefinition xmlns=""http://www.docusign.com/restapi"">" & _
                                   "<emailSubject>DocuSign API - Signature Request on Document</emailSubject>" & _
                                   "<compositeTemplates>" & _
                                        "<serverTemplates>" & _
                                            "<serverTemplate>" & _
                                                "<sequence>" & "1" & "</sequence>" & _
                                                "<templateId>" & "04F7BB0A-F891-442C-B804-BAEF97B00AB1" & "</templateId>" & _
                                            "</serverTemplate>" & _
                                        "</serverTemplates>" & _
                                        "<inlineTemplates>" & _
                                            "<inlineTemplate>" & _
                                                "<sequence>2</sequence>" & _
                                                "<recipients>" & _
                                                    "<signers>" & _
                                                        "<signer>" & _
                                                            "<email>JGarland@etgroup.net</email>" & _
                                                            "<name>John Doe</name>" & _
                                                            "<recipientId>1</recipientId>" & _
                                                            "<roleName>Borrower 1</roleName>" & _
                                                        "</signer>" & _
                                                    "</signers>" & _
                                                "</recipients>" & _
                                            "</inlineTemplate>" & _
                                        "</inlineTemplates>" & _
                                        "<documents>" & _
                                            "<document>" & _
                                                "<documentId>1</documentId>" & _
                                                "<name>" & documentName & "</name>" & _
                                            "</document>" & _
                                        "</documents>" & _
                                   "</compositeTemplates>" & _
                                   "<status>sent</status>" & _
                               "</envelopeDefinition>"
Larry K
  • 47,808
  • 15
  • 87
  • 140

1 Answers1

0

The problem is that you are missing an xml node to identify a single compositeTemplate (since it's possible to have multiple composite templates). You're XML currently resolves to:

<compositeTemplates>
    <serverTemplates>
       ...

But since you can have multiple composite templates you need an extra node to identify each one, like this:

<compositeTemplates>
    <compositeTemplate>
        <serverTemplates>
            ...

For a complete answer I'll say to also make sure you are setting the Content-Type of the request to application/xml.

Ergin
  • 9,254
  • 1
  • 19
  • 28