Docusign API : Composite Templates-unable to access tabs from server templates

ぃ、小莉子 提交于 2019-12-02 09:38:35

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.

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