Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
567 views
in Technique[技术] by (71.8m points)

node.js - twilio receive sms without responding back

Good Day,

How do I properly receive an SMS on my web app using twilio without responding back to the sender.

I read about this.. https://support.twilio.com/hc/en-us/articles/223134127-Receive-SMS-messages-without-Responding but I need to use the webhook to send the sms to my webapplication too, if I do receive it without setting a response, It will generate an Error - 11200 (HTTP retrieval failure) how do I prevent this? also by setting up respones.

my code is

var resp = new twilio.twiml.MessagingResponse();
resp.message('<Response></Response>');
                      res.writeHead(200, {
                        'Content-Type':'text/xml'
                      });
                      res.end(resp.toString());

sadly this one sends <Response></Response> to the sender instead.. im using nodejs by the way.. Thanks!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Those who are finding this in 2021,

If you need to just recieve message from twilio and not send any message to user then you can use this code.

res.writeHead(200, {'Content-Type': 'text/plain'});
res.end();

For more refer this doc, Receive SMS and MMS Messages without Responding


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...