We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Add-Ons
default app icon

Weebhooks

By Blair Liikala
Integrations

Description

Create workflows when actions happen in EE.

  • Landing
  • Edit Hook (1)
  • Edit Hook (2)
  • Logs
  • Single log

Take actions when EE does.

Weebhooks taps into many of ExpressionEngine’s hooks to send data to API endpoints for further actions. Simply decide which hook to use, such as when entries are created, someone signs onto the control panel, or leaves a comment, and then send a payload of data to a remote server to trigger actions. This could be anything from an internal script to Zapier or Salesforce. Once sent, returned data can be optionally saved into a custom field (currently only for entries).

Features

  • Support for several hook categories including Entries, File, Comments and Users.
  • Get a clear overview of sent and failed hooks.
  • Easy setup with a Test mode.
  • Add custom headers, including authentication.
  • Decide when to fire a webhook with a rules engine.
  • Send data using the native item’s object, internal or external templates.
  • Full debug information about each hook.
  • Re-run webhooks.
  • Simple tags to output logs to a template.
  • Developer notifications when failures happen.

Usage

Create a new hook:

  • Select “Add” in the module window.
  • Select one of the EE Extension Hooks that will trigger the webhook. Details on these EE hooks are found in the EE Docs under Extension Hooks https://docs.expressionengine.com/latest/development/extension-hooks/model/channel-entry.html
  • Set the type, additional headers, data source, and rules.
  • Do an action to trigger the webhook, and check the log!

Test Mode

To quickly try a hook, simply select the hook and give it a name, then trigger the hook. Leave the endpoint url blank.

  • Results are logged at “Test” and show what data is available to send.

Webhook Options

Field Name Description
Name A descriptive title or note for your reference.
EE Hook Name Select the EE hook to trigger your hook.
Type The type of request sent to the remote server when the hook is triggered, such as GET or POST.
URL The location on the Internet to send the request to. This can be left blank for testing.
HTTP Headers If your endpoint needs specific headers in the request such as the application response type, or authentication. The default is Content-Type: application/json.
Template EE Templates can be used to generate data to send in POST or PUT requests. The item ID (ex: entry_id) is appended.
Manual URL Path A full path to a location on the Internet to grab all the contents and send via POST/PUT to the endpoint when the hook is run.
Rules A key/value pair of rules that must all be TRUE in order for the hook to fire. Case-insensitive. The keys come from the POST data (default object, template, URL).
Save response data An option to save response data to a custom field. Only for Entry hooks.

Status

In addition to error codes, there are a few status groupings for better sorting:

Name Code Description
Success 1-299 Typically a status of 200 for normal success response.
Warning 300-399 The remote server responded with a redirect code.
Failed 400+ The remote server responded with a bad status code, client or server.
Error 0 An internal error happened such as a non-url, or couldn’t connect.
Test (empty) No URL to ping was given in the webhook setup.

Tips

To find available Key parameters, first set the webhook in POST or PUT, and trigger a webhook. The logged response will contain the available parameters for that hook. The Keys have to be in a flat object (not nested or multi-dimentional).

A default of 500 responses are logged for each webhook for performance. Adjusting the limit is possible in the config file. The limit is checked when the hook runs.

Log Tag

Logs can be used in templates by using the logs tag.

{exp:weebhooks:logs hook_id="1"}
  {hook_name} - {status_code} - {error_message}
{/exp:weebhooks:logs}

Parameters

Name Description
id Unique ID of the logged response.
hook_id Filter by the ID of the hook.
status_code Numeric response code, such as 200 or 404
object_id The EE ID of the item, for example, and entry id or member id
request_type Examples like GET, POST
search Search all the responses.

Template Tags

Name Description
{id} Unique ID of the logged response.
{hook_name} Name of the hook at the time the webhook ran.
{hook_id} The ID of the hook.
{status_code} Numeric response code, such as 200 or 404
{object_id} The EE ID of the item, for example, and entry id or member id
{request_type} Examples like GET, POST
{timestamp} Epoch timestamp. Can be used with EE’s date tag for pretty formatting.
{data} The response payload. This could be JSON from the remote server.
{sent} The data sent to the remote server. This could be the rendered template or entry JSON.
{error_message} Any internal or fetching errors reported from the request.
{object_source_name} The content model, such as entry, member or comment

Known Issues

  • When using templates to supply the POST data, standard custom entry field data will be old/prior data. Filed as a core EE bug.
  • Sending a webhook based on if the entry changes is dependent on a bug fix with EE.
  • The use of the double EE in the Weebhooks name continues to make certain people physically ill.
Information
Version 1.6.1
Last Update one year ago
Compatibility EE 7, 6
License Commercial
Links
  • Support
ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.