INVALID_REQUEST_PARAMETER创建带通知的信封

时间:2017-07-28 09:23:32

标签: docusignapi

我正在尝试使用EventNotification创建一个信封,这样我就不必每15分钟轮询一次状态。

请求创建没有通知的信封可以正常工作,因此它肯定与请求的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": "someone@somewhere.com",
      "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,如上所示。

1 个答案:

答案 0 :(得分:3)

recipientEvents属性不正确。将includeDocuments更改为recipientEventStatusCode

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