This guide illustrates how to incorporate SMS functionality into your web application. We’ll use Twilio as the SMS provider.

Pre-requisites

You’d need to install the Integration Library package using the LANSA Package Manager.
See this usage guide for how to use the LANSA Package Manager.

Running the Sample Application


Follow the steps outlined in the rest of this guide before running the sample application.
You’d need to first configure your Integration Library with your Twilio account.

Please Read Before Proceeding

Note that you may be required to provide credit card details and charged by Twilio when using their services. It is your responsibility as the LANSA developer to read and agree to Twilio’s terms and conditions before proceeding with account creation and comply with their payment requirements. LANSA will NOT be responsible for any charges that are incurred from following the steps in this guide to make use of Twilios service(s).

Navigate to Twilio Website

Open your favourite browser and navigate to https://www.twilio.com
If you already have a Twilio account, skip the next section.

Creating a New Twilio Account

Click on the Sign Up at the top-right.

Complete the form and click on the button at the bottom.

You should receive a verification email. Open the email and click on the link to start the activation process.

Enter your phone number when prompted (it can be either a landline or mobile/cellphone).

Twilio’s automated system will give you a code on the phone number you provided. Enter the code and press the button.
You have now completed the sign-up process and your account is ready!
Complete the initial questionnaires. Choose No when asked if you write code, then click on the Skip to Dashboard button.

Acquiring a Phone Number

In the dashboard, you would have your first project already created for you as part of the automated trial setup.
You now need to get a trial number that you can use to send SMS.

You will be presented with a phone number that has a voice and SMS capabilities.

You will be asked to enter your address. Complete the form. You will be presented with a confirmation dialog that you have successfully obtained the number.

Registering Recipient Numbers (Trial Only)

Trial accounts can only send SMSs (or make voice calls) to verified phone numbers only (this limitation does not apply to non-trial accounts).
Note that the main phone number you provided when you signed up earlier is verified already, so if you provided a mobile number, you can just use that, there is no need to verify another phone number.
Start registering the recipient numbers by click on this link:


Complete the form and the verification process.

Configuring the Integration Library

You’d need to tell the Integration Library to use your new Twilio account. You need 2 pieces of information: your account SID and the auth token.
Go to the your Twilio account’s dashboard, and you will find your account SID and the auth token there. Click on the Copy button to copy them to clipboard.
Launch the Integration Library configuration tool from the Package Manager. See the Configuring the Integration Library section in this guide for more details.
Navigate to Twilio settings.

Enter the account SID and the auth token

Upgrading Your Account to Full Account

If you are happy with the way Twilio works, you are ready to upgrade your account to a full account. Click on the Upgrade Project button at the top, then enter your billing and payment information.  It is your responsibility as the LANSA developer to read and agree to Twilio’s terms and conditions before proceeding with account creation and comply with their payment requirements. LANSA will NOT be responsible for any charges that are incurred from following the steps in this guide to make use of Twilios service(s).