内联复合模板 [英] Inline Composite Templates

查看:83
本文介绍了内联复合模板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在我的帐户上创建了一个模板,现在正尝试发布新文档以使用该模板中的签名选项卡进行签名。



我正在尝试使用内联复合模板来执行此操作。我已成功将新文档添加到信封中,但是此文档未显示我在模板中配置的签名标签。此外,当用户签名时,模板中的原始文档将作为下一个信封保留下来。



这是我当前的xml正文供参考:

 < capsuleDefinition xmlns = http://www.docusign.com/restapi> 
< emailBlurb>电子邮件Blurb< / emailBlurb>
< emailSubject>内嵌模板测试< / emailSubject>
< status>已发送< / status>
< compositeTemplates>
< compositeTemplate>
< serverTemplates>
< sequence> 1< / sequence>
< templateId>模板ID< / templateId>
< / serverTemplates>
< inlineTemplates>
< inlineTemplate>
< sequence> 1< / sequence>
< documents>
< document>
< name> .. \..\tester.pdf< / name>
< documentId> 1< / documentId>
< / document>
< / documents>
<收件人>
< signers>
< signer>
< roleName> Developer< / roleName>
< recipientId> 1< / recipientId>
< email>签名者电子邮件< / email>
< name>签名者姓名< / name>
< / signer>
< / signers>
< / recipients>
< / inlineTemplate>
< / inlineTemplates>
< / compositeTemplate>
< / compositeTemplates>



如上所述


解决方案

如果与多部分表单一起使用,则会导致文档被上传,但模板没有被应用。模板,用于定义标签和收件人角色,以及API请求,分别为每个特定的信封提供收件人信息和文档本身,然后建议对XML进行以下更改:




  • < serverTemplates> 内添加< serverTemplate>

  • 更改< 内联模板的 设置为2。

  • 删除< documents> 元素,因为每个内联模板可以包含
    最多/一个文档不需要< documents> 元素。

  • < document> 移至< inlineTemplates>

  • Remo请在文档的< name> 属性的值中加上反斜杠(它们可能有问题,不确定。此值只是信封中文档的显示名称。



进行这些更改后,< compositeTemplates> ; 部分将如下所示:

 < compositeTemplates> 
< compositeTemplate>
< serverTemplates>
< serverTemplate>
< sequence> 1< / sequence>
< templateId>模板ID< / templateId>
< serverTemplate>
< / serverTemplates>
< inlineTemplates>
< inlineTemplate>
< sequence> 2< / sequence>
<收件人>
< signers>
< signer>
< roleName> Developer< / roleName>
< recipientId> 1< / recipientId>
< email>签名者电子邮件< / email>
< name>签名者姓名< / name>
< / signer>
< / signers>
< / recipients>
< / inlineTemplate>
< / inlineTemplates>
< document>
< name> tester.pdf< / name>
< documentId> 1< / documentId>
< / document>
< / compositeTemplate>
< / compositeTemplates>

最后,对于模板定义的选项卡,这些选项卡将分配给您在API请求中指定的收件人,请确保< roleName>的拼写和大小写值与模板本身中指定的API请求中的值完全匹配。


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.

这篇关于内联复合模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