Java DocuSign事件通知包括在REST AP上被忽略的文档
我正在尝试在docusign中为信封事件和收件人事件设置事件通知,但是没有得到预期的结果 我使用的是官方JavaSDK中的java模型,因此我认为这是正确的 因此,我的守则是:Java DocuSign事件通知包括在REST AP上被忽略的文档,java,docusignapi,Java,Docusignapi,我正在尝试在docusign中为信封事件和收件人事件设置事件通知,但是没有得到预期的结果 我使用的是官方JavaSDK中的java模型,因此我认为这是正确的 因此,我的守则是: private EventNotification createEventNotificationForRequest() { EventNotification eventNotification = new EventNotification(); eventNotification.setUrl(
private EventNotification createEventNotificationForRequest()
{
EventNotification eventNotification = new EventNotification();
eventNotification.setUrl(webhooksEnvelopeUpdateUrl);
envelopeEventToIncludeDocumentsMap.forEach(
(eventType, includeDocuments) ->
eventNotification.addEnvelopeEventsItem(
new EnvelopeEvent().envelopeEventStatusCode(eventType).includeDocuments(includeDocuments)));
recipientEventToIncludeDocumentsMap.forEach(
(eventType, includeDocuments) ->
eventNotification.addRecipientEventsItem(
new RecipientEvent().recipientEventStatusCode(eventType).includeDocuments(includeDocuments)));
return eventNotification;
}
使用创建的两个贴图:
//We want to be notified of all events, and receive a copy of the document if it is completed
// Map<EventType, IncludedDocumentsBooleanAsString>
private static Map<String, String> envelopeEventToIncludeDocumentsMap = ImmutableMap.<String, String>builder()
.put("Completed", TRUE)
.put("Declined", FALSE)
.put("Delivered", FALSE)
.put("Sent", FALSE)
.put("Voided", FALSE)
.build();
private static Map<String, String> recipientEventToIncludeDocumentsMap = ImmutableMap.<String, String>builder()
.put("AuthenticationFailed", FALSE)
.put("AutoResponded", FALSE)
.put("Completed", FALSE)
.put("Declined", FALSE)
.put("Delivered", FALSE)
.put("Sent", FALSE)
.build();
我对这种行为的预期是错误的,还是存在其他问题
有关发送的相关JSON的代码片段,请参见下文:
“事件通知”:{
“信封事件”:[
{
“envelopeEventStatusCode”:“已完成”,
“包含文档”:“真实”
},
{
“envelopeEventStatusCode”:“已拒绝”,
“包含文档”:“错误”
},
{
“envelopeEventStatusCode”:“已交付”,
“包含文档”:“错误”
},
{
“envelopeEventStatusCode”:“已发送”,
“包含文档”:“错误”
},
{
“envelopeEventStatusCode”:“作废”,
“包含文档”:“错误”
}
],
“recipientEvents”:[
{
“包含文件”:“错误”,
“recipientEventStatusCode”:“AuthenticationFailed”
},
{
“包含文件”:“错误”,
“recipientEventStatusCode”:“自动响应”
},
{
“包含文件”:“错误”,
“recipientEventStatusCode”:“已完成”
},
{
“包含文件”:“错误”,
“recipientEventStatusCode”:“已拒绝”
},
{
“包含文件”:“错误”,
“recipientEventStatusCode”:“已送达”
},
{
“包含文件”:“错误”,
“recipientEventStatusCode”:“已发送”
}
],
“url”:“{url_here}”
}
不幸的是,Connect的实现有一个bug。此时,您可以在连接通知消息中始终或从不接收信封的文档
如果您使用的是帐户级别的连接订阅,那么解决方法是创建两个订阅,一个订阅仅用于信封.Completed事件。然后只包括后一个订阅的文档
在本例中,您通过eventNotification对象使用每个信封订阅。每个信封可以有零个或一个这样的订阅
最佳实践建议:不要将信封的文档包含在事件通知中。它会导致POST通知非常大,并且通常难以处理(在DocuSign客户方面)。相反,根据需要,使用通知作为获取信封文档的触发器
另外,请务必始终将200回复返回给DocuSign。而且要快
推荐
当事件通知到达服务器时,将其添加到FIFO可靠队列中,并响应DocuSign
在单独的执行线程上,让一个或多个工作进程处理队列上的消息
不推荐
当事件通知到达服务器时,同步处理它。处理完毕后,请回复DocuSign
随着卷的增加,这种模式将导致大问题,导致服务器丢弃通知、重新发送造成延迟等。您不想去那里 嗨,拉里-谢谢你的回复。我们还没有使用Connect,只是将这些EventNotifications添加到RESTAPI请求中,但我认为它使用相同的后端,因此仍然适用,但是我们没有按照您的建议创建辅助订阅的选项。我们只希望在“一(完成)”状态中包含信封的文件,以便在工作时不会过于密集。在快速响应方面,我们确实也遵循您的最佳实践。对于解决这个问题的时间表有什么想法吗?再次感谢。您好@MitchKent--您好,Connect与eventNotification是同一个系统。“Connect”提供帐户级别的事件订阅,eventNotification提供信封级别的订阅。连接管理工具日志用于查看两种类型的事件订阅的日志信息。重新修复时间--当前未计划。请您的DocuSign联系人将您的联系信息添加到错误报告CONNECT-1279中
private EventNotification createEventNotificationForRequest()
{
EventNotification eventNotification = new EventNotification();
eventNotification.setUrl(webhooksEnvelopeUpdateUrl);
// BELOW LINE IS CHANGE
eventNotification.includeDocuments(TRUE);
envelopeEventToIncludeDocumentsMap.forEach(
(eventType, includeDocuments) ->
eventNotification.addEnvelopeEventsItem(
new EnvelopeEvent().envelopeEventStatusCode(eventType).includeDocuments(includeDocuments)));
recipientEventToIncludeDocumentsMap.forEach(
(eventType, includeDocuments) ->
eventNotification.addRecipientEventsItem(
new RecipientEvent().recipientEventStatusCode(eventType).includeDocuments(includeDocuments)));
return eventNotification;
}