ExpressionEngine 7.5 has been Released! Learn More!
Create workflows when actions happen in EE.
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).
Create a new hook:
Extension Hooks
https://docs.expressionengine.com/latest/development/extension-hooks/model/channel-entry.htmlTo quickly try a hook, simply select the hook and give it a name, then trigger the hook. Leave the endpoint url blank.
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. |
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. |
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.
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}
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. |
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 |
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.