How can I return nothing back to the twilio process after processing the sms message?
The examples in the api use the MessagingResponse and when that is used, it comes in as a Direction='reply' in the message log on the console. This incurs an additional charge (inbound + reply). Simply put, I want to do this..
app.post('/sms', (req, res) =>
{
console.log('hello world');
}
without getting a 11200 error.
Try an empty string as the response message (Twilio needs you to return valid XML).
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();
// twiml.message('');
res.writeHead(200, {'Content-Type': 'text/xml'});
res.end(twiml.toString());
});
http.createServer(app).listen(1337, () => {
console.log('Express server listening on port 1337');
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With