How to: Consume a DocuSign Connect Webhook

Prev Next

A webhook lets one server send data to another automatically when a specific event occurs. In this how-to guide, you’ll configure an application to consume a DocuSign Connect webhook.

To learn more about integrating DocuSign at Unqork, view our DocuSign Module Integration Template article. To learn more about webhooks, view our Consuming Payloads Using Webhooks article.

Configuration

Configure the Listener Module

First, create a Listener module to connect with the DocuSign Connect webhook. When the Listener module receives the webhook request, the module runs.

These instructions assume you have a workspace open, saved, and with a title.

Configure the API Module

The Listener module must be configured as an Unqork API module to ensure it executes on the server side.

  1. At the top right of the Application page, click + Create New.

  2. Select Module.

  3. In the Module Name field, enter API Request Submission. You can name the module as per your requirement.

  4. From the Module Type drop-down, select API.

  5. Click Create.

Enabling Server-Side Execution Only and Execute via Proxy

Before adding components to the module, you’ll adjust the module settings. By setting the module to server-side execute, the module becomes inaccessible to anyone without Module Builder access.

  1. At the top right of the Module Builder, click the ellipsisButtonDummy.jpg (ellipsis) button.

  2. Select Module Settings.

  3. To the left of the modal, click Module Settings.

  4. Set Server Side Execution Only to files (ON).

    By setting the module to server-side execute, the module becomes inaccessible to anyone without the Module Builder access. Avoid enabling the Act as Super-user when Server Side Executing setting. This setting lets you use webhooks, but it weakens the security of your application.

  5. Click User Permissions.

  6. Set Allow Access to Anonymous Users to files (ON).

  7. From the Anonymous role's Permission drop-down, select Write.

    These settings helps to enable the Execute via Proxy endpoint for the webhook to receive requests for your webhook service.

  8. Click Save & Close.

  9. Save the module.

Update the description HTML Element Component

  1. In the panelInfo Panel component, hover over the description HTML Element component, and click the (Settings) button.

  2. In the Content field, enter a description like the following: This module creates a schema module submission with the information via PUT request. It takes an example DocuSign Connect Listener Service XML Schema, transforms XML to JSON, and pulls relevant data fields out of the JSON output in order to create a submission capturing the envelope status.

  3. Click Save Component.

Update the method Hidden Component

  1. In the panelInfo Panel component, hover over the method Hidden component, and click the (Settings) button.

  2. In the Default Value field, enter PUT.

  3. Click Save Component.

Configure the Hidden Components

  1. Drag and drop six Hidden components inside the panelRequest Panel component.

  2. In the Property ID and Canvas Label Text fields, enter the following for each component:

    #

    Property ID

    Canvas Label Text

    1

    valueOut

    valueOut

    2

    envelopeID

    envelopeId

    3

    status

    status

    4

    created

    created

    5

    completed

    completed

    6

    documentStatuses

    documentStatuses

    The first Hidden component stores the output from your pluginSubmission Plug-In component. The remaining Hidden components store the DocuSign envelope attributes. For this example, the attributes are envelope ID, status, created, completed, and document statuses.

  3. Click Save Component for each component as you add it.

Configure the Initializer Component

Next, set up an Initializer component to trigger the pluginXmlToJson Plug-In component you’ll set up next.

  1. Drag and drop an Initializer component inside the panelRequest Panel component.

  2. In the Property ID and Canvas Label Text fields, enter initField.

  3. Set the Trigger Type as New Submission.

  4. In the Outputs table, enter the following:

    Property ID

    Type

    Value

    pluginXmlToJson

    trigger

    GO

  5. Click Save Component.

Configure the Plug-In Component

This Plug-In component imports XML data, converts it to JSON, and triggers the Data Workflow component you’ll set up next.

  1. Drag and drop a Plug-In component inside the panelConfig Panel component, below the Initializer component.

  2. In the Property ID and Canvas Label Text fields, enter plugXmlToJson.

  3. From the Internal Services drop-down, select Convert XML to JSON.

  4. In the Inputs table, enter the following:

    Property ID

    Mapping

    _request['body']

    xmlData

  5. In the Outputs table, enter the following:

    Property ID

    Mapping

    valueOut

    jsonData

  6. In the Post Trigger field, enter dwfGetStatus.

    Configuration settings for a plugin with inputs and outputs sections displayed.

  7. Click Save Component.

Configure the Data Workflow Component

This Data Workflow component transforms XML to JSON and triggers your pluginSubmission Plug-In component. You'll add this Plug-In component next.

  1. Drag and drop a Data Workflow component inside the panelRequest Panel component, below the pluginXmlToJson Plug-In component.

  2. In the Property ID and Canvas Label Text fields, enter dwfGetStatus.

    Data workflow diagram showing inputs, outputs, and various processing steps for document status.

