Introduction

In this article, we will learn how to use Webhooks node.

Step by Step Instructions

If you prefer to watch a video…

Configuring the Webhooks node on Leadshook

1. On the decision tree canvas, add a Webhooks node

2. Configure the Webhooks node

Data can be added using JSON format, https://jsoneditoronline.org/ can be used to verify the validity of the JSON code

Method

The GET method is used to retrieve data from a web server.

The PUT method completely replaces whatever currently exists at the target URL with something else.

The HTTP POST method is used to send user-generated data to the web server.

In order to send data from LeadsHook to the payload URL, we can use POST method.

Payload URL

For the payload URL, you may use https://webhook.site, your own server, a Zapier webhook, or a tool like PipeDream.

In this article, we will use https://webhook.site for demonstration.

Important: for webhooks to work, the decision tree must be activated – here is how.

Adding custom fields in JSON

In the webhook node, under “Data”, we can also incorporate custom field, here is an example:

Remember to add double quotation marks (“) before and after the custom field

See More 

JSON Structure

A JSON object contains zero, one, or more key-value pairs, also called properties. The object is surrounded by curly braces {}. Every key-value pair is separated by a comma. The order of the key-value pair is irrelevant.

A key-value pair consists of a key and a value, separated by a colon (:). The key is a string, which identifies the key-value pair. The value can be any of the following data types:

stringsurrounded by quotation marks (” “)
number
float
arrayJSON array
objectJSON object (can be nested)
booleantrue or false
emptynull

JSON Data Type and Syntaxh

JSON Strings must be written in double quotes. Example: { “name”:”John” }

JSON Numbers must be an integer or a floating point. Example: { “age”:30 }

JSON Objects: Objects as values in JSON must follow the same rules as JSON objects. Example: { “employee”:{ “name”:”John”, “age”:30, “city”:”New York” } }

JSON Arrays. Example: { “employees”:[ “John”, “Anna”, “Peter” ] }

JSON Booleans (true/false). Example: { “sale”:true }

JSON null. Example: { “middlename”:null }

Validating the JSON syntax

The JSON data syntax can be checked on JSON Editor.

JSON Editor will show the syntax error of the JSON data

Additional references:

Webhooks for Productive Developers

What Are Webhooks?

The Difference Between APIs and Webhooks Explained By Selling Seasonal Produce on Your Farm

JSON Editor

Comparing HTTP Methods

Comments

  1. Pingback: Complete Guide to Lead Distribution from LeadsHook | LeadsHook Knowledge Base

Leave a Reply

Your email address will not be published. Required fields are marked *