Webhook delivery

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

Configure delivery

First, you have to fill the URL where the request will be sent:

Webhook delivery

Optionally, you can specify HTTP headers or JSON object that will be sent in the same request:

Custom headers and JSON

You can insert values from your data using tokens. Let us assume, your data has property “invoiceNumber”. In this case, you can include it using token {{invoiceNumber}}.

Those tokens work the same way as in document templates including value formatters. Additionally, you can use {{@date}} token to include current date:

  • {{@date}} - full current date with time.

  • {{@date}:format(dd.MM.yyyy hh:mm)} - formatted current date.

On the screen above we specified user ID in header ({{user.id}}), user name and user age in JSON data ({{user.name}} and {{user.age}}).

Structure of POST request

Example of POST request that will be 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=b&sig=Lu34U6re43Zr2G2TH%2FGTBkYDyaItPKx%2BjDXX18%2FGX9I%3D&se=2020-04-13T15%3A00%3A53Z&sp=r&rscd=inline",
  "data": "{\n    \"userName\": \"Bob Barley\",\n    \"age\": 42\n}"
}

Those are two custom headers that we added in the delivery settings (desired-http-header-1 and user-identifier).

The body of the POST request contains two properties:

  • fileUrl - It is a link to the result document generated by your process. You can use this link to download the document from your code.

  • data - It is a JSON data that you configured in the delivery.

Note

You can use sites like webhook.site for debugging this delivery.