Skip to main content

Hi all,

 

So i’m trying to send data from my website to a zapier webhook using my own code. I’m trying to do it in pure javascript but i cant seem to pick the sent data up, if it’s sending at all.

 

Here’s my example:

var request = new XMLHttpRequest();

var webhookURL = "https://hooks.zapier.com/hooks/catch/11111/ttttttttt/";

var data = {

download: event.data.download,

upload: event.data.upload,

};

request.open("POST", webhookURL, true);

request.setRequestHeader('Content-type', 'application/json; charset=UTF-8"');

request.send(JSON.stringify(data));

 

 

I’m not sure if this is the kind of thing that anyone here could help me but i’d thought it would be worth a shot.

 

Thanks.

@CoolGuy In situations like this there are many variables, so I try to take out one of the variables, I would recommend taking out Zapier and swapping it to a Webhook Testing site like https://webhook.site/ send the POST to there which will allow you to inspect it and verify that indeed your script is sending out the information and that it’s being received correctly by the resulting server/webhook URL. 

 

Based on that, if it works perfectly (send a screenshot of the out put from Webhook.site and then we can look into what might be wrong over at Zapier on the webhook receiving trigger step.


For anyone wondering I actually managed to get it working.

Using this:

 

var request = new XMLHttpRequest();

var webhookURL = " ";

 

var data = {

"name" : name

};

request.open("POST", webhookURL, true);

request.setRequestHeader('Content-type','application/x-www-form-urlencoded');

request.send(JSON.stringify( data ));


I tried implementing this and seems like it only hits the webhook every few tries. Any ideas why that might be?