Inline Composite Templates

徘徊边缘 提交于 2019-12-08 13:48:24

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/24085916/inline-composite-templates

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!