A Webhook is an HTTP callback or HTTP POST that occurs when some pre-determined event happenes. It is a simple event-notification via HTTP POST feature, similar to an SMS but sent from the web-sites you use every day.

elastic.io WebHook component

elastic.io has an open source WebHook component which can be accessed via dedicated GitHub repository.

Webhook can be used for many purposes such as to receive valuable information and act on it (Trigger) when it happens instead of constantly polling the system for data and receiving no valuable information most of the time. It can be used to augment or alter the behaviour of web pages or web applications (Action).

No Attachments: Webhook component at elastic.io does not send of received attachments. In other words WebHook will not process attachments in either Trigger or Action cases.

There is a hard limit on sent payload size, it is set to 1MB. Please adhere to this limits if you want your message to be received.

Trigger: Receiving WebHooks

There are 3 configuration fields:

WebHook URL

This URL is automatically generated for each integration flow and can not be changed.

elastic.io accepts WbHooks sent using HTTPS protocol only If you try to send via HTTP protocol, elastic.io platform will return 301 Moved Permanently and the hook will be rejected.

HMAC verification shared secret (not required)

A possibility to secure your WebHook - more explained here.

Sample data (required)

This is the place you define your incoming data.

To use the Receive trigger for WebHook at elastic.io you would need to define the sample structure which would be used to send your data. You are able to input your desired data structure either as JSON data or using Comma Separated Values (CSV):

Sending JSON

Send WebHook using JSON data and Content-Type of application/json - in this case you just paste a sample of such JSON payload in the WebHook configuration window.

{
  "foo" : "bar",
  "myJSON" : "is the best!"
}

No Naked JSON Arrays: WebHook component does not accept naked JSON Arrays as an incoming values, so for example if you want to send a following JSON payload [ { "foo" : "bar" } ] it won't work, to make it work just wrap your array into an object like { "values" : [ { "foo" : "bar" } ]}.

Encoded JSON data: It is possible to POST an HTTP Request with JSON data encoded as form value (Content-Type of application/x-www-form-urlencoded), in this case we will detect that and try to do our best to convert and parse it to a proper JSON - same as before.

Comma Separated Values (CSV)

Send multiple values encoded as form values (Content-Type of application/x-www-form-urlencoded). In this case just specify comma-separated list of values.

one,two,three

Action: Sending WebHooks

WebHook action can also be used to troubleshoot many processes to see the outcome. For example one could create Query Booked Invoices (in Debitoor) to Webhook flow and configure the Webhook with a url created in Request Bin or with any similar services.

There are 4 fields to configure:

HTTP Verb (required)

POST

The WebHook component can POST information to preconfigured WebHook address. This action could be used for different purposes. For example WebHook can be used to inform your custom connector about an event which it waits to work.

PUT

The WebHook component can also PUT a specific preconfigured JSON into specific address where the process will not be handled by the server. For this reason the "Output JSON Sample" field can be used.

URI (required)

This is the address to send WebHook. For example a created Request Bin

Secret (not required)

This is an optional field to authenticate WebHook POST.

Please note that in case when you use the WebHook address generated by Request Bin or any similar services the Secret field is generally optional.

However, there maybe cases when a special password or a secret might be required. For example the WebHook address was generated explicitly with a password so that to prevent any third parties to use it. This could be your specific WebHook address that you use to send your Wordpress posts into your server.

Output JSON Sample (required)

This field can be used to shape-up your sent message to conform with the receiving end service.