1

背景

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

问题

在信封级别注册 webhook 时是否可以includeData使用信封自定义字段,还是只能从使用 Connect 的帐户级别进行?如果是这样,customFields在通过 REST API 创建信封时包含在 webhook 通知中的正确属性是什么(因为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"
}
4

1 回答 1

0

您拼错了属性名称 ( includeDatanot inludeData) 和项目值 ( custom_fieldsnot customFields)。尝试:

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

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

有关详细信息,请参阅Connect JSON 博客文章

于 2021-02-21T20:55:06.210 回答