问题描述
我需要在nodejs中创建2种方式的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"));
我更新了webhook中的twilio编号中的url,以便ngrok http 3000从ngrok中输入消息。 每当我用来回复邮件时,我都看不到ngrok的任何登录。 请帮助我。 印度原籍号码有任何限制吗?我以前是从印度的电话号码回信。
解决方法
在Twilio控制台中debugger检查您,它很可能显示错误消息。您必须发送短信到Twilio才能使用TwiML Thank you for calling!. We got your message,Thank You.
进行申请。
调试器是查看配置是否正确设置的第一位。 所有的Webhook呼叫错误和警告均记录在此处