Created
December 4, 2019 21:12
-
-
Save kwhinnery/16ed88bc6df9e14d2aae29d7347c8690 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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