Skip to content

Instantly share code, notes, and snippets.

@kwhinnery
Created December 4, 2019 21:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kwhinnery/16ed88bc6df9e14d2aae29d7347c8690 to your computer and use it in GitHub Desktop.
Save kwhinnery/16ed88bc6df9e14d2aae29d7347c8690 to your computer and use it in GitHub Desktop.
app.post('/message', function(req, res, next) {
// Use the REST client to send a text message
client.messages.create({
to: req.body.to,
from: TWILIO_PHONE_NUMBER,
body: 'Good luck on your Twilio quest!'
}).then(function(message) {
// When we get a response from Twilio, respond to the HTTP POST request
res.send('Message is inbound!');
}).catch(function(error) {
console.log(error);
}) ;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment