Skip to content

Instantly share code, notes, and snippets.

@dbabbs
Last active December 1, 2017 02:57
Show Gist options
  • Save dbabbs/8942dffb360a653c261384a7c1c84e3c to your computer and use it in GitHub Desktop.
Save dbabbs/8942dffb360a653c261384a7c1c84e3c to your computer and use it in GitHub Desktop.
app.post('/sms', (req, res) => {
const twiml = new MessagingResponse();
var incoming = req.body.Body;
if (incoming.length > 1) {
request.get(geocodeURL, (error, response, body) => {
//geocode request
request.get(placesURL, (error, response, body) => {
//Places request
//send first message to user
});
});
} else if (places.length > 0 && incoming.length == 1) { //reply
//send second message to user
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment