简体   繁体   English

DocuSign API:在同一个信封中发送多个文档的签名问题

[英]DocuSign API: Signing issues with sending multiple documents in the same envelope

Using C#, DocuSign API SDK 4.5.2.使用 C#,DocuSign API SDK 4.5.2。

I'm sending out 3 documents for signatures in the same envelope.我要在同一个信封中发送 3 个签名文件。 Each document will use the same server template (which just places the signature elements over the document using anchor tags).每个文档都将使用相同的服务器模板(它只是使用锚标记将签名元素放在文档上)。 I can send out the envelope and I get the email back from DocuSign to view/sign the documents.我可以寄出信封,然后从 DocuSign 取回 email 以查看/签署文件。

The issue I'm having is when I go to sign, I have to sign each document 3 times -- 9 times total -- before I'm allowed to click the Finish button.我遇到的问题是,当我在 go 签名时,我必须对每个文档签名 3 次——总共 9 次——然后才能点击完成按钮。 There is only 1 place to sign on each document, but I have to click the sign button 3 times before it's accepted.每个文件只有一个签名的地方,但我必须点击签名按钮 3 次才能被接受。 If I have 2 recipients, it's the same for each of them.如果我有 2 个收件人,则每个收件人都相同。 If I change the code to send out only 1 document, it works fine so it's obvious something is not being generated correctly in the envelope request.如果我将代码更改为仅发送 1 个文档,它可以正常工作,因此很明显在信封请求中没有正确生成某些内容。

I have also tried giving each recipient a different Id number even though there are only 2 roles and 2 distinct names/email addresses.即使只有 2 个角色和 2 个不同的姓名/电子邮件地址,我也尝试为每个收件人提供不同的 ID 号。

Right before I call the API to actually send the document, I capture the JSON for debugging purposes:就在我调用 API 以实际发送文档之前,我捕获了 JSON 以进行调试:

{
  "compositeTemplates": [
    {
      "compositeTemplateId": "1",
      "document": {
        "documentBase64": "---Document 1 Bytes---",
        "documentId": "1",
        "fileExtension": "pdf",
        "name": "MultiDocument1"
      },
      "inlineTemplates": [
        {
          "recipients": {
            "signers": [
              {
                "email": "client@gmail.com",
                "name": "Client Name",
                "recipientId": "1",
                "roleName": "Signer1"
              },
              {
                "email": "advisor@gmail.com",
                "name": "Advisor Name",
                "recipientId": "2",
                "roleName": "Advisor"
              }
            ]
          },
          "sequence": "2"
        }
      ],
      "serverTemplates": [
        {
          "sequence": "1",
          "templateId": "99321CB1-A3E8-44A0-BDF4-D4F20069BC7B"
        }
      ]
    },
    {
      "compositeTemplateId": "2",
      "document": {
        "documentBase64": "---Document 2 Bytes---",
        "documentId": "2",
        "fileExtension": "pdf",
        "name": "MultiDocument2"
      },
      "inlineTemplates": [
        {
          "recipients": {
            "signers": [
              {
                "email": "client@gmail.com",
                "name": "Client Name",
                "recipientId": "1",
                "roleName": "Signer1"
              },
              {
                "email": "advisor@gmail.com",
                "name": "Advisor Name",
                "recipientId": "2",
                "roleName": "Advisor"
              }
            ]
          },
          "sequence": "2"
        }
      ],
      "serverTemplates": [
        {
          "sequence": "1",
          "templateId": "99321CB1-A3E8-44A0-BDF4-D4F20069BC7B"
        }
      ]
    },
    {
      "compositeTemplateId": "3",
      "document": {
        "documentBase64": "---Document 3 Bytes---",
        "documentId": "3",
        "fileExtension": "pdf",
        "name": "MultiDocument3"
      },
      "inlineTemplates": [
        {
          "recipients": {
            "signers": [
              {
                "email": "client@gmail.com",
                "name": "Client Name",
                "recipientId": "1",
                "roleName": "Signer1"
              },
              {
                "email": "advisor@gmail.com",
                "name": "Advisor Name",
                "recipientId": "2",
                "roleName": "Advisor"
              }
            ]
          },
          "sequence": "2"
        }
      ],
      "serverTemplates": [
        {
          "sequence": "1",
          "templateId": "99321CB1-A3E8-44A0-BDF4-D4F20069BC7B"
        }
      ]
    }
  ],
  "emailSubject": "Multiple Documents for Signature",
  "status": "Sent"
}

