【发布时间】:2021-06-15 17:12:09
【问题描述】:
以下代码运行良好,我已经在本地运行 nGrok 进行了测试。
我留下但想不通的两个要求是:
- 获取发件人的电话号码(放入变量)
- 捕获发件人发送的文本正文(放入变量中)
非常感谢!
const express = require('express');
const MessagingResponse = require('twilio').twiml.MessagingResponse;
const app = express();
});
app.post('/sms', (req, res) => {
// Start our TwiML response.
const twiml = new MessagingResponse();
// Add a text message.
const msg = twiml.message('some canned response');
res.writeHead(200, {'Content-Type': 'text/xml'});
res.end(twiml.toString());
});
app.listen(3000, () => {
console.log('Example app listening on port 3000!');
});
【问题讨论】:
标签: node.js twilio webhooks twilio-twiml