John Sorensen
John Sorensen

Reputation: 960

Not Respond to Twilio Webhook Node.js

How can I respond to a twilio post request webhook without sending back the user a message? I have a use case where, when I receive a user message through my twilio webhook, I don't want to respond right away. Presumbably I need to respond to the post request, so is there any way I can respond to the request while preventing a message from being sent to the user?

Upvotes: 0

Views: 405

Answers (2)

Alan
Alan

Reputation: 10771

You should respond with empty TwiML.

A response without anything nested under it.

Upvotes: 1

Lucky
Lucky

Reputation: 51

If I understand correctly, you are handling sms message and doesn't want to respond to the message immediately.

In this case, you can simply return 200 Ok to the incoming webhook message.

For node express server, you can return by

res.sendstatus(200)

You can find more details here - http://expressjs.com/en/4x/api.html#res.sendStatus

Upvotes: 4

Related Questions