Configure the valueOut Input Operator

  1. Drag and drop an Input operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Input

    Component

    valueOut

    Required

    Yes

    Source

    Default

Configure the DocuSignEnvelopeInformation Get Operator

  1. Drag and drop a Get operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Get

    Label

    DocuSignEnvelopeInformation

    Path

    DocuSignEnvelopeInformation

    The DocuSignEnvelopeInformation value is the first tag you’ll expect in a DocuSign call.

  3. Connect the output port (right) of the valueOut Input operator to the input port (left) of the DocuSignEnvelopeInformation Get operator.

Configure the envelopeId Get Operator

Next, we will configure the Get and Output operators for each hidden component (attribute) in your envelope.

  1. Drag and drop a Get operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Get

    Label

    envelopeId

    Path

    EnvelopeID[0]

  3. Connect the output port (right) of the DocuSignEnvelopeInformation Get operator to the input port (left) of the envelopeId Get operator.

Configure the envelopeId Output Operator

  1. Drag and drop an Output operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Output

    Component

    envelopeId

    Action

    value

  3. Connect the output port (right) of the envelopeId Get operator to the input port (left) of the envelopeId Output operator.

Configure the status Get Operator

  1. Drag and drop another Get operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Get

    Label

    status

    Path

    Status[0]

  3. Connect the output port (right) of the DocuSignEnvelopeInformation Get operator to the input port (left) of the status Get operator.

Configure the status Output Operator

  1. Drag and drop another Output operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Output

    Component

    status

    Action

    value

  3. Connect the output port (right) of the status Get operator to the input port (left) of the status Output operator.

Configure the created Get Operator

  1. Drag and drop another Get operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Get

    Label

    created

    Path

    Created[0]

  3. Connect the output port (right) of the DocuSignEnvelopeInformation Get operator to the input port (left) of the created Get operator.

Configure the created Output Operator

  1. Drag and drop another Output operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Output

    Component

    created

    Action

    value

  3. Connect the output port (right) of the created Get operator to the input port (left) of the created Output operator.

Configure the completed Get Operator

  1. Drag and drop another Get operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Get

    Label

    completed

    Path

    Completed[0]

  3. Connect the output port (right) of the DocuSignEnvelopeInformation Get operator to the input port (left) of the completed Get operator.

Configure the completed Output Operator

  1. Drag and drop another Output operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Output

    Component

    completed

    Action

    value

  3. Connect the output port (right) of the completed Get operator to the input port (left) of the completed Output operator.

Configure the documentationStatuses Get Operator

  1. Drag and drop another Get operator onto your Data Workflow canvas.

  2. Configure the Get operator's Info window as follows:

    Setting

    Value

    Category

    Get

    Label

    documentationStatuses

    Path

    DocumentationStatuses[0]

  3. Connect the output port (right) of the DocuSignEnvelopeInformation Get operator to the input port (left) of the documentationStatuses Get operator.

Configure the documentationStatuses Output Operator

  1. Drag and drop another Output operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Output

    Component

    documentationStatuses

    Action

    value

  3. Connect the output port (right) of the documentationStatuses Get operator to the input port (left) of the documentationStatuses Output operator.

Configure the Create plugSubmission Create Value Operator

  1. Drag and drop a Create Value operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Create Value

    Label

    Create plugSubmission

    Expression/Value

    ='GO'

  3. Connect the output port (right) of the documentationStatuses Get operator to the argument port (top) of the Create plugSubmission Create Value operator.

Configure the plugSubmission Output Operator

  1. Drag and drop an Output operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Component

    Action

    Category

    Output

    Component

    plugSubmission

    Action

    trigger

  3. Connect the output port (right) of the Create plugSubmission Create Value operator to the input port (left) of the plugSubmission Output operator.

  4. Click Save Component.

Configure the Plug-In Component

This Plug-In component takes the JSON fields from the transformed XML envelope data and creates a submission.

  1. Drag and drop a Plug-In component inside the panelConfig Panel component, below the Data Workflow component.

  2. In the Property ID and Canvas Label Text fields, enter plugSubmission.

  3. From the Internal Services drop-down, select Create Module Submissions(s).

  4. From the Module drop-down, select Enablement Lab: API Request Submission Schema. This module is the prebuilt Submission Schema module.

  5. In the Inputs table, enter the following:

    #

    Property ID

    Mapping

    1

    envelopeId

    data.envelopeId

    2

    status

    data.status

    3

    created

    data.created

    4

    completed

    data.completed

    5

    documentStatuses

    data.documentStatuses

    This data maps to the Submission Schema module's Hidden components.

    Form for API request submission with various input fields and options displayed.

  6. Click Save Component.

  7. Save your module.

