How To Create A Custom Webhook
Link: https://support.brilliantdirectories.com/support/solutions/articles/12000105678
In this article we will review the process to create a custom Webhook, using a custom form or smart list. To get started navigate to Developer Hub - Webhooks and click on "New Webhook +"
Create Custom Webhook:
This pop up window has a drop-down field to select the form or the smart list, a field to name the webhook, and a field to add a brief internal description of what this webhook is about.
Custom Form or Smart List:
This drop-down displays all the available forms and smart lists that can be linked to the custom webhook.
Webhook Nickname:
This is the field to add a name to the webhook.
Internal Description:
This is the field to add a description about the webhook.
Finally click on "Save Changes".
To test the Webhook Event enter a Webhook Link and submit the custom form, if a form was selected, or add a member to a smart list if a Smart List was selected.
For Smart list Webhooks and how to connect them see: How To Create Smart List Webhooks
Save Webhook Settings:
This is the button to save the changes on the Webhook Events page
Add "Single Image" & "Multi-Image" Post Types Custom Webhooks
Our webhooks include a Single Image Post Type (Post - Standard) and Multi-image Post Types (Post - Photo Album):
New custom webhooks can be created following the steps mentioned before.
Post-Photo:
This new custom webhook will be used for the specific post type, and the rest of the post types will continue to use the default Post-Standard or Post - Photo Album, depending on it's type.
Activity Tracker:
Logs of the Webhook actions and the information sent can be seen in the Activity Tracker.
When an individual webhook is triggered, this is the information logged in the Activity Tracker:
When a Smart List webhook is triggered, only the first record sent to the webhook endpoint with a confirmation message that the webhook data was correctly sent is logged.
Multi-Value Fields(Checkboxes, Dropdowns, Radial Buttons)
All Multi-value fields types like Checkboxes, Dropdowns and Radial buttons will send the normal information and additionally, it will send information about the field Option labels from the front end and database variables. These can be identified with labels that have "_stringify" on the webhooks
For example a checkbox field:
When the options are selected:
The information sent to the webbooks:
Array of the different options selected : "checkbox_label": ["option_1","option_2","option_3"]
Database Values: "checkbox_label_stringify": "option_1,option_2,option_3"
Values of Labels in the front end "checkbox_label_values_stringify": "Option 1,Option 2,Option 3"
Important: This information can also be viewed in the Activity Tracker:
What happens when a Form Submission Webhook Event is triggered?
When a user submits one of the forms a Webhook is configured for, the data submitted in the form is sent to the Webhook URL via CURL (https://www.php.net/manual/es/book.curl.php) as a POST array.
For example, the default Contact Us form has the following fields:
Name [yourname]
Email [inquiry_email]
Phone Number [phone]
Message [comments]
A user submits the following information to these fields:
The following $POST array would be sent to the Webhook URL setup for this form.
formname: contact_form
yourname: Jane Smith
inquiry_email: jane@smith.com
phone: 6263962211
comments: I need assistance setting up art galleries.
g-recaptcha-response: 03AGdBq25plMxoJT4Y634dC_nAu_zDQYhtep04LByAG5AFQ2k4_Y0BvhNle9GrSh7UX0snQYQ4VwaQPaT1iHv4Q2qySvUY9w3VRWH7p4sT4DI6dbjndt28b3KpaUYdc3nO5loeBSwf1G5lk0KE90whyRj7_8CwSs1Foif18Ai2MkCYFo6JU_fk6REx9Z_3Tpk2ZTiciYoy_5oyPirmWXaUKYF5NLEcGvFRA_CusrVlFTpuyTnWfiNYnsqoZQb3TQsds5f-p1LgsmTSMDWZCQfnUt2ZEA45uZtz0m5fmC_9RybfIdySPNX2guugQVN27nWu2H9P2hY7ChCAmKM0BSbP8P83n_o4_yb4gRynhQCwFlVzfUiaiLK6fA1jWrfHQkX5NAKmwhVvEfgKwGPgk1yJ2cmULdkcjEQFTuvBOHfxTaJq0dbav4x07vuKmldcp92PLZyQj0Ogl16tr9_XJqqjJ_U7BTyJq6-WyA
HTTPR: https://www.demobootstrap.com/about/contact
DATE: 20211015110636
IP: 201.191.195.131
CONTACT_TYPE: contact_form
Important Note: Click here to access the Full List of Variables Per Webhook.