【问题标题】:I am not able to implement to reply message to twilio number我无法将消息回复到 twilio 号码
【发布时间】:2020-09-16 10:18:09
【问题描述】:

我需要在 nodejs 中创建 2 路 SMS API。我收到了来自 twilio 的消息,但是当我回复同一条消息时没有收到消息

回复.js

const http = require("http");
const express = require("express");
const MessagingResponse = require("twilio").twiml.MessagingResponse;
const app = express();
app.post("/sms", (req, res) => {
  const twiml = new MessagingResponse();
  console.log(req.body);
  twiml.message("Thank you for calling!. We got your message, Thank You.");
  res.writeHead(200, { "content-Type": "text/xml" });
  res.end(twiml.toString());
});

http
  .createServer(app)
  .listen(3000, () => console.log("server is up and running on port 3000"));

我通过 ngrok http 3000 更新了 webhook 中 twilio 编号中的 url,以获取来自 ngrok 的消息。 每当我用来回复消息时,我都无法在 ngrok 中看到任何日志。 请帮助我。 印度原产地号码是否有任何限制。我以前用印度号码回复messgae。

【问题讨论】:

  • "I updated the url in twilio number in webhook"。检查该 url 并确保它包含 /sms,而不仅仅是 ngrok 域。

标签: node.js twilio sms twilio-twiml inbound


【解决方案1】:

在 Twilio 控制台中检查您的 debugger,它很可能有一条错误消息。您必须将 SMS 发送到 Twilio 以供您的 TwiML Thank you for calling!. We got your message, Thank You. 申请。

【讨论】:

    【解决方案2】:

    调试器是查看您的配置是否正确设置的第一个地方。 所有 webhook 调用错误和警告都记录在那里

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多