PLEASE NOTE: This script is provided to help you get started. Unfortunately, our free support does not include custom scripts. Any competent JS developer should be able to manipulate this script for your needs. Please contact us if you need help to find a developer. Please thoroughly test before use.
Introduction:
- In some cases you may want to send a Webhook/API call in the background.
- This can be accomplished by using an AJAX request.
Step-by-Step Instructions:
Step 1: Create a node level script to look like this:

Step 2: Then copy/paste this code:
<script>
var url = "https://webhook.site/1868ac28-8bb7-4062-87b9-047ac59f2c3d";
var params = "first_name={first_name}";
var xhr = new XMLHttpRequest();
xhr.open("POST", url, true);
//Send the proper header information along with the request
xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhr.send(params);
console.log("request sent!");
</script>
- The ‘url’ variable must be changed to your target server
- The ‘params’ variable is where you add your body. The same format applies as when using the webhook/api nodes. In this example we specify key/value pairs separated by &. For example: “first_name={first_name}&last_name={last_name}”.
- The third parameter of the open function declares this request be ‘true’ as an asynchronous request. So that it fires in the background.
- The setRequestHeader is not exactly the same as the webhook/api node. The POST method only allows the following MIME types: “text/plain”, “application/x-www-urlencoded” and “multipart/form-data”. Just bear in mind that your params format will need to match their respective type.
Download Demo here: