繁体   English   中英

我无法实现向 twilio 号码回复消息

[英]I am not able to implement to reply message to twilio number

我需要在 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"));

我更新了 webhook 中 twilio 编号中的 url,以便消息来自 ngrok http 3000 的 ngrok 字段。每当我用来回复消息时,我都看不到 ngrok 中的任何日志。 请帮助我。 基于印度的号码是否有任何限制。 我曾经从印度号码回复消息。

在 Twilio 控制台中检查您的调试器,它很可能有一条错误消息。 您必须为您的 TwiML 向 Twilio 发送短信, Thank you for calling!. We got your message, Thank You. Thank you for calling!. We got your message, Thank You. 申请。

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM