2

Using C#, DocuSign API SDK 4.5.2.

I'm sending out 3 documents for signatures in the same envelope. 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.

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. There is only 1 place to sign on each document, but I have to click the sign button 3 times before it's accepted. If I have 2 recipients, it's the same for each of them. 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.

I have also tried giving each recipient a different Id number even though there are only 2 roles and 2 distinct names/email addresses.

Right before I call the API to actually send the document, I capture the JSON for debugging purposes:

{
  "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.

enter image description here

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. I'm getting the same results -- having to sign each signature 3 times.

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". 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. 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. I uploaded it as a template and assigned the signature and date UI elements to the anchor tags. 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. This works great when sending out just 1 document, but I can't get things to work for more than one.

Update #3: Requirements -- We are adding digital signature capability to our website (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. All our documents come from MS Report Server because they need to contain Client data from our database. We currently do not send out any static documents. 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. 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. 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. I finally include 1 or more names/email addresses of the Clients and usually 2 other required signers (Advisor and Manager). This is then sent to DocuSign (SDK API) to start the signing process. 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. If you need more info, please let me know. Server-side Word Template

RandyB
  • 325
  • 4
  • 13
  • We don't have the documents, but is it possible each document has the anchor string in 3 places? I assume your wish is that there'll be only one tab per document, right? and that using the anchor string it should only place a single tab, right? – Inbar Gazit Dec 21 '20 at 18:35
  • I edited the original post to add a picture of one of the documents. The original documents are in Word format converted to PDF. I'll check to see if there are "extra" anchor tags in either the Word or PDF files. – RandyB Dec 21 '20 at 18:48
  • I just tried using a completely different document for the first doc in the envelope. It's a PDF generated from MS Report Server, but has the same anchor tags. I've used this PDF many times successfully, but only in single document envelopers. I'm getting the same signature issues. – RandyB Dec 21 '20 at 19:19
  • see Larry's answer as well. There's a setting to determine of anchor tabs are per doc or for the entire envelope. Not sure that's your issue either, but might look into that one. – Inbar Gazit Dec 21 '20 at 22:29
  • Pls see comment to Larry's answer. I'm still trying some stuff. I think if I could get an example of the correct JSON, I can figure out how to use the SDK to get the same result. – RandyB Dec 21 '20 at 22:53
  • your JSON is correct. The problem is the change he was talking about can not be done by you, you would need to contact DocuSign support to change your account. – Inbar Gazit Dec 21 '20 at 23:48
  • Uh oh. Last time we needed a change to our account to address an issue, it would have cost $$$$. I found a workaround for that. Maybe I'll get lucky again. Thanks for your help! – RandyB Dec 22 '20 at 00:34
  • This change is not going to cost any money. Not sure what was last time. What was the workaround? – Inbar Gazit Dec 22 '20 at 00:44
  • The issue was setting up Administrative Consent to allow services to send out signature requests. Our account level doesn't support that w/o an add-on (Access Management/SSO). The workaround was to create a dummy user that can give consent and we use that to send out our requests. It seems to be working OK. – RandyB Dec 22 '20 at 03:10
  • What specifically do I need to ask DocuSign to set in our account? – RandyB Dec 22 '20 at 03:11
  • 1
    Ask them to change the default scope for anchor tags on your account. – Inbar Gazit Dec 22 '20 at 03:24
  • I had the setting changed, but it made things worse. Please see the updates in the original post. – RandyB Dec 23 '20 at 23:39
  • 1
    I suggest contacting developer support via go-live at DocuSign dot com. – Larry K Dec 24 '20 at 18:27
  • Yep -- I'm thinking the same thing. Thanks Larry and Inbar for all your time and assistance! I'll report back if they have a solution. – RandyB Dec 24 '20 at 19:24
  • Saw your second update. This would explain it. However, you may want to start from the requirements and explain what you're trying to do. We got lost in the details. Maybe big picture would help here. – Inbar Gazit Dec 24 '20 at 23:37
  • I added another update and a pic of the server Word template. I hope this makes more sense. I've sent dozens of envelopes to DocuSign using this code and my Sandbox account and it works well -- for single documents. When I try to send more than 1 "templated" document is where I run into these signing issues. Please let me know if you need more information. – RandyB Dec 25 '20 at 13:51

2 Answers2

1

DocuSign Customer Service put me in touch with a Developer Support Representative who was VERY patient and helpful. 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. The first item was mentioned above: you must have the Anchor Population Scope value in your account set to "Document". This has to be done by a DocuSign Customer Service rep as the setting is not user accessible.

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

Here's the sample JSON which works for me:

  {
  "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!

RandyB
  • 325
  • 4
  • 13
0

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.
Larry K
  • 47,808
  • 15
  • 87
  • 140
  • I'm using the Sandbox account for testing. I'm seeing this setting: Automatically replicate information in fields with the same Data Label. This is currently set to "On an individual document". Is this what you are referring to? For this initial testing, all the documents can use the same template. When moving forward, I'll need to be able to assign a specific template to specific documents. (Some documents have field data to be filled out and returned to Connect.) Thanks! I'll look at this some more. – RandyB Dec 21 '20 at 22:51
  • 1
    No, I'm talking a backend setting for your account. Contact customer service if you want it changed. – Larry K Dec 22 '20 at 15:56
  • Will do. Thanks! – RandyB Dec 22 '20 at 18:34
  • I had the setting changed, but it made things worse. Please see the updates in the original post. – RandyB Dec 23 '20 at 23:40