Webhook not working through Google scripts

Hello,

I am trying to trigger a deployment through Webhook from google scripts with UrlFetchApp post method but I am getting the following Error
Exception: Request failed for https://api.netlify.com returned code 404. Truncated server response: Not Found

The webhook working fine from Postman - Thunder client.

Does anybody have a clue why is this happening.

Thanks.

Hi @giannis

Can you share the relevant part of your script? This will help others help you debug.

My script without build number

function postRequest() {
// Make a POST request 


var url = 'https://api.netlify.com/build_hooks/number';
var options = {
  'method' : 'post'
};

response = UrlFetchApp.fetch(url, options);

var text = response.getResponseCode();

console.log(response)

}

Hi, @giannis. I think it is just that the request is using POST. Would you please try using a GET request?

Worked! as is with a new webhook, and not the old one.