user3002092
user3002092

Reputation: 625

How do I docuSign multiple documents in an envelope once using docuSign Rest API?

I am creating composite templates that work correctly and I'm running into this issue.

I am adding 2 templates to sign via docusign. I set the routing orders for both of them as shown below:

 Form 1  
    Order 1   RoleName signer       [email protected]
    Order 2   RoleName signer2      [email protected]
 Form 2
    Order 1   RoleName dataEntry    [email protected]
    Order 2   RoleName dataEntry2   [email protected]

This will send one email to [email protected]. This user completes all of his fields for both Form 1 and Form 2 in one request. This is what I want and expect. However, when [email protected] completes their process, [email protected] will receive 2 different emails. One to sign form 1 and the other to sign form 2. I'm trying to understand why [email protected] doesn't work the same as [email protected]. Can someone help explain what the reason is for receiving 2 separate emails for [email protected] may be and if there's a way to fix it?

Note: When I do this via the docuSign website, it doesn't allow for the same recipient to be in that same routingOrder. It will bring up the error:

  The role 'signer' conflicts with 'dataEntry'
  The role 'signer2' conflicts with 'dataEntry2'

This behavior seemed strange to me since I'm able to send the envelope using the docusign rest API. If somebody could give me some clarification on this as well I'd appreciate it.

Thank you!

Upvotes: 1

Views: 1972

Answers (1)

Kim Brandl
Kim Brandl

Reputation: 13500

I am unable to repro the issue you describe. Here's what I did, and the Result:

  • I created two separate templates in DocuSign, each having a single document and two recipients/signers (with Role Names and Routing Orders that you specify above in your question).

  • I used the REST API (JSON request included below) to create/send an Envelope from these two Templates, specifying identical recipient information (name/email/recipient ID/routing order) for Recipient 1 and Recipient 2 across both Inline Template structures.

  • Result: Recipient 1 receives an email first, opens the envelope, and signs both documents at once. Then Recipient 2 receives an email, opens the envelope, and signs both documents at once. The Envelope status is "Completed" at that point.

I've included my API request below for your reference -- perhaps compare/contrast this with what you're doing? Also -- make sure that Recipient information (Name / Email / Recipient ID / Routing Order) is identical (including case) for each recipient between the first Inline Template and the second Inline template within the API Request -- any small difference in Name/Email/Recipient Id/Routing Order, and DocuSign will treat them as different/separate people (recipients).

POST https://{{env}}.docusign.net/restapi/{{version}}/accounts/{{acctId}}/envelopes

{
  "emailSubject": "Please sign",
  "emailBlurb": "Please sign...thanks!",
  "status": "sent",
  "compositeTemplates": [
  {
    "serverTemplates": [
    {
        "sequence" : 1,
        "templateId": "TEMPLATE_ID_1"
    }],
    "inlineTemplates": [
    {
        "sequence" : 2,
        "recipients": {
            "signers" : [{
                "email": "[email protected]",
                "name": "Adam Adamson",
                "recipientId": "1",
                "roleName": "signer",
                "routingOrder": "1"
              },
              {
                "email": "[email protected]",
                "name": "Bob Burns",
                "recipientId": "2",
                "roleName": "signer2",
                "routingOrder": "2"
              }
            ]
        }
    }]
  },
  {
    "serverTemplates": [
    {
        "sequence" : 1,
        "templateId": "TEMPLATE_ID_2"
    }],
    "inlineTemplates": [
    {
        "sequence" : 2,
        "recipients": {
            "signers" : [{
                "email": "[email protected]",
                "name": "Adam Adamson",
                "recipientId": "1",
                "roleName": "dataEntry",
                "routingOrder": "1"
              },
              {
                "email": "[email protected]",
                "name": "Bob Burns",
                "recipientId": "2",
                "roleName": "dataEntry2",
                "routingOrder": "2"
              }
            ]
        }
    }]
  }]  
}

Upvotes: 3

Related Questions