将模板与文档混合和匹配 [英] Mix and match templates with documents

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

问题描述

我有以下要求:

我的五个文档是从我们的系统动态生成的。第六份文件为附录。这只是一个静态pdf文件。该附录长55页。

Five of my documents are generated from our system dynamically. The sixth document is an appendix. It's just a static pdf file. That appendix is 55 pages long.

到目前为止,我一直在用五个文档创建信封,然后从服务器上的共享文件夹中提取附录。我将其发送给docusign。附录大约需要上载时间的一半。

So far I've been creating the envelope with the five documents, then I pull the appendix from a shared folder on our server, then I send it to docusign. The appendix takes about half of the upload time.

如果我在Docusign上有一个仅包含附录的模板,则效率会更高,然后调用它并添加我的五个文件。我担心的是:

It would be more efficient if I had a template on Docusign that only includes the appendix, then I call it and add my five documents. My concerns are:


  • 是否支持混合和匹配带有独立文档的模板?

  • 数量收件人数和签名标签会根据我们的业务规则动态更改。模板要求模板上具有预定义的角色和标签。有没有办法向使用模板的信封注入更多的收件人和标签?

推荐答案

在创建信封 API请求中使用复合模板结构将使您可以使用DocuSign模板中的文档和运行时通过API请求指定的文档的组合来创建信封,并给出您也可以相当动态地控制收件人。有关在Create Envelope API请求中使用复合模板的更多信息,请在API指南(REST或SOAP)中搜索 Composite。

Using a "Composite Template" structure in your Create Envelope API request will allow you to create an Envelope using a combination of document(s) from DocuSign template(s) and document(s) specified at runtime via the API request, and gives you fairly dynamic control over recipients as well. For more information about using Composite Templates in a Create Envelope API request, search the API guide (either REST or SOAP) for "Composite".

在在创建信封请求中,您的请求中的每个单独的复合模板对象都必须提供完整信封所需的信息(即,至少1个收件人和1个文档...或定义这些文档和/或收件人的服务器模板)。然后,DocuSign本质上将请求中所有复合模板对象中的所有收件人和文档信息组合在一起以形成信封。在下面的示例JSON请求中,结果信封包含:

When you use Composite Templates in your Create Envelope request, each individual Composite Template object in your request has to provide information required for a complete envelope (i.e., at least 1 recipient and 1 document...or a Server Template that defines the documents and/or recipients). Then DocuSign essentially combines all of the recipient and document info from all of your Composite Template objects in the request to form the Envelope. In the case of the example JSON request below, the resulting envelope contains:


  • 3个收件人(通过API请求动态填充:1-Abby ,2-Bob,3-Charlie)

  • 3个文档(第一个通过API请求指定,第二个通过API请求指定,第三个通过DocuSign模板指定)

POST https://demo.docusign.net/restapi/v2/accounts/YOUR_ACCOUNT_NUMBER/信封

X-DocuSign-Authentication: {"Username":"YOUR_USER_NAME","Password":"YOUR_PASSWORD","IntegratorKey":"YOUR_INTEGRATOR_KEY"}
Content-Type: multipart/form-data; boundary=MY_BOUNDARY
Accept: application/json

--MY_BOUNDARY
Content-Type: application/json
Content-Disposition: form-data

{
"status" : "sent",
"emailSubject" : "Test Envelope",
"compositeTemplates": [
{
    "inlineTemplates": [
    {
        "sequence" : 1,
        "recipients": {
            "signers" : [{
                "email": "abbysEmailAddr@outlook.com",
                "name": "Abby Abbott",
                "recipientId": "1"
            },                                    {
                "email": "bobsEmailAddr@outlook.com",
                "name": "Bob Burns",
                "recipientId": "2",
                "routingOrder":"2"
            },
            {
                "email": "charliesEmailAddr@outlook.com",
                "name": "Charlie Carlson",
                "recipientId": "3",
                "routingOrder":"3"
            }]
        }
    }],
    "document": {
        "documentId": 1,
        "name": "Customer Agreement",
        "fileExtension": "pdf"
    }
},
{
    "inlineTemplates": [
    {
        "sequence" : 2,
        "recipients": {
            "signers" : [{
                "email": "abbysEmailAddr@outlook.com",
                "name": "Abby Abbott",
                "recipientId": "1"
            }]
        }
    }],
    "document": {
        "documentId": 2,
        "name": "Test File",
        "fileExtension": "pdf"
    }
},
{
    "serverTemplates": [
    {
        "sequence" : 1,
        "templateId": "YOUR_TEMPLATE_ID"
    }],
    "inlineTemplates": [
    {
        "sequence" : 2,
        "recipients": {
            "signers" : [{
                "email": "abbysEmailAddr@outlook.com",
                "name": "Abby Abbott",
                "recipientId": "1",
                "roleName": "Customer",
                "routingOrder":"1"
            }
            ]
        }
    }]
}
]}

--MY_BOUNDARY
Content-Type: application/pdf
Content-Disposition: file; filename="CustomerAgreement.pdf"; documentid="1"

**pdf bytes removed for brevity**
--MY_BOUNDARY
Content-Type: application/pdf
Content-Disposition: file; filename="TestFile.pdf"; documentid="2"

**pdf bytes removed for brevity**
--MY_BOUNDARY--

使用复合模板有点棘手(并且没有很好的文档说明),因此可能需要反复试验才能使功能完全按照您的要求运行-但希望此示例能为您提供一些启示关于如何使用复合模板通过DocuSign模板和通过API请求动态指定的文档组合来创建信封。

Using Composite Templates is kind of tricky (and not well documented), so it may require some trial and error to get things to work exactly as you require -- but hopefully this example sheds some light on how Composite Templates can be used to create an envelope from a combination of DocuSign templates and documents specified dynamically via the API request.

这篇关于将模板与文档混合和匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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