我无法弄清楚为什么这里提供的唯一文件是第一个。 doc 1上的角色是:买方,卖方,doc2有卖方和律师,doc3有买方和卖方。我特意为律师留下了模板角色。这是信封定义的样子:
{
"documents": [
{
"documentId": "1",
"name": "Here is document one of the test.docx",
"fileExtension": "docx",
"documentFields": [
{
"name": "Doc1Info",
"value": "here is doc1 info"
}
],
"documentBase64": [bytearray]
},
{
"documentId": "2",
"name": "Here is document two of the test",
"fileExtension": "docx",
"documentFields": [
{
"name": "Doc2Info",
"value": "here is doc2 info"
}
],
"documentBase64": [bytearray]
},
{
"documentId": "3",
"name": "Here is document three of the test",
"fileExtension": "docx",
"documentFields": [
{
"name": "Doc3Info",
"value": "here is doc3 info"
}
],
"documentBase64": [bytearray]
}
],
"customFields": {
"textCustomFields": [
{
"name": "My file id",
"value": "1823456"
}
]
},
"eventNotification": {
"url": "http://requestb.in/opiu2bop",
"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"
},
"templateId": "xxxx-ad34-4a2e-a375-069ce2df630c",
"templateRoles": [
{
"email": "KathyGilbert11@xxx.com",
"roleName": "##Buyer1",
"name": "Kathy Gilbert",
"routingOrder": "1"
},
{
"email": "KathyLangdon1@xxx.com",
"roleName": "##Seller1",
"name": "Kathy Langdon",
"routingOrder": "2"
}
],
"status": "sent",
"emailSubject": "Please sign the following document at 9:49 AM"
答案 0 :(得分:2)
这与角色无关。因为您正在指定" ServerTemplate"在您的请求中以及一些其他文档。这被视为复合模板。
在单个复合模板中,您只能覆盖一个文档。您必须在请求中使用多个CompositeTemplates来覆盖所有三个文档。
这是一个工作代码,它覆盖服务器模板上的多个文档。我在下面简化了您的示例(删除了连接和自定义字段相关信息)。如果您重新添加该信息,它仍然可以工作。
提示:如果要保留服务器模板中的文档,可以将第一个复合模板(ID:1)中指定的Document(documentId:1)移动到第二个CompositeTemplate(ID:2)。除了serverTemplate上的文档
之外,最后一个信封还将包含3个文档 {
"emailSubject": "Testing multiple docs",
"status": "sent",
"compositeTemplates": [
{
"compositeTemplateId": "1",
"serverTemplates": [
{
"sequence": "1",
"templateId": "XXXXXX-2f8a-4cfc-907b-4c84cb523426"
}
],
"inlineTemplates": [
{
"sequence": "2",
"recipients": {
"signers": [
{
"name": "Byer One",
"email": "buyerone@acme.com",
"roleName": "##Buyer1",
"recipientId": "1",
"routingOrder": "1",
}
]
}
}
],
"document": {
"documentId": "1",
"name": "Here is document one of the test",
"fileExtension": "docx",
"documentBase64": "[Bytes Removed]"
}
},
{
"compositeTemplateId": "2",
"inlineTemplates": [
{
"sequence" : "3",
"documents": [
{
"documentId": "2",
"name": "Here is document two of the test",
"fileExtension": "docx",
"documentBase64": "[Bytes Removed]"
},
{
"documentId": "3",
"name": "Here is document three of the test",
"fileExtension": "docx",
"documentBase64": "[Bytes Removed]"
}
]
}
]
}
]
}