问题描述
我创建了1个包含2个带有嵌入式签名的复合模板的信封,我可以将其与webhook事件通知挂钩,以在用户完成签名后接收到消息,因此我可以尝试更新数据库并下载文件。但是,webhook响应没有自定义字段,我不需要我来标识哪个文件属于我来更新数据库行。
这是我的json序列化信封示例。请注意,每个内联模板上的自定义字段都具有DocuInfoId的属性。我将需要这些值来更新我的数据库行
{
status:已发送,
emailSubject: DocuSign API-模板示例,
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:已发送,
includeDocuments:null
},
{
envelopeEventStatusCode: mpleted,
includeDocuments: true
}
],
recipientEvents:[
{
recipientEventStatusCode:已完成 ,
includeDocuments: true
}
]
},
compositeTemplates:[
{
inlineTemplates: [
{
sequence: 1,
recipients:{
signers:[
{
clientUserId: 1,
recipientId: 1,
email: [email protected],
name:客户名称,
roleName :客户,
标签:{
TextTabs:只是一堆文本标签,广播组等
}
},
{
clientUserId: 2,
recipientId: 2,
email: [email protected],
name:所有者名称,
roleName:所有者,
tabs:空
}
]
},
customFields:{
ListCustomFields:[
{
name: DocuInfoId,
required: True,
show : False,
value: 77,
listItems:空
},
{
name: OpportunityId,
required: True,
show: False,
value: 1,
listItems:空
}
]
}
}
],
serverTemplates:[
{
sequence: 1,
templateId: TemplateIDNumber1
}
]
},
{
inlineTemplates:[
{
sequence: 2,
收件人:{
signers:[
{
clientUserId: 1,
recipientId: 1,
email: [email protected],
name:客户名称,
roleName:客户 ,
tabs:{
TextTabs:只是另一堆文本标签,单选按钮等)
}
}
]
},
customFields:{
ListCustomFields:[
{
name: DocuInfoId,
required: True,
显示:假,
值: 88,
listItems:空
},
{
name : OpportunityId,
必填: True,
show: False ,
value: 1,
listItems:空
}
]
}
}
],
serverTemplates:[
{
sequence: 2,
templateId: TemplateIDNumber2
}
]
}
]
}
当我完成签名后,Webhook事件通知被触发并使用此响应消息调用我的api
{
EnvelopeStatus:{
EnvelopeID: EnvelopeIDGivenByDocusign,
Status: Completed,
CustomFields:[
{
Name: ContactID,
显示:真实,
必需:错误,
值:
},
{
名称: OpportunityID,
显示: True,
必需: False,
值:
},
{
名称:帐户ID,
显示:真实,
必填: False,
值:
},
{
Name: DocuInfoId,
Show: False,
Required: True,
Value: 88
},
{
Name: OpportunityId,
Show: False,
Required: True,
值: 1
},
{
名称: LQAID,
显示:真,
必需 : False,
Value:
}
],
DocumentStatuses:[
{
ID:1,
名称:文档-TX-1001.pdf,
模板名称:文档-TX,
序列:1
},
{
ID:2,
名称: Rejection.pdf,
TemplateName:拒绝表格,
序列:2
}
]
},
DocumentPDFs: [
{
名称:文档-TX-1001.pdf,
文档ID: 1,
文档类型:内容
},
{
Name: Rejection.pdf,
DocumentID: 2,
DocumentType:内容
} ,
{
名称: CertificateOfCompletion_78sd89fuas89sadf.pdf,
DocumentID:空,
DocumentType:摘要
}
]
}
看看响应,只有1个docuinfoid的值为88,我也不确定自定义字段的其余部分在哪里,例如: LQAID。现在,我不确定第一个pdf文件(文档-TX-1001.pdf)或第二个pdf文件(Rejection.pdf)属于哪个docuinfoid。
无论如何,是否知道哪个pdf文档属于哪个docuinfoid,以便我可以将其正确地附加到我的数据库?
您可以为每个CompositeTemplate设置CompositeTemplateId,然后在每个信封的自定义字段中使用此ID。我已经修改了您的JSON请求,以包含CompositeTemplateId,
{
$现在,当您收到WebHook响应时,您将能够知道哪个复合模板下面的自定义字段。我还有一个建议,因为您没有使用任何下拉菜单,所以最好使用
status: sent,
emailSubject: DocuSign API-模板示例,
eventNotification:{
url: https:\ / \ / mytestsite.net\ / api\ / documentstuff doc / 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:已发送,
includeDocuments:null
},
{
envelopeEventStatusCode :已完成,
includeDocuments: true
}
],
recipientEvents:[
{
recipientEventStatusCode: Completed,
includeDocuments: true
}
]
},
compositeTemplates:[
{
CompositeTemplateId: 1,
inlineTemplates:[
{
sequence: 1,
收件人:{
签名者: [
{
clientUserId: 1,
recipientId: 1,
email: [email protected],
名称:客户端名称,
角色名称:客户端,
标签:{
TextTabs:只是一堆文本标签,单选组等
}
},
{
clientUserId: 2,
recipientId: 2,
e mail: [email protected],
名称:所有者名称,
roleName:所有者,
标签:空
}
]
},
customFields:{
ListCustomFields:[
{
name: DocuInfoId_1,
required: True,
show: False,
value: 77,
listItems:空
},
{
name: OpportunityId_1,
required: True,
show: False,
value: 1,
listItems:空
}
]
}
}
],
serverTemplates:[
{
sequence: 1,
templateId: TemplateIDNumber1
}
]
},
{
compositeTemplateId: 2,
inlineTemplates:[
{
sequence: 2,
收件人:{
signers:[
{
clientUserId: 1,
recipientId: 1,
email: [email protected] ,
name:客户名称,
roleName:客户,
tabs:{
TextTabs:标签,单选组标签等
}
}
]
},
customFields:{
ListCustomFields:[
{
name: DocuInfoId_2,
required: True,
show: False,
value: 88,
listItems:空
},
{
name: Opp ortunityId_2,
必需: True,
显示: False,
值: 1,
listItems:空
}
]
}
}
],
serverTemplates:[
{
sequence: 2,
templateId: TemplateIDNumber2
}
]
}
]
}
TextCustomFields
而不是ListCustomFields
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": "[email protected]", "name": "Client Name", "roleName": "Client", "tabs": { "TextTabs": "Just a bunch of text tabs, radio group, etc" } }, { "clientUserId": "2", "recipientId": "2", "email": "[email protected]", "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": "[email protected]", "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?
解决方案You can set compositeTemplateId for each CompositeTemplate and then use this Id in each envelope Custom Field. I have modified your JSON request to include CompositeTemplateId,
{ "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": [ { "compositeTemplateId": "1", "inlineTemplates": [ { "sequence": "1", "recipients": { "signers": [ { "clientUserId": "1", "recipientId": "1", "email": "[email protected]", "name": "Client Name", "roleName": "Client", "tabs": { "TextTabs": "Just a bunch of text tabs, radio group, etc" } }, { "clientUserId": "2", "recipientId": "2", "email": "[email protected]", "name": "Owner Name", "roleName": "Owner", "tabs": null } ] }, "customFields": { "ListCustomFields": [ { "name": "DocuInfoId_1", "required": "True", "show": "False", "value": "77", "listItems": null }, { "name": "OpportunityId_1", "required": "True", "show": "False", "value": "1", "listItems": null } ] } } ], "serverTemplates": [ { "sequence": "1", "templateId": "TemplateIDNumber1" } ] }, { "compositeTemplateId": "2", "inlineTemplates": [ { "sequence": "2", "recipients": { "signers": [ { "clientUserId": "1", "recipientId": "1", "email": "[email protected]", "name": "Client Name", "roleName": "Client", "tabs": { "TextTabs": "Just another bunch of text tabs, radio group tab, etc" } } ] }, "customFields": { "ListCustomFields": [ { "name": "DocuInfoId_2", "required": "True", "show": "False", "value": "88", "listItems": null }, { "name": "OpportunityId_2", "required": "True", "show": "False", "value": "1", "listItems": null } ] } } ], "serverTemplates": [ { "sequence": "2", "templateId": "TemplateIDNumber2" } ] } ] }
Now, when you will receive WebHook response, you will be able to know which custom fields below to which composite template. I have one more suggestion, since you are not using any dropdowns, then it is better to use
TextCustomFields
instead ofListCustomFields
.这篇关于Docusign Webhook消息没有办法区分不同的CompositeTemplate的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!