Reputation: 497
I can't figure out why the only document that gets delivered here is the first one. The roles on doc 1 are : buyer, seller, doc2 has seller and lawyer, doc3 has buyer and seller. I purposely left off a template role for lawyer. Here is what the envelope definition looks like:
{
"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": "[email protected]",
"roleName": "##Buyer1",
"name": "Kathy Gilbert",
"routingOrder": "1"
},
{
"email": "[email protected]",
"roleName": "##Seller1",
"name": "Kathy Langdon",
"routingOrder": "2"
}
],
"status": "sent",
"emailSubject": "Please sign the following document at 9:49 AM"
Upvotes: 0
Views: 74
Reputation: 7393
This has nothing to do with roles. Since you are specifying "ServerTemplate" in your request along with some additional documents. This is considered as a compositeTemplate.
In a single Composite Template you can only overlay ONE document. You will have to use multiple CompositeTemplates in your request to overlay all the three documents.
Here is a working code which overlays multiple documents on a server template. I have simplified your example below(removed connect & custom field related info). It should still work if you add that information back.
Tip: If you want to retain the documents in your server Template, you can move the Document(documentId:1) specified in the first Composite Template( ID:1) to the second CompositeTemplate (ID:2). The final envelope will have 3 more documents in addition to the documents on your serverTemplate
{
"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": "[email protected]",
"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]"
}
]
}
]
}
]
}
Upvotes: 2