使用 DocuSign Connect 信封级 webhook 包含自定义字段

Including Custom Fields with DocuSign Connect envelope-level webhook

背景

我正在尝试使用 REST v2.1 API 创建一个信封,其中有一个 textCustomField 与之关联(关于每个信封的一些个性化信息)。我还想设置一个信封级别的 DocuSign Connect webhook(带有 eventNotification),其中还将包含 customFields,以便我可以在 HTTP 侦听器中获取它。但是,文档中似乎不清楚如何确保信封级 webhook 包含 customFields(而在配置自定义时使用复选框在帐户级别设置 Connect 自定义配置时,这似乎显然是可能的连接配置 - 我可以看到它在 HTTP 侦听器上工作)。 This Q&A(DocuSign Connect 是否支持 JSON 数据或有效负载?)关于 Connect 似乎表明您可以 includeDataeventNotificationeventData。当我尝试使用 Postman 对此进行测试时,我似乎能够在创建信封时创建信封自定义字段,我可以使用 GET 自定义字段信息检查信封,但这些未包含在 webhook 请求中。

问题

在信封级别注册 webhook 时是否可以 includeData 信封自定义字段,或者这是否只能在使用 Connect 的帐户级别进行?如果是这样,当通过 REST API 创建信封时,在 webhook 通知中包含 customFields 的正确 属性 是什么(因为 includeData 似乎不起作用)?

例子

我一直在尝试作为请求正文的内容的摘录以及下面的 webhook 收到的内容(带有编辑):

创建信封请求的正文:

{
    "emailSubject": "Please sign this document",
    "documents": [
        {
            "documentBase64": "dGVzdCBkb2M=",
            "name": "Lorem Ipsum",
            "fileExtension": "txt",
            "documentId": "1"
        }
    ],
    "customFields": {
        "textCustomFields": [
            {
                "fieldId": "1",
                "name": "Custom Field Name",
                "show": "true",
                "required": "false",
                "value": "Custom Field Value 1"
            }
        ]
    },
    "recipients": {
        "signers": [
            {
                "email": "x@email.com",
                "name": "X Name",
                "recipientId": "1",
                "routingOrder": "1"
            }
        ]
    },
    "eventNotification": {
        "eventData": {
            "version": "restv2.1",
            "format": "json",
            "inludeData": [
                "recipients",
                "customFields"
            ]
        },
        "envelopeEvents": [
            {
                "envelopeEventStatusCode": "Sent",
                "includeDocuments": "false"
            },
            {
                "envelopeEventStatusCode": "Delivered",
                "includeDocuments": "false"
            },
            {
                "envelopeEventStatusCode": "Completed",
                "includeDocuments": "false"
            }
        ],
        "loggingEnabled": "true",
        "requireAcknowledgment": "true",
        "url": "https://webhook.sitexxx"
    },
    "status": "sent"
}

由 webhook 接收(customFields 不包括):

{
  "status": "sent",
  "documentsUri": "/envelopes/[x]/documents",
  "recipientsUri": "/envelopes/[x]/recipients",
  "attachmentsUri": "/envelopes/[x]/attachments",
  "envelopeUri": "/envelopes/[x]",
  "emailSubject": "Please sign this document",
  "envelopeId": "[x]",
  "signingLocation": "online",
  "customFieldsUri": "/envelopes/[x]/custom_fields",
  "notificationUri": "/envelopes/[x]/notification",
  "enableWetSign": "true",
  "allowMarkup": "false",
  "allowReassign": "true",
  "createdDateTime": "2021-02-21T15:07:38.05Z",
  "lastModifiedDateTime": "2021-02-21T15:07:38.05Z",
  "initialSentDateTime": "2021-02-21T15:07:39.067Z",
  "sentDateTime": "2021-02-21T15:07:39.067Z",
  "statusChangedDateTime": "2021-02-21T15:07:40.547Z",
  "documentsCombinedUri": "/envelopes/[x]/documents/combined",
  "certificateUri": "/envelopes/[x]/documents/certificate",
  "templatesUri": "/envelopes/[x]/templates",
  "expireEnabled": "true",
  "expireDateTime": "2021-06-21T15:07:39.067Z",
  "expireAfter": "120",
  "sender": {
    "userName": "[x]",
    "userId": "[x]",
    "accountId": "[x]",
    "email": "[x]"
  },
  "purgeState": "unpurged",
  "envelopeIdStamping": "true",
  "is21CFRPart11": "false",
  "signerCanSignOnMobile": "true",
  "autoNavigation": "true",
  "isSignatureProviderEnvelope": "false",
  "hasFormDataChanged": "false",
  "allowComments": "true",
  "hasComments": "false",
  "allowViewHistory": "true",
  "envelopeMetadata": {
    "allowAdvancedCorrect": "true",
    "enableSignWithNotary": "true",
    "allowCorrect": "true"
  },
  "anySigner": null,
  "envelopeLocation": "current_site",
  "isDynamicEnvelope": "false"
}

您拼错了属性名称(includeData 而不是 inludeData)和项目值(custom_fields 而不是 customFields)。尝试:

... 
"includeData": [
                "recipients",
                "custom_fields"
               ]

DocuSign API 会忽略它无法识别的属性。

有关详细信息,请参阅 Connect JSON blog post