Webhooks are a way to receive information when needed, rather than continually ask for that data. By the use of Webhook, Lead Angel can communicate with other applications and can share data via API automatically in real time.
By specifying a URL, the application will POST/ GET data to those URLs when the events occur. You can:
- Put the data in another app (real-time data synchronization)
- Process the data and repost it using the app's API
- Trigger notifications to you or anyone via email.
Steps to Create a Webhook
1. Sign in to app.leadangel.com
Go to Administration > Integration > Webhook integration > Webhook
Right Click on Webhook and click New Webhook to create a new Webhook definition.
2. Configure your Webhook by entering the details mentioned below.
***Fields marked in asterisks* are mandatory.
URL: Insert a URL from where you want to sync the data. You may insert a field such as URL, photo URL, etc. by clicking on the insert token.
Request type: The HTTP method is used to send all the requests. The method identifies the type of request that is being made to the web server. You can select an HTTP request type from the drop-down.
Payload Template: It is an HTTP request body where you can select tokens to send real-time data to API.
Request token encoding: It is the format of the request body. You can choose the appropriate type from the given options so that the Webhook communicates with the API correctly.
Response type: It is the format of the response you receive from the service.
Response mapping: The objective of response mapping is that when you call data from a different API you would like to get it mapped to a particular field in LeadAngel’s software.
There is no limit to the number of response mappings that can be created or modified for each Webhook. You have to create at least one response mapping.
3. Create a Response Mapping.
Right-click on Response mapping to create a New mapping definition
Add New Response Mapping dialogue will be displayed. Enter a name and description in the corresponding field, Select Router Type, and click on Save.
Drag and drop the lead attributes to be mapped in your response mapping canvas.
Write the field name from the response body as a value to the dragged attributes which you want to map. Click on Approve.
4. Create Custom Header
Any number of Custom Header fields can be used with Webhooks and sent along with the request.
Right-click on the custom header and click on New Custom Header
Add New Custom Header dialogue will be displayed. Enter a name and description in the corresponding field and click on Save.
Drag the custom header to the canvas and add the header and corresponding values to it. You may use it in the Webhook block.
Click on Approve.
How to use Webhook?
To call a Webhook in a router you have to draw an action block in the router. This option is available in all the router types like Lead, Account, Contact, etc.
***No action block can be added directly to the start node. And You may create multiple action blocks.
Drag and drop the action block on any flowchart you have created and connect it to where you want to use the Webhook.
Double-click the action block.
You may give a name to the action block, and add some description.
When you click on the select action drop down you will get two options - Call Webhook and Wait.
Call Webhook
When you select the call Webhook option you have to select the approved Webhook from the drop-down adjacent to it.
Another option appears as soon as you select the call Webhook option below it -On Webhook failure
Webhook failure happens when the Webhook cannot connect to the API or there is a failure due to invalid response mapping or any other reason.
You have two options to choose from:
- If you want the process to continue then select Continue Processing. In this case, the router will jump the action block and continue processing through the next rule/ block.
- Else if you want to stop the process of recording until the Webhook services resume, click on stop processing.