It's important to note that your Listener module must link to DocuSign Connect to work. If you test your module before linking to DocuSign, your webhooks does not work.

Here's how the completed Listener module looks in the Module Builder:

API request module layout with components and configuration details for integration.

Configuration

Configure the Listener Module

First, create a Listener module to connect with the DocuSign Connect webhook. When the Listener module receives the webhook request, the module runs.

These instructions assume you have a workspace open, saved, and with a title.

Configure the API Module

The Listener module must be configured as an Unqork API module to ensure it executes on the server side.

  1. At the top right of the Application page, click + Create New.

  2. Select Module.

  3. In the Module Name field, enter API Request Submission. You can name the module as per your requirement.

  4. From the Module Type drop-down, select API.

  5. Click Create.

Enabling Server-Side Execution Only and Execute via Proxy

Before adding components to the module, you’ll adjust the module settings. By setting the module to server-side execute, the module becomes inaccessible to anyone without Module Builder access.

  1. At the top right of the Module Builder, click the ellipsisButtonDummy.jpg (ellipsis) button.

  2. Select Module Settings.

  3. To the left of the modal, click Module Settings.

  4. Set Server Side Execution Only to files (ON).

    By setting the module to server-side execute, the module becomes inaccessible to anyone without the Module Builder access. Avoid enabling the Act as Super-user when Server Side Executing setting. This setting lets you use webhooks, but it weakens the security of your application.

  5. Click User Permissions.

  6. Set Allow Access to Anonymous Users to files (ON).

  7. From the Anonymous role's Permission drop-down, select Write.

    These settings helps to enable the Execute via Proxy endpoint for the webhook to receive requests for your webhook service.

  8. Click Save & Close.

  9. Save the module.

Update the description HTML Element Component

  1. In the panelInfo Panel component, hover over the description HTML Element component, and click the (Settings) button.

  2. Under the Display section in the Content field, enter a description as: This module creates a schema module submission with the information via PUT request. It takes an example DocuSign Connect Listener Service XML Schema, transforms XML to JSON, and pulls relevant data fields out of the JSON output in order to create a submission capturing the envelope status.

  3. Click Save & Close.

Update the method Hidden Component

  1. In the panelInfo Panel component, hover over the method Hidden component and click the (Settings) button.

  2. In the Default Value field, enter PUT.

  3. Click Save & Close.

Configure the Hidden Components

  1. Drag and drop six Hidden components onto the canvas in the panelRequest Panel Component.

  2. In the Property ID and Canvas Label Text fields, enter the following for each component:

    #

    Property ID

    Canvas Label Text

    1

    valueOut

    valueOut

    2

    envelopeID

    envelopeId

    3

    status

    status

    4

    created

    created

    5

    completed

    completed

    6

    documentStatuses

    documentStatuses

    The first Hidden component holds the output from your pluginSubmission Plug-In component. The remaining Hidden components store the DocuSign envelope attributes. For this example, the attributes are envelope ID, status, created, completed, and document statuses.

  3. Click Save & Close for each component as you add it.

Configure the Initializer Component

Next, set up an Initializer component to trigger the pluginXmlToJson Plug-In component you’ll set up next.

  1. Drag and drop an Initializer component onto the canvas inside the panelRequest Panel component.

  2. In the Property ID and Canvas Label Text fields, enter initField.

  3. Set the Trigger Type as New Submission.

  4. In the Outputs table, enter the following:

    Property ID

    Type

    Value

    pluginXmlToJson

    trigger

    GO

  5. Click Save & Close.

Configure the Plug-In Component

This Plug-In component imports XML data, converts it to JSON , and triggers the Data Workflow component you’ll set up next.

  1. Drag and drop a Plug-In component in the panelConfig Panel component, below the Initializer component.

  2. In the Property ID and Canvas Label Text fields, enter plugXmlToJson.

  3. From the Internal Services drop-down, select Convert XML to JSON.

  4. In the Inputs table, enter the following:

    Property ID

    Mapping

    _request['body']

    xmlData

  5. In the Outputs table, enter the following:

    Property ID

    Mapping

    valueOut

    jsonData

  6. In the Post Trigger field, enter dwfGetStatus.

  7. Click Save.

Configure the Data Workflow Component

This Data Workflow transforms XML to JSON and triggers your pluginSubmission Plug-In component. You'll add this Plug-In component next.

  1. Drag and drop a Data Workflow component in the panelRequest Panel component, below the pluginXmlToJson Plug-In component.

  2. In the Canvas Label Text and Property Name fields, enter dwfGetStatus.

