Docusign API:复合模板-无法访问服务器模板中的标签 [英] Docusign API : Composite Templates-unable to access tabs from server templates

查看:50
本文介绍了Docusign API:复合模板-无法访问服务器模板中的标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用XML发送我的签名请求调用,并已参考REST API指南以及使用复合模板的规则,尽管我能够按适当的顺序成功插入其他服务器模板,但其中的安全标签这些模板不可编辑;唯一暴露这些模板的模板是主要模板(不包含在复合模板对象中)。从API指南的第104页看来,内联模板的本质是增加声明的服务器模板(添加文档等)。这是我的XML示例:

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.

编辑:我假设我需要为每个后续ID传递模板角色,但唯一要传递的地方是内联---似乎不适用于此用例。

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:这是我的请求正文,其中包含更新。这次我得到了INCOMPLETE_ENVELOPE ..
我是针对API Explorer运行的,由于某种原因,当我添加原始的顶级模板ID和各自的角色时,我没有得到任何错误。发送更新的XML时,我可以创建信封,但是添加的复合模板不可编辑。.

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>


推荐答案

首先,我不确定是否有可能使用复合模板,并在请求的顶层(即,在 compositeTemplates 集合之外)指定 templateId templateRoles 。因此,我的第一个建议是修改您的请求,以便在 compositeTemplates 集合中指定所有模板(包括您的第一个模板)。

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.

接下来,我怀疑在您在 compositeTemplates 集合中引用的模板所代表的文档中所有选项卡都不可见的原因是,您没有为每个模板提供收件人信息。正如您在 EDIT中所提到的,应该通过在每个 compositeTemplate 项目中使用 inlineTemplate 来完成此操作。例如,以下请求使用 InlineTemplate 为服务器模板定义的 Signer1 角色和 Cc1 角色提供收件人信息。

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>

如果您更新请求以包括每个 compositeTemplate 项目的收件人信息,通过使用如上所示的 inlineTemplates ),我怀疑应该根据您在每个 inlineTemplate 中提供的信息将模板文档中的标签分配给适当的收件人。

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

重新编辑2:

关于XML您在编辑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.

这篇关于Docusign API:复合模板-无法访问服务器模板中的标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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