Docusign复合模板未发送正确的文档

时间:2017-03-02 14:38:36

标签: docusignapi docusigncompositetmplts

我正在尝试为3个不同的文档使用相同的服务器模板。我假设通过使用3种不同的复合模板,我可以实现这一点。相反,我所看到的是第一个文件在信封中重复了3次。这是请求:

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

就像我说的那样,document1.docx在信封中重复了3次(这些文件每个只有1页)。

1 个答案:

答案 0 :(得分:1)

您没有在复合模板中指定文档字节。

由于Document字节未包含在Composite模板中,因此将使用Server模板文档来创建信封。这就是您看到服务器模板中的相同文档重复三次的原因。

更改每个复合模板中的文档属性,如下所示。我添加了 documentBase64 属性。

eval