Here's one of the documents I'm using.这是我正在使用的文件之一。 The other 2 are similar -- different text, but using the same anchor tags.其他两个类似——不同的文本,但使用相同的锚标记。

在此处输入图像描述

I've also tried substituting another document I have used successfully in testing for Document 1 -- it is completely different, but still uses the same anchor tags.我还尝试替换我在测试文档 1 时成功使用的另一个文档——它完全不同,但仍然使用相同的锚标记。 I'm getting the same results -- having to sign each signature 3 times.我得到了相同的结果——每个签名都要签名 3 次。

Can anyone see what I'm doing wrong?谁能看到我做错了什么? If you need more information, please let me know.如果您需要更多信息,请告诉我。

thanks, randy谢谢,兰迪

Update: As suggested by Inbar and Larry, I contacted DocuSign Support and had the "Anchor Population Scope" setting changed from "Envelope" to "Document".更新:根据 Inbar 和 Larry 的建议,我联系了 DocuSign 支持,并将“锚点人口范围”设置从“信封”更改为“文档”。 Unfortunately, this made things worse.不幸的是,这让事情变得更糟。 I still have to click the signature element multiple times to sign, but only the first document can be signed.我仍然需要多次单击签名元素才能签名,但只能签名第一个文档。 The other documents do not have any signature elements attached.其他文件没有附加任何签名元素。

Update #2: I'm wondering if the way I'm using templates might be confusing and causing these issues.更新#2:我想知道我使用模板的方式是否会令人困惑并导致这些问题。 I probably should have explained myself clearer.我可能应该更清楚地解释自己。 The server template I'm using has a "dummy" Word document that just contains a common set of anchor tags for signatures and dates.我正在使用的服务器模板有一个“虚拟”Word 文档,其中只包含一组用于签名和日期的通用锚标记。 I uploaded it as a template and assigned the signature and date UI elements to the anchor tags.我将它作为模板上传,并将签名和日期 UI 元素分配给锚标记。 But when I'm sending a request from my application, I'm using a different document I choose/generate at runtime.但是当我从我的应用程序发送请求时,我使用的是我在运行时选择/生成的不同文档。 This document replaces the dummy Word document in the template, but has the same anchor tags so all the signature & date elements find their places on the real document.该文档替换了模板中的虚拟 Word 文档,但具有相同的锚标记,因此所有签名和日期元素都可以在真实文档中找到它们的位置。 This works great when sending out just 1 document, but I can't get things to work for more than one.这在仅发送 1 个文档时效果很好,但我不能让事情超过一个。