Configure the valueOut Input Operator

  1. Drag and drop an Input operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Input

    Component

    valueOut

    Required

    Yes

    Source

    Default

Configure the DocuSignEnvelopeInformation Get Operator

  1. Drag and drop a Get operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Get

    Label

    DocuSignEnvelopeInformation

    Path

    DocuSignEnvelopeInformation

    The DocuSignEnvelopeInformation value is the first tag you’ll expect in a DocuSign call.

  3. Connect the output port (right) of the valueOut Input operator to the input port (left) of the DocuSignEnvelopeInformation Get operator.

Configure the envelopeId Get Operator

Next, we will configure the Get and Output operators for each hidden component (attribute) in your envelope.

  1. Drag and drop a Get operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Get

    Label

    envelopeId

    Path

    EnvelopeID[0]

  3. Connect the output port (right) of the DocuSignEnvelopeInformation Get operator to the input port (left) of the envelopeId Get operator.

Configure the envelopeId Output Operator

  1. Drag and drop an Output operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Output

    Component

    envelopeId

    Action

    value

  3. Connect the output port (right) of the envelopeId Get operator to the input port (left) of the envelopeId Output operator.

Configure the status Get Operator

  1. Drag and drop another Get operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Get

    Label

    status

    Path

    Status[0]

  3. Connect the output port (right) of the DocuSignEnvelopeInformation Get operator to the input port (left) of the status Get operator.

Configure the status Output Operator

  1. Drag and drop another Output operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Output

    Component

    status

    Action

    value

  3. Connect the output port (right) of the status Get operator to the input port (left) of the status Output operator.

Configure the created Get Operator

  1. Drag and drop another Get operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Get

    Label

    created

    Path

    Created[0]

  3. Connect the output port (right) of the DocuSignEnvelopeInformation Get operator to the input port (left) of the created Get operator.

Configure the created Output Operator

  1. Drag and drop another Output operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Output

    Component

    created

    Action

    value

  3. Connect the output port (right) of the created Get operator to the input port (left) of the created Output operator.

Configure the completed Get Operator

  1. Drag and drop another Get operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Get

    Label

    completed

    Path

    Completed[0]

  3. Connect the output port (right) of the DocuSignEnvelopeInformation Get operator to the input port (left) of the completed Get operator.

Configure the completed Output Operator

  1. Drag and drop another Output operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Output

    Component

    completed

    Action

    value

  3. Connect the output port (right) of the completed Get operator to the input port (left) of the completed Output operator.

Configure the documentationStatuses Get Operator

  1. Drag and drop another Get operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Get

    Label

    documentationStatuses

    Path

    DocumentationStatuses[0]

  3. Connect the output port (right) of the DocuSignEnvelopeInformation Get operator to the input port (left) of the documentationStatuses Get operator.

Configure the documentationStatuses Output Operator

  1. Drag and drop another Output operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Output

    Component

    documentationStatuses

    Action

    value

  3. Connect the output port (right) of the documentationStatuses Get operator to the input port (left) of the documentationStatuses Output operator.

Configure the Create plugSubmission Create Value Operator

  1. Drag and drop a Create Value operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Create Value

    Label

    Create plugSubmission

    Expression/Value

    ='GO'

  3. Connect the output port (right) of the documentationStatuses Get operator to the argument port (top) of the Create plugSubmission Create Value operator.

Configure the plugSubmission Output Operator

  1. Drag and drop an Output operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Component

    Action

    Category

    Output

    Component

    plugSubmission

    Action

    trigger

  3. Connect the output port (right) of the Create plugSubmission Create Value operator to the input port (left) of the plugSubmission Output operator.

  4. Click Save.

Configure the Plug-In Component

This Plug-In component takes the JSON fields pulled from the transformed XML envelope data and creates a submission.

  1. Drag and drop a Plug-In component inside the panelConfig Panel component, below the Data Workflow component.

  2. In the Property ID and Canvas Label Text fields, enter plugSubmission.

  3. From the Internal Services drop-down, select Create Module Submissions(s).

  4. From the Module drop-down, select Enablement Lab: API Request Submission Schema. This module is the prebuilt Submission Schema module.

  5. In the Inputs table, enter the following:

    Property ID

    Mapping

    envelopeId

    data.envelopeId

    status

    data.status

    created

    data.created

    completed

    data.completed

    documentStatuses

    data.documentStatuses

    This data maps back to the Submission Schema module's Hidden components.

  6. Click Save.

  7. Save your module.

It's important to note that your Listener module must link to DocuSign Connect to work. If you test your module before linking to DocuSign, your webhooks won't work.

Here's how the completed Listener module looks in the Module Builder:

API module template with sections for panelInfo, panelRequest, panelConfig, and panelResponse.