docusignapidocusignconnect

How does DocuSign specify the message format for Envelope Connect?


We're exploring using Envelope Connect to receive status updates for our envelopes we create through the DocuSign API. We'd like the messages to come to us in JSON format, but it seems that no matter what we provide, the messages arrive in XML format.

An example of an eventNotification we're including with our envelopes is below:

{
"envelopeEvents": [
    {
        "envelopeEventStatusCode": "Completed",
        "includeDocuments": false
    },
    {
        "envelopeEventStatusCode": "Declined",
        "includeDocuments": false
    },
    {
        "envelopeEventStatusCode": "Voided",
        "includeDocuments": false
    }
],
"eventData": {
    "format": "json",
    "includeData": [
        "custom_fields"
    ],
    "version": "restv2.1"
},
"loggingEnabled": true,
"recipientEvents": [
    {
        "includeDocuments": false,
        "recipientEventStatusCode": "Completed"
    }
],
"requireAcknowledgment": true,
"url": "https://webhook.site/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

The DocuSign Developer API Reference says to use the "events" property of the eventNotification object when using the JSON SIM event model, but when we use this instead of envelopeEvents or recipientEvents, we don't receive any status updates.

I followed the message format in this youtube video, which shows the message coming back as JSON, but when I do the same, we get XML. https://www.youtube.com/watch?v=bcTaBKf_c50

The Connect logs in the DocuSign Admin center confirm this: Connect log

Could there be some configuration in our account that is preventing the message format from being JSON?

We do have some account level Connect configurations, could these be interfering?


Solution

  • DocuSign Support was able to identify the issue.

    Our API calls were going through /v2/ of the REST API: https://demo.docusign.net/restapi/v2/

    But JSON status updates are only sent with v2.1. https://demo.docusign.net/restapi/v2.1/