【问题标题】:Including Custom Fields with DocuSign Connect envelope-level webhook使用 DocuSign Connect 信封级 webhook 包括自定义字段
【发布时间】:2021-02-22 04:55:06
【问题描述】:

背景

我正在尝试使用 REST v2.1 API 创建一个信封,该 API 有一个与之关联的 textCustomField(有关每个信封的一些个性化信息)。我还想设置一个信封级别的 DocuSign Connect webhook(带有eventNotification),其中还包括customFields,以便我可以在 HTTP 侦听器中获取它。但是,文档中似乎并不清楚如何确保信封级别的 webhook 包含 customFields(而在配置自定义连接配置时使用复选框在帐户级别设置连接自定义配置时,这似乎显然是可能的- 我可以看到这在 HTTP 侦听器上工作)。 This Q&A(DocuSign Connect 是否支持 JSON 数据或有效负载?)关于 Connect 似乎表明您可以通过 eventNotificationeventData 使用 includeData。当我尝试使用 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"
}

【问题讨论】:

  • 欢迎来到 StackOverflow!请务必检查(接受)您的每个问题的最佳答案。谢谢!

标签: docusignapi docusignconnect


【解决方案1】:

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

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

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

请参阅Connect JSON blog post 了解更多信息。

【讨论】:

  • 太棒了 - 感谢您的快速回复!现在一切正常,谢谢。
  • 很高兴听到。请考虑支持和接受(检查)
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-11-09
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多