Skip to main content

Webhooks

Written by Eric Range

Overview

Webhooks are automated messages sent from applications when something happens. They have a message—or payload—and are sent to a unique URL—essentially the app's phone number or address.

Webhooks allow Element451 to communicate with other systems, enabling efficient data exchange and, most importantly, event-driven interactions when combined with rules. Element451's webhooks can be used with middleware like Zapier and Make or work directly with other systems.

Element451 supports sending data for a single record and not receiving data.

Accessing Webhooks

Navigate to Data & Automation > Webhooks.


Creating + Managing a Webhook

The Webhooks page (Data & Automation > Webhooks) displays current webhooks, the URL used to send data, and the HTTP method used.

Creating a Webhook

  1. To create a webhook, click the blue + Create Webhook button at the top left.

  2. Configure the webhook:

    • Name the Webhook: Enter a name at the top of the sidesheet.

    • URL: This is the URL to which to send data.

    • Method: This HTTP method is used to send data and will most likely be POST or PUT.

    • Body Type: You can select "TEMPLATE" to use and Element451 Template or "RAW JSON" to create your own layout. XML is not currently supported.

    • Template or Body:

      • If you selected Template, you must select an Element451 Template from your instance.

      • If you select Raw JSON, you must create your own JSON template. Clicking "Add Token" will allow you to insert tokens to merge data into the JSON template like you would add tokens when creating an email or microsite.

    • Requests Limit Per Minute: Some services limit the number of requests they can handle per minute, which can be entered here.

    • Headers: Any needed headers can be entered here. This may be an APIKey, version type, or other required header. If you selected "RAW JSON," it's best to add a header with a "Content-Type" key and "application/json" value.

  3. Once the required fields are configured, click Save. Your webhook is now complete.

Editing a Webhook

  1. From the Webhooks page (Data & Automation > Webhooks), locate the webhook you wish to edit.

  2. Click the three-dot menu button at the row's end, then click edit.

Deleting a Webhook

  1. From the Webhooks page (Data & Automation > Webhooks), locate the webhook you wish to delete.

  2. Click the three-dot menu button at the row's end, then click delete. You'll be asked to confirm your action.


Viewing and Testing a Webhook

After the webhook is created, you can open actions and view executions.

Executions allow you to see when the webhook was last run and the returned status. If you click the three-dot menu button and select Open, you can see any previous runs and the returned body. The left-hand side of the screen will also allow you to make adjustments to the webhook.

From this view, you can also test a webhook by clicking the blue Test button in the top left corner. You'll select a contact to use for the test and then click Run. Once the run is complete, you'll see the status code, header, and body that was returned. You can run this as often as needed to ensure the webhook is working as expected.

You can delete a webhook from either the main webhook page or from inside the webhook by clicking the three-dot menu button and then selecting Delete.


Crafting a Webhook Body

Webhooks support sending an body as part the HTTP request. This body can be created in two ways.

Using a Template for the Body

Selecting "Template" for the Webhook Body Type will prompt you to select a template. This list corresponds to the Export Templates configured under Data + Automations -> Import + Export -> Mapping Templates -> Export Templates.

When Template is selected, the Webhook body will output JSON with key names that correspond to the "Header and Sample row" Column of the template.

A template with Email, First Name and Last Name mapped like this..

..will produce an output like this:

{
"Email": "example@email.com",
"First Name": "First",
"Last Name": "Last"
}

Changing Key Names

To change the key name, edit the template column and adjust the Column name field to the desired name:

Applying Transformations

All transformations applied to a column will be reflected in the Webhook output.

In this example, the Intended Term would be output as the term code, as opposed to the name or other value type:

Learn more about column transformations here.

Using Raw JSON for the Body

Selecting "Raw JSON" for the Webhook Body Type allows you to create the webhook body directly. Student data can be passed into the webhook body using Tokens. All tokens should be treated as strings and wrapped in double quotes to ensure the JSON on valid.

Tokens will be evaluated during each execution of the webhook. A body with these tokens..

{
"email": "[user:email_address]",
"first_name": "[user:first_name]",
"last_name": "[user:last_name]"
}

.. will evaluate to this during execution:

{
"email": "example@email.com",
"first_name": "First",
"last_name": "Last"
}


Using a Webhook

Once a webhook has been created, you can use it in a Workflow or Rule.

  • Select the Execute Webhook action when adding actions to the workflow or rule.

  • We generally recommend using a rule, as it allows a record to pass through multiple times, unlike a regular workflow that only permits a single pass. Once the rule is active, the webhook will run whenever triggered by the rule.

  • The "People" tab will show which contact records the rule was executed for if the webhook execution was successful. However, it is essential to remember that "succeeded" means it was successful in sending the webhook, not that a 200 status was received or that the data was correctly received when it was sent.


Retries

Element451 does support retries when a status of 408, 409, 502, 503, or 504 is received. After the first try, the request is delayed for 3 minutes before retrying, 30 minutes, and 180 minutes.

After the 3rd try, the webhook will fail and not attempt to send that data again.

Did this answer your question?