Update #3: Requirements -- We are adding digital signature capability to our website (ASP.NET, WinForms).更新#3:要求——我们正在向我们的网站(ASP.NET、WinForms)添加数字签名功能。 We already have a page where an Advisor can either print out a document for a physical signature or start a digital signature process with DocuSign.我们已经有一个页面,顾问可以在该页面上打印出物理签名文档或使用 DocuSign 启动数字签名过程。 All our documents come from MS Report Server because they need to contain Client data from our database.我们所有的文档都来自 MS Report Server,因为它们需要包含来自我们数据库的客户数据。 We currently do not send out any static documents.我们目前不发送任何 static 文件。 In the code behind on the page, I get the PDF bytes from Report Server and add that (as a document) to a composite template to be sent to DocuSign.在页面后面的代码中,我从 Report Server 获取 PDF 字节并将其(作为文档)添加到要发送到 DocuSign 的复合模板中。 It also contains a reference to a server template in my account of a Word document (see below) containing the anchor tags and signature elements (mentioned in Update #2) to be overlaid on the Report Server document.它还包含对我的 Word 文档帐户(见下文)的服务器模板的引用,该文档包含要覆盖在报表服务器文档上的锚标记和签名元素(在更新 #2 中提到)。 What happens is the Report Server document replaces the text of the Word template (like a form background) and because I'm using the same text as anchor tags, the signature elements on the Word template find their match on the Report Server document and move to their positions on the document.发生的情况是 Report Server 文档替换了 Word 模板的文本(如表单背景),并且因为我使用与锚标记相同的文本,Word 模板上的签名元素在 Report Server 文档中找到它们的匹配项并移动到他们在文件上的位置。 I finally include 1 or more names/email addresses of the Clients and usually 2 other required signers (Advisor and Manager).我最后包括 1 个或多个客户的姓名/电子邮件地址,通常还有 2 个其他必需的签名者(顾问和经理)。 This is then sent to DocuSign (SDK API) to start the signing process.然后将其发送到 DocuSign (SDK API) 以启动签名过程。 Using a single document, this is working well.使用单个文档,这运行良好。 We are preparing for when we will need to send more than 1 document to a Client and we'd like to do that in a single request.我们正在准备何时需要向客户发送超过 1 个文档,并且我们希望在单个请求中执行此操作。 If you need more info, please let me know.如果您需要更多信息,请告诉我。 服务器端Word模板

I believe the problem is that your account is set so that anchor tab positioning works across all of the documents in the envelope, not just the one document that you're applying the template to.我认为问题在于您的帐户已设置为锚标签定位适用于信封中的所有文档,而不仅仅是您应用模板的一个文档。

So you're ending up with three signing fields, positioned directly on top of one-another.因此,您最终会得到三个签名字段,它们直接位于彼此之上。

Suggestions for fixing:修复建议:

  1. Only apply the last template.仅应用最后一个模板。
  2. Or have your account changed so anchor positioning only affects the document the template is applied to.或者更改您的帐户,以便锚定位仅影响应用模板的文档。

DocuSign Customer Service put me in touch with a Developer Support Representative who was VERY patient and helpful. DocuSign 客户服务让我联系了一位非常耐心和乐于助人的开发人员支持代表。 I explained what I was trying to do and he was able to come up with a solution which was very easily integrated into my existing codebase.我解释了我正在尝试做的事情,他能够提出一个非常容易集成到我现有代码库中的解决方案。

To get this to work, you need 2 pieces of the puzzle.要让它工作,你需要 2 块拼图。 The first item was mentioned above: you must have the Anchor Population Scope value in your account set to "Document".上面提到了第一项:您必须将帐户中的 Anchor Population Scope 值设置为“文档”。 This has to be done by a DocuSign Customer Service rep as the setting is not user accessible.这必须由 DocuSign 客户服务代表完成,因为用户无法访问该设置。

The second item was what was contributing to the signature tags all being stacked on the first document.第二项是导致签名标签全部堆叠在第一个文档上的原因。 In your Composite Template, the Inner Template must have a sequence number of "1" and the Server Template must use a sequence number of "2".在您的复合模板中,内部模板的序号必须为“1”,服务器模板的序号必须为“2”。 Once both of these items were in place, I could send out multiple documents each using the same server template (to define AutoPlace tags and roles) to multiple signers in a single envelope.一旦这两个项目都到位,我可以将多个文档发送给单个信封中的多个签名者,每个文档都使用相同的服务器模板(用于定义 AutoPlace 标记和角色)。

