簡體   English   中英

使用 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 配置時使用復選框在 Account 級別設置 Connect 自定義配置時,這顯然是可能的 - 和我可以在 HTTP 監聽器上看到這個工作)。 這個關於 Connect 的問答(DocuSign Connect 是否支持 JSON 數據或有效負載?)似乎表明您可以通過eventDataincludeData eventNotification數據。 當我嘗試使用 Postman 對此進行測試時,我似乎能夠在創建信封時創建信封自定義字段,我可以使用 GET 自定義字段信息檢查信封,但這些不包含在 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 會忽略它無法識別的屬性。

有關詳細信息,請參閱連接 JSON 博客文章

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM