2017-07-28 51 views
0

我試圖用EventNotification創建一個信封,以便我不必每15分鐘輪詢一次該狀態。INVALID_REQUEST_PARAMETER創建帶有通知的信封

在沒有通知的情況下提出創建信封的請求可以正常工作,所以這肯定與請求的eventNotification部分有關。

下面是完整的請求:

{ 
    "emailSubject": "Test Sending Envelope 2", 
    "eventNotification": { 
    "envelopeEvents": [ 
     { "envelopeEventStatusCode": "sent" }, 
     { "envelopeEventStatusCode": "delivered" }, 
     { "envelopeEventStatusCode": "completed" }, 
     { "envelopeEventStatusCode": "declined" }, 
     { "envelopeEventStatusCode": "voided" } 
    ], 
    "includeCertificateOfCompletion": "true", 
    "includeCertificateWithSoap": "false", 
    "includeDocumentFields": "true", 
    "includeDocuments": true, 
    "includeEnvelopeVoidReason": "true", 
    "includeSenderAccountAsCustomField": "true", 
    "includeTimeZone": "true", 
    "loggingEnabled": "true", 
    "recipientEvents": [ 
     { "includeDocuments": "Sent" }, 
     { "includeDocuments": "Delivered" }, 
     { "includeDocuments": "Completed" }, 
     { "includeDocuments": "Declined" }, 
     { "includeDocuments": "AuthenticationFailed" }, 
     { "includeDocuments": "AutoResponded" } 
    ], 
    "requireAcknowledgment": "true", 
    "signMessageWithX509Cert": "false", 
    "url": "https://arealurl/api/DocuSign-NotificationWebHook", 
    "useSoapInterface": "false" 
    }, 
    "status": "sent", 
    "templateId": "template-guid-4b95-guid-template", 
    "templateRoles": [ 
    { 
     "email": "[email protected]", 
     "name": "Someone Somewhere", 
     "roleName": "Something" 
    } 
    ] 
} 

這回來爲錯誤:

Error calling CreateEnvelope: { 
    "errorCode": "INVALID_REQUEST_PARAMETER", 
    "message": "The request contained at least one invalid parameter. Boolean value expected for parameter: includeDocuments" 
}. 

我已經與includeDocuments值試過被省略,將其設置爲一個字符串「true 「,以及上面顯示的布爾值true。

回答

3

recipientEvents屬性是不正確的。將includeDocuments更改爲recipientEventStatusCode

"recipientEvents": [ 
    { "recipientEventStatusCode": "Sent" }, 
    { "recipientEventStatusCode": "Delivered" }, 
    { "recipientEventStatusCode": "Completed" }, 
    { "recipientEventStatusCode": "Declined" }, 
    { "recipientEventStatusCode": "AuthenticationFailed" }, 
    { "recipientEventStatusCode": "AutoResponded" } 
], 
+1

當然!我忙於查看主要的'includeDocuments'字段,甚至考慮查看該部分。 SDK有一個RecipientEvent和EnvelopeEvent類的構造函數,兩個參數都是其他方法,我沒有發現。 – Jaymz