You will need to create a Twilio account in order to test outgoing and incoming replies and/or to live text with Heroku or AWS. If you need to use Twilio with live keys, do the following to send messages and receive incoming replies:
If you are using these instructions for an Heroku instance or AWS Lambda instance, replace references to <YOUR_NGROK_APP_URL> with your actual app url (i.e. examplespokeapp.herokuapp.com )
- If you are using these instructions for development (not Heroku), start ngrok.
- A reasonable command line for
ngrok
isngrok http -subdomain=<UNIQUE_NAME> 3000
(Replace <UNIQUE_NAME> with something likely to be globally unique. Use the same <UNIQUE_NAME> each time you start ngrok. If you use a different <UNIQUE_NAME> it will be necessary to change the configuration in Twilio.) - When you start
ngrok
, it will display the external-facing app URL. Use that below to replace <YOUR_NGROK_APP_URL>
- Create a Twilio acccount: https://www.twilio.com/
- Click on
Programmable SMS
on the side panel - Click on
Messaging Services
, and click the plus - Create a friendly name
- Under
Properties
SERVICE SID
isTWILIO_MESSAGE_SERVICE_SID
- Under
Inbound Settings
- Make sure
PROCESS INBOUND MESSAGES
is selected REQUEST URL
ishttps://<YOUR_NGROK_APP_URL>/twilio
(or for Heroku instructions,https://<YOUR_HEROKU_APP_URL>/twilio
)
- Under Outbound Settings
STATUS CALLBACK URL
in your Twilio console ishttps://<YOUR_NGROK_APP_URL>/twilio-message-report
(or for Heroku instructions,https://<YOUR_HEROKU_APP_URL>/twilio-message-report
)- TWILIO_STATUS_CALLBACK_URL in your .env file is
https://<YOUR_NGROK_APP_URL>/twilio-message-report
(or for Heroku instructions,https://<YOUR_HEROKU_APP_URL>/twilio-message-report
)
- Visit the dashboard
- Under
Account Summary
TWILIO_API_KEY
in your .env file (or Heroku config variable) isACCOUNT SID
in your Twilio consoleTWILIO_APPLICATION_SID
isTWILIO_MESSAGE_SERVICE_SID
(these are the same values)TWILIO_AUTH_TOKEN
in your .env file (or Heroku config variable) isAUTH TOKEN
in your Twilio console
- If you want to send live text messages as part of your testing, you must buy a phone number and attach it to your project.
- Click on
Numbers
and press on+
. Search for a area code and click on buy (trial Twilio accounts give you $15~ to work with). In order to send messages, you will have to connect a credit card with a minimum charge of $20.