We are currently in the process of updating this sample template. If you are encountering any issues with the sample, please open an issue at github.com/twilio-labs/code-exchange/issues and we'll try to help you.
Learn how to automate your workflow using Twilio's REST API and Twilio SMS. This example app is a vacation rental site, where the host can confirm a reservation via SMS.
-
You will need to configure Twilio to send requests to your application when SMS are received.
You will need to provision at least one Twilio number with sms capabilities so the application's users can make property reservations. You can buy a number right here. Once you have a number you need to configure it to work with your application. Open the number management page and open a number's configuration by clicking on it.
Remember that the number where you change the SMS webhook must be the same one you set on the
TwilioPhoneNumber
settings.To start using
ngrok
in our project you'll have execute to the following line in the command prompt.ngrok http 4567 -host-header="localhost:4567"
Keep in mind that our endpoint is:
http://<your-ngrok-subdomain>.ngrok.io/Reservations/Handle
-
Clone this repository and
cd
into it.git clone [email protected]:TwilioDevEd/airtng-csharp.git cd airtng-csharp
-
Create a new file
AirTNG.Web/Local.config
and update the content.<?xml version="1.0" encoding="utf-8"?> <appSettings> <add key="TwilioAccountSid" value="Your Twilio Account SID" /> <add key="TwilioAuthToken" value="Your Twilio Auth Token" /> <add key="TwilioPhoneNumber" value="Your Twilio Phone Number" /> </appSettings>
-
Build the solution.
-
Run
Update-Database
at Package Manager Console to execute the migrations. -
Run the application.
-
Check it out at http://localhost:4567
That's it!
To let our Twilio Phone number use the callback endpoint we exposed, our development server will need to be publicly accessible. We recommend using ngrok to solve this problem.
- No warranty expressed or implied. Software is as is. Diggity.
- The CodeExchange repository can be found here.
- MIT License
- Lovingly crafted by Twilio Developer Education.