Docusignapi Docusign上的eventNotification没有响应
希望使用nodejs SDK使用webhook进行事件通知,但没有对我的端点进行任何ping,并且在DocuSign沙箱站点的连接部分中没有看到任何失败 尝试使用此配方中的代码:-但这是针对较旧版本的API的,并且已损坏 以下是我最后要做的:Docusignapi Docusign上的eventNotification没有响应,docusignapi,webhooks,Docusignapi,Webhooks,希望使用nodejs SDK使用webhook进行事件通知,但没有对我的端点进行任何ping,并且在DocuSign沙箱站点的连接部分中没有看到任何失败 尝试使用此配方中的代码:-但这是针对较旧版本的API的,并且已损坏 以下是我最后要做的: function setNotifications() { // and an eventNotification object which sets the parameters for // webhook notificat
function setNotifications() {
// and an eventNotification object which sets the parameters for
// webhook notifications to us from the DocuSign platform
var envelopeEvents = [];
var envelopeEvent = new docusign.EnvelopeEvent();
envelopeEvent.envelopeEventStatusCode = "sent";
envelopeEvents.push(envelopeEvent);
envelopeEvent = new docusign.EnvelopeEvent();
envelopeEvent.envelopeEventStatusCode = "delivered";
envelopeEvents.push(envelopeEvent);
envelopeEvent = new docusign.EnvelopeEvent();
envelopeEvent.envelopeEventStatusCode = "completed";
envelopeEvents.push(envelopeEvent);
envelopeEvent = new docusign.EnvelopeEvent();
envelopeEvent.envelopeEventStatusCode = "declined";
envelopeEvents.push(envelopeEvent);
envelopeEvent = new docusign.EnvelopeEvent();
envelopeEvent.envelopeEventStatusCode = "voided";
envelopeEvents.push(envelopeEvent);
var recipientEvents = [];
var recipientEvent = new docusign.RecipientEvent();
recipientEvent.recipientEventStatusCode = "Sent";
recipientEvents.push(recipientEvent);
recipientEvent = new docusign.RecipientEvent();
recipientEvent.recipientEventStatusCode = "Delivered";
recipientEvents.push(recipientEvent);
recipientEvent = new docusign.RecipientEvent();
recipientEvent.recipientEventStatusCode = "Completed";
recipientEvents.push(recipientEvent);
recipientEvent = new docusign.RecipientEvent();
recipientEvent.recipientEventStatusCode = "Declined";
recipientEvents.push(recipientEvent);
recipientEvent = new docusign.RecipientEvent();
recipientEvent.recipientEventStatusCode = "AuthenticationFailed";
recipientEvents.push(recipientEvent);
recipientEvent = new docusign.RecipientEvent();
recipientEvent.recipientEventStatusCode = "AutoResponded";
recipientEvents.push(recipientEvent);
var eventNotification = new docusign.EventNotification();
eventNotification.url = "https://MY_PUBLICLY_OPEN_URL";
eventNotification.loggingEnabled = "true";
eventNotification.requireAcknowledgment = "false" ;
eventNotification.useSoapInterface = "false";
eventNotification.includeCertificateWithSoap = "false";
eventNotification.signMessageWithX509Cert = "false";
eventNotification.includeDocuments = "false";
eventNotification.includeEnvelopeVoidReason = "true";
eventNotification.includeTimeZone = "true";
eventNotification.includeSenderAccountAsCustomField = "true";
eventNotification.includeDocumentFields = "true";
eventNotification.includeCertificateOfCompletion = "true";
eventNotification.envelopeEvents = envelopeEvents;
eventNotification.recipientEvents = recipientEvents;
return eventNotification;
}
var envDef = new docusign.EnvelopeDefinition();
envDef.eventNotification = setNotifications();
编辑->这是来自DocuSign日志的请求跟踪
POST https://demo.docusign.net:7802/restapi/v2/accounts/cc9747f3-0484-481c-8517-9a4cf0b23fc7/envelopes
TraceToken: bf38acf5-7cda-43ad-86e8-c89e36c5bb36
Timestamp: 2018-07-13T21:57:42.4983873Z
Content-Length: 1130
Content-Type: application/json
{
"envelopeId": "a uuid",
"uri": "/envelopes/a uuid",
"statusDateTime": "2018-07-13T21:57:42.1234037Z",
"status": "sent"
}
Accept: application/json
Authorization: Bearer [omitted]
Host: demo.docusign.net
User-Agent: node-superagent/3.8.2
X-DocuSign-SDK: Node
X-Cnection: close
X-SecurityProtocol-Version: TLSv1.2
X-SecurityProtocol-CipherSuite: nope
x-forwarded-for: nope
{"emailSubject":"a subject",
"templateId":"a uuid",
"templateRoles": [{"roleName":"Signee","name":"Chris Watkins","email":"an email"}],
"status":"sent",
"eventNotification":{
"url":"a url",
"loggingEnabled":"true",
"requireAcknowledgment":"false",
"useSoapInterface":"false",
"includeCertificateWithSoap":"false",
"signMessageWithX509Cert":"false",
"includeDocuments":"false",
"includeEnvelopeVoidReason":"true",
"includeTimeZone":"true",
"includeSenderAccountAsCustomField":"true",
"includeDocumentFields":"true",
"includeCertificateOfCompletion":"true",
"envelopeEvents":[
{"envelopeEventStatusCode":"Sent"},
{"envelopeEventStatusCode":"Delivered"},
{"envelopeEventStatusCode":"Completed"},
{"envelopeEventStatusCode":"Declined"},
{"envelopeEventStatusCode":"Voided"}],
"recipientEvents":
[
{"recipientEventStatusCode":"Sent"},
{"recipientEventStatusCode":"Delivered"},
{"recipientEventStatusCode":"Completed"},
{"recipientEventStatusCode":"Declined"},
{"recipientEventStatusCode":"AuthenticationFailed"},
{"recipientEventStatusCode":"AutoResponded"}]}}
201 Created
Content-Type: application/json; charset=utf-8
X-DocuSign-TraceToken: bf38acf5-7cda-43ad-86e8-c89e36c5bb36
其余的工作正在进行中-文档已发送,我可以使用API检查信封状态(这是我的备份)。有什么想法吗?我不知道如何捕获nodejs发出的实际HTTP请求,但是如果有帮助的话,我很乐意使用指令来捕获
此外,更新文档将非常有帮助
谢谢 马上,你的代码看起来不错 建议:
url
设置是否以“”开头?仅支持httpsrequirecanowledment
设置为“true”如果仍然存在问题,我们可以继续调查。很好的建议。使用帐户级别的连接,我可以看到日志条目(由于我端的SSL证书不正确而导致的失败)。不使用帐户级别的Connect,我既看不到条目也看不到失败。为问题添加了跟踪。信封已“发送”,流程的其余部分工作正常。不用担心样本-非常感谢您将各种SDK组合在一起,并为不同平台提供了配方。非常感谢。