Here's the sample JSON which works for me:这是适用于我的示例 JSON:

  {
  "compositeTemplates": [
    {
      "compositeTemplateId": "1",
      "inlineTemplates": [
        {
          "documents": [
            {
              "documentBase64": "<PDF Bytes>",
              "documentId": "1",
              "fileExtension": "PDF",
              "name": "MultiDocument1"
            }
          ],
          "recipients": {
            "signers": [
              {
                "email": "client@email.com",
                "name": "Client Name",
                "recipientId": "1",
                "roleName": "Signer1"
              },
              {
                "email": "advisor@email.com",
                "name": "Advisor Name",
                "recipientId": "2",
                "roleName": "Advisor"
              }
            ]
          },
          "sequence": "1"
        }
      ],
      "serverTemplates": [
        {
          "sequence": "2",
          "templateId": "1234xxxx-xxxx-xxxx-xxxx-xxxxxxxx5678"
        }
      ]
    },
    {
      "compositeTemplateId": "2",
      "inlineTemplates": [
        {
          "documents": [
            {
              "documentBase64": "<PDF Bytes>",
              "documentId": "2",
              "fileExtension": "PDF",
              "name": "MultiDocument2"
            }
          ],
          "recipients": {
            "signers": [
              {
                "email": "client@email.com",
                "name": "Client Name",
                "recipientId": "1",
                "roleName": "Signer1"
              },
              {
                "email": "advisor@email.com",
                "name": "Advisor Name",
                "recipientId": "2",
                "roleName": "Advisor"
              }
            ]
          },
          "sequence": "1"
        }
      ],
      "serverTemplates": [
        {
          "sequence": "2",
          "templateId": "1234xxxx-xxxx-xxxx-xxxx-xxxxxxxx5678"
        }
      ]
    },
    {
      "compositeTemplateId": "3",
      "inlineTemplates": [
        {
          "documents": [
            {
              "documentBase64": "<PDF Bytes>",
              "documentId": "3",
              "fileExtension": "PDF",
              "name": "MultiDocument3"
            }
          ],
          "recipients": {
            "signers": [
              {
                "email": "client@email.com",
                "name": "Client Name",
                "recipientId": "1",
                "roleName": "Signer1"
              },
              {
                "email": "advisor@email.com",
                "name": "Advisor Name",
                "recipientId": "2",
                "roleName": "Advisor"
              }
            ]
          },
          "sequence": "1"
        }
      ],
      "serverTemplates": [
        {
          "sequence": "2",
          "templateId": "1234xxxx-xxxx-xxxx-xxxx-xxxxxxxx5678"
        }
      ]
    }
  ],
  "emailSubject": "Multiple Documents for Signatures",
  "status": "Sent"
}

If you have any questions, please let me know.如果您有任何问题,请告诉我。 Thanks to Larry K and Inbar Gazit for the assist!感谢 Larry K 和 Inbar Gazit 的协助!

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

相关问题 尝试使用多个文档创建DocuSign信封 - Trying to create DocuSign envelope with multiple documents 使用Docusign API使用C#SDK将多个文档添加到信封 - Add multiple documents to envelope using c# sdk using Docusign API 文件签名 | 嵌入式签名者未在信封上签名 - DocuSign | Embeded Signer not signing envelope DocuSign C#REST API将带有签名者的文档附加到现有信封 - DocuSign C# REST API Attaching documents with signers to existing envelope 信封中的DocuSign API元数据 - DocuSign API Metadata in envelope 发送多份文件签署 DocuSign C# - Sending multiple documents to sign DocuSign C# 我正在使用 ASP.Net 实施 DocuSign API,但是在每次发送信封并重定向到 DocuSign 网站时必须登录到 DocuSign 网站? - I am implementing DocuSign API using ASP.Net, but when sending envelope and redirect to DocuSign site evrytime necessary to login to DocuSign Site? Docusign API C# 如何从信封中删除模板文档? - Docusign API C# How do I remove template documents from an envelope? DocuSign API C#在发送模板作为信封时如何设置文本字段的值? - DocuSign API C# How to set the value of a text field when sending out a template as an envelope? DocuSign eSignature REST API C# 客户端:相同的模板角色能否对单个文档执行多个签名步骤? - DocuSign eSignature REST API C# Client : Can the same template role perform multiple signing steps on a single document?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM