1

I am trying to use the same server template for 3 different documents. I was assuming that by using 3 different composite templates, I could accomplish this. Instead, what I am seeing is that the first document is repeated 3 times in the envelope. Here is the request:

 {
  "customFields": {
    "textCustomFields": [
      {
        "name": "Cartus file id",
        "value": "1823456"
      }
    ]
  },
  "eventNotification": {
    "url": "http://requestb.in/p2qfvfp2",
    "loggingEnabled": "true",
    "requireAcknowledgment": "true",
    "envelopeEvents": [
      {
        "envelopeEventStatusCode": "Delivered"
      },
      {
        "envelopeEventStatusCode": "Completed"
      },
      {
        "envelopeEventStatusCode": "Declined"
      },
      {
        "envelopeEventStatusCode": "Voided"
      },
      {
        "envelopeEventStatusCode": "Sent"
      }
    ],
    "useSoapInterface": "false",
    "includeCertificateWithSoap": "false",
    "signMessageWithX509Cert": "false",
    "includeDocuments": "false",
    "includeEnvelopeVoidReason": "false",
    "includeTimeZone": "true",
    "includeSenderAccountAsCustomField": "true",
    "includeDocumentFields": "true",
    "includeCertificateOfCompletion": "false"
  },
  "compositeTemplates": [
    {
      "compositeTemplateId": "1",
      "serverTemplates": [
        {
          "sequence": "1",
          "templateId": "4e2f0e2d-9888-xxxx-8da3-bbf70163233f"
        }
      ],
      "inlineTemplates": [
        {
          "sequence": "2",
          "recipients": {
            "signers": [
              {
                "name": "Kathy Gilbert",
                "email": "KathyGilbert11@xxx.com",
                "recipientId": "1",
                "customFields": [
                  "this is the buyer"
                ],
                "routingOrder": "1",
                "roleName": "##Buyer1"
              },
              {
                "name": "Kathy Langdon",
                "email": "KathyLangdon1@xxx.com",
                "recipientId": "2",
                "customFields": [
                  "this is the seller"
                ],
                "routingOrder": "2",
                "roleName": "##Seller1"
              }
            ],
            "certifiedDeliveries": [
              {
                "name": "Kathy Lori",
                "email": "kathylori@xxx.com",
                "recipientId": "3",
                "accessCode": "12345",
                "routingOrder": "3",
                "roleName": "##OtherPerson"
              }
            ]
          }
        }
      ],
      "document": {
        "documentId": "1",
        "name": "Here is document one of the test.docx",
        "fileExtension": "docx",
        "documentFields": [
          {
            "name": "Doc1Info",
            "value": "here is doc1 info"
          }
        ]
      }
    },
    {
      "compositeTemplateId": "2",
      "serverTemplates": [
        {
          "sequence": "1",
          "templateId": "4e2f0e2d-9888-xxxx-8da3-bbf70163233f"
        }
      ],
      "inlineTemplates": [
        {
          "sequence": "3",
          "recipients": {
            "signers": [
              {
                "name": "Kathy Gilbert",
                "email": "KathyGilbert11@xxx.com",
                "recipientId": "1",
                "customFields": [
                  "this is the buyer"
                ],
                "routingOrder": "1",
                "roleName": "##Buyer1"
              }
            ],
            "certifiedDeliveries": [
              {
                "name": "Kathy Lori",
                "email": "kathylori@xxx.com",
                "recipientId": "3",
                "accessCode": "12345",
                "routingOrder": "3",
                "roleName": "##OtherPerson"
              }
            ]
          }
        }
      ],
      "document": {
        "documentId": "2",
        "name": "Here is document two of the test",
        "fileExtension": "docx",
        "documentFields": [
          {
            "name": "Doc2Info",
            "value": "here is doc2 info"
          }
        ]
      }
    },
    {
      "compositeTemplateId": "3",
      "serverTemplates": [
        {
          "sequence": "1",
          "templateId": "4e2f0e2d-9888-xxxx-8da3-bbf70163233f"
        }
      ],
      "inlineTemplates": [
        {
          "sequence": "2",
          "recipients": {
            "signers": [
              {
                "name": "Kathy Gilbert",
                "email": "KathyGilbert11@xxx.com",
                "recipientId": "1",
                "customFields": [
                  "this is the buyer"
                ],
                "routingOrder": "1",
                "roleName": "##Buyer1"
              },
              {
                "name": "Kathy Langdon",
                "email": "KathyLangdon1@xxx.com",
                "recipientId": "2",
                "customFields": [
                  "this is the seller"
                ],
                "routingOrder": "2",
                "roleName": "##Seller1"
              }
            ],
            "certifiedDeliveries": [
              {
                "name": "Kathy Lori",
                "email": "kathylori@xxx.com",
                "recipientId": "3",
                "accessCode": "12345",
                "routingOrder": "3",
                "roleName": "##OtherPerson"
              }
            ]
          }
        }
      ],
      "document": {
        "documentId": "3",
        "name": "Here is document three of the test",
        "fileExtension": "docx",
        "documentFields": [
          {
            "name": "Doc3Info",
            "value": "here is doc3 info"
          }
        ]
      }
    }
  ],
  "status": "sent",
  "emailSubject": "Please sign the following document at 9:26 AM"
}

Like I said, document1.docx was repeated 3 times in the envelope ( these documents are only 1 page each ).

Larry K
  • 47,808
  • 15
  • 87
  • 140
Kathy Lori
  • 487
  • 6
  • 21

1 Answers1

1

You are not specifying the Document bytes in your Composite Template.

Since the Document bytes are not included in your Composite template, the Server templates documents will be used to create the envelope. That's the reason you are seeing the same doc from the server template being repeated three times.

Change your document property in each composite template as below. I have added the documentBase64 property.

  "document": {
    "documentId": "1",
    "name": "Here is document one of the test.docx",
    "fileExtension": "docx",
    "documentFields": [
      {
        "name": "Doc1Info",
        "value": "here is doc1 info"
      }
    ],
    "documentBase64" : "[Include the base64 of the .docx file here]"
  }
Praveen Reddy
  • 7,295
  • 2
  • 21
  • 43
  • 1
    I'll tell you what happened. I modified the document object to have a [JsonIgnore] attribute on the base64 byte array because when I'm testing and I print out the json object, I didn't want to print out that whole array. I uncommented out that attribute and the 3 documents came thru as expected. You've been a great help to me. – Kathy Lori Mar 02 '17 at 16:28