本文介绍了如何通过 zapier webhook 通过 twilio 发送 whatsapp 消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前正在尝试创建一条 Whatsapp 消息,通过 Twilio API 显示的 Zapier 上的此自定义 Javascript 代码发送.它成功地与 twilio 联系,但返回身份验证错误 - 未提供凭据".

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);

在whatsapp上简单地向zapier上的潜在客户发送确认文本的最佳方法是什么?提前致谢

What is the best approach to take to simply send a confirmation text on whatsapp to prospects on zapier? Thanks in advance

推荐答案

感谢您的帮助,我最终通过使用更简单的自定义 Web 钩子 POST 方法解决了这个问题,但我把它复杂化了.有关我如何为其他想要通过 Twilio 在 Zapier 上发送 WhatsApp 消息的人执行此操作的详细信息:

Thank you for your help, i ended up solving this by using a much simpler Custom web hook POST method, i was over-complicating it. Details on how i did this for anybody else wanting to send whats-app messages through Twilio on Zapier Below:

方法

Post

网址

https://api.twilio.com/2010-04-01/Accounts/<accountSID>/Messages.json

数据

To=whatsapp:%2B<toNumber>&From=whatsapp:%2B<fromNumber>&Body=Put your message body here

注意:您的 E.164 号码的 + 将连接起来,因此 %2B 将替换它

基本身份验证

<AccountSID>|<AccountToken>

标题

Content-Type | application/x-www-form-urlencoded

这篇关于如何通过 zapier webhook 通过 twilio 发送 whatsapp 消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-16 12:35