Webhook delivery

The Webhook delivery sends a POST request to a specified URL. The request contains a link to the document generated by your process.

Configure delivery

First, specify the URL where the request should be sent:

Webhook delivery

Optionally, you can specify HTTP headers or a JSON object to include in the request:

Custom headers and JSON

Use tokens inside headers and JSON

You can insert values from your data using tokens. Click { } to open the list of available tokens.

For example, if your data contains a property called address, insert it using the token {{address}}. Tokens work the same way as in document templates and also support value functions.

You can also use predefined tokens:

  • {{@date}} - the current date and time

  • {{@number}} - the current document number.

In the example above:

  • {{user.id}} is used in the header

  • {{user.name}} and {{user.surname}} are used in the JSON payload

Structure of POST request

Example of the POST request sent to your URL:

POST https://webhook.site/2fe03ab2-ed88-483b-9fa2-26260d9a7a22 HTTP/1.1
Content-Type: application/json
Content-Length: 253
Connection: close
desired-http-header-1: test value 1
user-identifier: 546

{
  "fileUrl": "https://actions2.blob.core.windows.net/data-storage/2020-04-vaomosm3.am3?sv=2018-03-28&sr=...",
  "data": "{\n    \"userName\": \"Bob Barley\",\n    \"age\": 42\n}",
  "deliveriesData": {}
}

The request includes two custom headers configured in the delivery settings: desired-http-header-1 and user-identifier.

The body of the POST request contains two properties:

  • fileUrl - Link to the generated document. You can use this URL to download the file from your application.

  • data - JSON data configured in the delivery settings.

  • deliveriesData - Data returned from previous deliveries. See the example here.

Note

You can use sites like webhook.site for testing and debugging webhook requests

Retrieve the DocuSign Envelope ID

If DocuSign delivery is completed before Webhook delivery, the Webhook delivery receives the envelopeId in its JSON payload:

DocuSign delivery placed before the Webhook delivery
{
  "data": "...",
  "deliveriesData": {
    "docuSign": [
        {
          "envelopeId": "fac5b8da-b53f-4f51-95ab-d6bbf842b5de",
          "status": "sent",
          "statusDateTime": "2022-02-22T20:10:25.8000000Z",
          "uri": "/envelopes/fac5b8da-b53f-4f51-95ab-d6bbf842b5de"
        }
    ]
  }
}