Currently trying to create a Whatsapp message to be sent via This custom Javascript code on Zapier shown via Twilio API. It successfully reaches out to twilio but returns "Authentication Error - No credentials provided".
var messagesUrl = "https://api.twilio.com/2010-04-01/Accounts/<accountSID>/Messages.json";
var payload = {
"To": "whatsapp:<tonumber>",
"Body" : "Hey This is a test",
"From" : "whatsapp:<fromnumber>"
};
var options = {
"method" : "post",
"payload" : payload
};
options.headers = {
"Authorization" : "Basic <accountsid>:<accounttoken>"
};
fetch(messagesUrl, {options, body: JSON.stringify(payload)})
.then(function(binaryResponse) {
return binaryResponse.json();
})
.then(function(jsonResponse){
callback(null, {result: jsonResponse});
}).catch(callback);
What is the best approach to take to simply send a confirmation text on whatsapp to prospects on zapier? Thanks in advance