Introduction
The Feed Meta Object for the Webhooks Add-On is an associative array with properties determining how the add-on should process the form submission.
$feed['meta'] = array(
'feedName' => 'Webhook Feed 1',
'requestURL' => 'https://example.com/webhook',
'requestMethod' => 'POST',
'requestFormat' => 'json',
'requestHeaders' => array(
array(
'key' => 'Content-Type',
'custom_key' => '',
'value' => 'application/json',
'custom_value' => '',
),
array(
'key' => 'Authorization',
'custom_key' => '',
'value' => 'Bearer example_token',
'custom_value' => '',
),
),
'requestBodyType' => 'all_fields',
'fieldValues' => array(
array(
'key' => 'custom_param_1',
'custom_key' => '',
'value' => '1',
'custom_value' => '',
),
),
'feedCondition' => true,
'feed_condition_object' => array(
'conditionalLogic' => array(
'actionType' => 'show',
'logicType' => 'all',
'rules' => array(
array(
'fieldId' => '1',
'operator' => 'is',
'value' => 'Approved',
),
),
),
),
);
We recommend accessing the $feed meta using the rgar() or rgars() functions, e.g.:
$conditional_logic_enabled = rgars( $feed, 'meta/feedCondition' );
if ( $conditional_logic_enabled ) {
// Conditional logic is enabled for this feed.
$logic_rules = rgars( $feed, 'meta/feed_condition_conditional_logic_object/conditionalLogic/rules' );
foreach ( $logic_rules as $rule ) {
// Process each conditional logic rule.
$field_id = rgar( $rule, 'fieldId' );
$operator = rgar( $rule, 'operator' );
$value = rgar( $rule, 'value' );
// Example: Use $field_id, $operator, and $value in your logic.
}
}
Properties
Property | Type | Description |
---|---|---|
feedName | string | The feed name that appears on the Add-On feeds tab. |
requestURL | string | The URL where the webhook request is sent. |
requestMethod | string | The HTTP method for the request. Possible values: GET, POST, PUT, PATCH, DELETE. |
requestFormat | string | The format of the request body. Possible values: json, form. |
requestHeaders | array | A multidimensional array containing the headers for the webhook request. See Custom Field Properties. |
requestBodyType | string | Specifies whether to send all fields (all_fields ) or selected fields (select_fields ) in the request. |
fieldValues | array | An array mapping form fields to custom webhook parameters. Only applicable if requestBodyType is ‘select_fields’. |
feed_condition_conditional_logic | boolean | Indicates if conditional logic is enabled for the feed. Default is false . |
feed_condition_conditional_logic_object | array | An associative array containing the conditional logic rules. See Conditional Logic Object. |
Custom Field Properties
array(
'key' => '',
'custom_key' => '',
'value' => '',
'custom_value' => '',
);
Setting | Type | Description |
---|---|---|
key | string | The name of the custom field. |
custom_key | string | Custom key for headers. |
value | string | The ID of the form field or entry meta item contains this custom field’s value. Merge tags supported. |
custom_value | string | Custom value for the field. |