Send Art of War quotes to friends using Twilio SMS
This is an example of how to create a call & response Sms service using Go, Ngrok and Twilio. The Go server is used to create a feedback loop that will receive an incoming Sms and route the incoming Sms number to a function that will send a response Sms. Ngrok is used to port forward api calls to a specified Twilio phone number that is connected via a webhook. After a user sends the initial Sms, a response Sms is sent back containing a quote from Sun Tzu's Art of War.
- twiliogo [https://github.com/carlosdp/twiliogo]
- Add your Twilio credentials to the file twilioArtOfWarSms.go
- Start the go application
go run twilioArtOfWarSms.go
- Start a ngrok server
ngrok http 8027
- Copy the the "Forwarding" url
- Navigate to your Twilio dashboard, select an active number and navigate to the "Messaging" section
- Paste the "Forwarding" url in the "A message comes in" section as a HTTP Post Webhook