简体   繁体   English

DocuSign API-使用复合模板创建信封

[英]DocuSign API - create envelopes using composite templates

I would like to create envelopes using static/composite templates. 我想使用静态/复合模板创建信封。 I have created template, roles and have configured tags related to the roles into my DocuSign account. 我已经创建了模板,角色,并在DocuSign帐户中配置了与角色相关的标签。 I also have retrieved the templateid of this template to reference this template from API call. 我还检索了此模板的templateid,以从API调用中引用此模板。

Is there a way to overlay the document from the template with another document at runtime using an API call? 有没有一种方法可以在运行时使用API​​调用将模板中的文档覆盖到另一个文档中? I tried doing the same using the API Explorer(using REST based API call) but instead of overlaying the document, it got appended to the document from the template. 我尝试使用API​​ Explorer(使用基于REST的API调用)进行相同的操作,但是没有覆盖文档,而是将其从模板追加到了文档中。

My main reason of doing this is to use the tags for recipient roles so that at run time, I do not need configure the tags for the recipients. 我这样做的主要理由是将标签用于收件人角色,以便在运行时不需要为收件人配置标签。 In my case, the recipient tags remain the same for all the recipients/envelopes but the document changes every time I create an envelope. 就我而言,所有收件人/信封的收件人标签都相同,但是每次创建信封时文档都会更改。

Please advise, 请指教,

Yes you can do this. 是的,您可以这样做。 Composite templates are the way to go. 复合模板是必经之路。 When you make the call, create a single composite template structure which references both the server-side template and your document. 进行呼叫时,请创建一个单一的复合模板结构,该结构同时引用服务器端模板和您的文档。 The inlineTemplate with your document should be in sequence 1 whereas your serverTemplate should be in sequence 2. Eg: 文档的inlineTemplate应该按顺序1排列,而serverTemplate应该按顺序2排列。例如:

    --f6e755d3-bbcf-44e5-b276-8ae626f97220
    Content-Type: application/json
    Content-Disposition: form-data

    {
       "emailSubject":"DocuSign API - Composite Templates",
       "emailBlurb":"Composite Templates Sample 1",
       "status":"sent",
       "compositeTemplates":[
          {
            "compositeTemplateId": "1",
             "inlineTemplates":[
                {
                   "sequence":"1",
                   "recipients":{
                      "signers":[
                         {
                            "email":"me@u.them",
                            "name":"My Signer",
                            "recipientId":1,
                            "roleName":"Signer1",
                            "tabs":{
                               "textTabs":[
                                  {
                                     "tabLabel":"NDACompany",
                                     "value":"ACME Co USA"
                                  }
                               ]
                            }
                         }
                      ]
                   },
                    "documents": [
                        {
                            "documentId": "1",
                            "name": "Test Doc.txt"
                        }
                    ]
                }
             ],
             "serverTemplates":[
                {
                   "sequence":"2",
                   "templateId":"83A07CB0-CF0C-4823-B68A-42EE983F301A"
                }
             ]
          }
       ]
    }
    --f6e755d3-bbcf-44e5-b276-8ae626f97220
    Content-Type: text/plain
    Content-Disposition: file; filename="Test Doc.txt"; documentid=1; compositeTemplateId=1

    Howdy.  Please sign!
    --f6e755d3-bbcf-44e5-b276-8ae626f97220--

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM