我需要在nodejs中创建双向SMS API。我收到来自twilio的消息,但当我回复同一消息时,我没有收到消息
reply.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更新了来自ngrok的消息的webhook中twilio数字的url。每当我回复消息时,我都无法在ngrok中看到任何日志。请帮帮我。基于印度的号码有什么限制吗?我过去经常回复印度号码的留言。
发布于 2020-09-16 19:51:27
在Twilio控制台中检查您的debugger,它很可能有一条错误消息。您必须发送短信到Twilio,以便您的TwiML,Thank you for calling!. We got your message, Thank You.应用。
发布于 2020-09-17 11:31:58
调试器是检查您的配置是否设置正确的第一个位置。所有webhook调用、错误和警告都记录在那里
https://stackoverflow.com/questions/63917905
复制相似问题