How do Advanced Webhooks work?

Advanced Webhooks are your Swiss Army knife for connecting any HTTP API to Docparser. Once setup, parsed data will automatically be sent to the target URL specified in the settings of your Advanced Webhook.

The options for our Advanced Webhook are the following (screenshot at bottom):

Name Give a name to your Webhook so that you can distinguish it from other Webhooks you created.

What data to send This option is only relevant if you are parsing tabular data, such as line items in an invoice or a price listing. By default, all parsed data of one document will be packed into one single request. You can however change this behavior and set the Webhook to ''Send a single parsed data row". In this case, an individual HTTP request will be sent out for each parsed table row.

HTTP Verb Indicates which HTTP verb Docparser will use for the request. By default, request are sent as 'POST' but you can also set the verb to GET, PUT or DELETE.

Target URL This field indicates the URL to which the data gets sent. You can also use dynamic replacement patterns as shown below in the payload body.

Content-Type The Content-Type chosen here is used in the HTTP headers of the request. You can choose between 'Form Data', JSON or XML. The choice of Content-Type also sets the default template for the body payload of the request.

Additional Headers You can add additional HTTP headers to your request with this field. A common use-case would be Authorization headers for HTTP Basic authentication. You can add multiple headers by separating them with a line-break. Here is a sample how addtional headers could look like:

Authorization: Basic NTNkOWU1NjZjNzVmNmJmMGY5MmQ5YzJlNThmYWI5ZDVhZDJmYTMxZTo= 
User-Agent: Docparser

HTTP Body Payload Template This template editor lets you create 100% customized body payloads tailored to your API. The replacement patterns shown in the default template are gathered from the parsing results of the last imported document (see far below for image of Payload Template). 

The editor will reset to the according default template whenever you change the Content-Type or the 'What data to send' option. You can also choose to reset the template by clicking on 'Reset Template' the link top right. In case you want to validate your body payload, click on 'Preview Payload' and a rendered version of the payload containing the data from the last parsed document. 

The template language used for Advanced Webhooks is based on  Handlebars.js and you can find a list of all expressions in the documentation. The most important expressions are simple identifiers (e.g. {{MyParsingRule}} ) which will later be replaced with the parsed data. Another common feature is to loop through a list of objects, such as table rows.

Still need help? Contact Us Contact Us