2

Background

I am trying to create an envelope with the REST v2.1 API which has a textCustomField associated with it (for some individualised information about each envelope). I also want to set an envelope-level DocuSign Connect webhook (with the eventNotification) which will also include the customFields, so that I can pick this up at the HTTP listener. However, it doesn't seem clear in the documentation how to ensure that the envelope-level webhook includes the customFields (whereas this seems clearly possible when setting a Connect custom configuration at an Account level with the tickboxes when configuring the custom Connect configuration - and I can see this working at an HTTP listener). This Q&A (Does DocuSign Connect support JSON data or payloads?) about Connect seems to indicate that you can includeData for the eventNotification through eventData. When I try to test this with Postman, I seem to be able to create the envelope custom fields when creating the envelope, which I can check with the GET custom field info for an envelope, but these are not being included with the webhook request.

The question

Is it possible to includeData for the Envelope Custom Fields when registering the webhook at an envelope level or is this only possible from an Account level using Connect? If so, what is the correct property for including customFields in the webhook notification when creating the envelope via the REST API (as includeData doesn't seem to work)?

Examples

Excerpts of what I have been trying as the body of the request and what is received by the webhook below (with redactions):

Body of the Create Envelope request:

{
    "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"
}

Received by the webhook (customFields not included):

{
  "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"
}
CuriousCat
  • 23
  • 2

1 Answers1

1

You misspelled the attribute name (includeData not inludeData) and item value (custom_fields not customFields). Try:

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

The DocuSign API ignores attributes it doesn't recognize.

See the Connect JSON blog post for more info.

Larry K
  • 47,808
  • 15
  • 87
  • 140