I have created 1 envelope with 2 composite templates with embedded signing and I can hook it up with the webhook event notification to receive a message once users finish signing, so I can try to update my db and download the file. However, the webhook response does not have the custom fields that I need to identify which file belong to which for me to update the db row.
This is my json serialized envelope example. Notice the custom field on each inline template, that have the property of DocuInfoId. I will need the value of those to update my db row
{
"status": "sent",
"emailSubject": "DocuSign API - Template Example",
"eventNotification": {
"url": "https:\/\/mytestsite.net\/api\/documentstuff\/docusign\/available",
"loggingEnabled": "false",
"requireAcknowledgment": "true",
"useSoapInterface": "false",
"soapNameSpace": "",
"includeCertificateWithSoap": "false",
"signMessageWithX509Cert": "false",
"includeDocuments": "false",
"includeEnvelopeVoidReason": "false",
"includeTimeZone": "true",
"includeSenderAccountAsCustomField": "false",
"includeDocumentFields": "false",
"includeCertificateOfCompletion": "true",
"envelopeEvents": [
{
"envelopeEventStatusCode": "Sent",
"includeDocuments": null
},
{
"envelopeEventStatusCode": "Completed",
"includeDocuments": "true"
}
],
"recipientEvents": [
{
"recipientEventStatusCode": "Completed",
"includeDocuments": "true"
}
]
},
"compositeTemplates": [
{
"inlineTemplates": [
{
"sequence": "1",
"recipients": {
"signers": [
{
"clientUserId": "1",
"recipientId": "1",
"email": "testemail@test.com",
"name": "Client Name",
"roleName": "Client",
"tabs": {
"TextTabs": "Just a bunch of text tabs, radio group, etc"
}
},
{
"clientUserId": "2",
"recipientId": "2",
"email": "testemail@test.com",
"name": "Owner Name",
"roleName": "Owner",
"tabs": null
}
]
},
"customFields": {
"ListCustomFields": [
{
"name": "DocuInfoId",
"required": "True",
"show": "False",
"value": "77",
"listItems": null
},
{
"name": "OpportunityId",
"required": "True",
"show": "False",
"value": "1",
"listItems": null
}
]
}
}
],
"serverTemplates": [
{
"sequence": "1",
"templateId": "TemplateIDNumber1"
}
]
},
{
"inlineTemplates": [
{
"sequence": "2",
"recipients": {
"signers": [
{
"clientUserId": "1",
"recipientId": "1",
"email": "testemail@test.com",
"name": "Client Name",
"roleName": "Client",
"tabs": {
"TextTabs": "Just another bunch of text tabs, radio group tab, etc"
}
}
]
},
"customFields": {
"ListCustomFields": [
{
"name": "DocuInfoId",
"required": "True",
"show": "False",
"value": "88",
"listItems": null
},
{
"name": "OpportunityId",
"required": "True",
"show": "False",
"value": "1",
"listItems": null
}
]
}
}
],
"serverTemplates": [
{
"sequence": "2",
"templateId": "TemplateIDNumber2"
}
]
}
]
}
And once I finished signing, the webhook event notification is triggered and called my api with this response message
{
"EnvelopeStatus": {
"EnvelopeID": "EnvelopeIDGivenByDocusign",
"Status": "Completed",
"CustomFields": [
{
"Name": "ContactID",
"Show": "True",
"Required": "False",
"Value": ""
},
{
"Name": "OpportunityID",
"Show": "True",
"Required": "False",
"Value": ""
},
{
"Name": "AccountID",
"Show": "True",
"Required": "False",
"Value": ""
},
{
"Name": "DocuInfoId",
"Show": "False",
"Required": "True",
"Value": "88"
},
{
"Name": "OpportunityId",
"Show": "False",
"Required": "True",
"Value": "1"
},
{
"Name": "LQAID",
"Show": "True",
"Required": "False",
"Value": ""
}
],
"DocumentStatuses": [
{
"ID": 1,
"Name": "Document - TX - 1001.pdf",
"TemplateName": "Document - TX",
"Sequence": 1
},
{
"ID": 2,
"Name": "Rejection.pdf",
"TemplateName": "Rejection Form",
"Sequence": 2
}
]
},
"DocumentPDFs": [
{
"Name": "Document - TX - 1001.pdf",
"DocumentID": "1",
"DocumentType": "CONTENT"
},
{
"Name": "Rejection.pdf",
"DocumentID": "2",
"DocumentType": "CONTENT"
},
{
"Name": "CertificateOfCompletion_78sd89fuas89sadf.pdf",
"DocumentID": null,
"DocumentType": "SUMMARY"
}
]
}
Looking at the response, there's only 1 docuinfoid with the value of 88, I'm also not sure where is the rest of custom field coming from e.g: "LQAID". Now, I'm not sure which docuinfoid is this belong to, the first pdf file (Document - TX - 1001.pdf) or the second pdf file (Rejection.pdf).
Is there anyway to know which pdf document belong to which docuinfoid, so that I can attach it to my database correctly?