webhook HTTP

HTTP endpoint webhook integration

Create or edit a webhook

By configuring a webhook we will make the platform send data to a configurable server end point.

  1. If you click the button. The following form appears when you select the HTTP protocol:

    Table 1. Callback information webhooks
    Item Description
    Protocol Select the protocol: HTTP
    URL pattern Enter the URL pattern. This is the URL for your server. It may contain placeholders for some parameters like serial, third party id and time (Unix time), which can be useful if your server expects certain request/path parameters
    HTTP method Select the HTTP method: PUT or POST
    HTTP headers Add one or more HTTP headers: this can be used to add values like authentication headers.
    Basic authentication
    Tags Add a list of device tags. If not empty, only messages for tagged devices will be sent
    Script an (optional) transformation script to transform the original message payload in a new payload. This is useful when the webhook server expects a certain predefined payload format. See further information below.
    Enabled enable or disable webhook
    Data types Select the data type out of the list. See further information below.
    Test Test correct behavior. This will send a demo message and show successful response code 200 OK
  2. Click the Save button to save the REST push webhook. The webhook is now added to the table.

Script

The script should be written in javascript and should evaluate to the expected new format. There is 1 input variable that can be used: message. The result of your script is the same as what you would get by calling the javascript eval() method on your script. It will evaluate to the last entered statement in your script. As an example

As an example:

In this case transformedMessage is calculated and repeated as a statement on the last line. The result may look something like:

Data types

The following data types are support:
Table 2. Supported data types
Data type Description
all Agglomerate of all the other data types. Useful if you want to handle all data from a single message/
activity Sent when there is a device activity (START,STOP,OTM)
anchorscan Sent for tag when it is scanned by an anchor
beaconscan Sent when a device scans a beacon
button_press Sent when button is pressed (for trackers with physical anti-tamper alert
device_temperature Temperature information for device (not a dedicated event)
location Sent when the device fixes a location
maintenance_value Sent when the maintenance parameter value changes
network_location Sent when the device registers a network location
orientation_event Sent when the orientation state changes
orientation_state Sent when the orientation state changes
pt100_temperature Sent when the PT100 sensor registers temperature (periodic or alert)
sensor_data_ext Sent when external sensor data is received by the device
sigfox_network_signal_levels Sigfox network information (base stations and RSSI levels) associated with each message
status Sent when the online/offline status of the device changes
third_party_data Sent when third party data is received for a device
tilt Sent when a tilt event occurs on the device
wifiscan Sent when wifi access points are scanned by the device