首页 文章

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

提问于
浏览
1

我想使用 static/composite 模板创建信封。我已经创建了模板,角色,并在 DocuSign 帐户中配置了与角色相关的标签。我还检索了此模板的 templateid,以从 API 调用中引用此模板。

有没有一种方法可以在运行时使用 API 调用将模板中的文档覆盖到另一个文档中?我尝试使用基于 API Explorer(using REST 的 API 调用进行相同操作),但没有覆盖文档,而是将其从模板追加到了文档中。

我这样做的主要理由是将标签用于收件人角色,以便在运行时不需要为收件人配置标签。就我而言,所有 recipients/envelopes 的收件人标签都相同,但是每次创建信封时文档都会更改。

请指教,

1 回答

  • 3

    是的,您可以这样做。复合模板是必经之路。进行呼叫时,请创建一个同时引用 server-side 模板和您的文档的复合模板结构。文档的 inlineTemplate 应该按顺序 1 排列,而 serverTemplate 应该按顺序 2 排列。E.g .:

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

相关问题