You can find it in the Messaging Services page of the Twilio Console. Since a Messaging Service is used to schedule the SMS, another variable named TWILIO_MESSAGING_SERVICE_SID must also be created. Go ahead and follow the same instructions to store your phone number as the PHONE_NUMBER key in the IntelliJ IDEA environment. This would be helpful in the case that the code is shared on a public repository so that the phone numbers are not exposed. Not only is it mandatory to set the Twilio credentials as environment variables, it is also suggested that you store both your Twilio phone number and personal phone number as environmental variables. Refer to this article to set up and hide variables in the IntelliJ IDEA environment. You can find your account credentials on the Twilio Console. It is best practice to protect your Twilio account credentials by setting environment variables. on the left-hand side and create a new application named "ScheduledText". If there are no existing configurations for you to edit, click on Add New. This image is reused and the project directory name does not reflect the one used in this project.Īnother window displaying the "Run/Debug Configurations" will pop up with the details regarding the project. Locate the Run tab at the top of the IntelliJ IDEA console and select Edit Configurations. Look at the top-right corner of the IntelliJ IDEA and find the little icon with an "M" shape. Navigate to the pom.xml file to add the following text to include dependencies in your project: In the “Body Text” enter some text to send yourself.Ĭlick the “Send test SMS” button, and make sure you receive the SMS on your phone. In the “From Messaging Service SID”, select the Messaging Service you just created. In the “To phone number” pulldown, select your personal number, which should be registered and verified with your Twilio accoun t if you have a trial account. It is a good idea to test that your messaging service is able to send messages, so go ahead and click on “Try sending a message”. You will now be offered the option to send a test message. To complete the configuration of your Messaging Service, click on “Complete Messaging Service Setup”. You don’t have to change any of the settings on this page, just click on “Step 4: Add compliance info”. Select Phone Number in the “Sender Type” dropdown, and click “Continue”.Īdd a checkmark next to the phone number you want to use as a sender, and click “Add phone numbers”.Ĭlick the “Step 3: Set up integration” button to move on to the next step. Click the “Add Senders” button to add the Twilio phone number you acquired in the previous section. In this part of the configuration, you have to add the sender phone number(s) to the sender pool used by the service. On the first page of the creation process, enter a friendly name for the service, such as “Appointments”, and select “Notify my users” in the “Select what you want to use Messaging for” dropdown.Ĭlick the “Create Messaging Service” button to move to the second step. Then click the “Create Messaging Service” button. Still in the Console, find the “Messaging” product and click on its Services option. Scheduled messages can only be sent from a Messaging Service at this time, so the next step is to configure one and add your Twilio phone number to it. After you confirm your purchase, click the “Close” button. If you’d like to request a number that is local to your region, you can enter your area code in the “Number” field.Ĭlick the “Search” button to see what numbers are available, and then click “Buy” for the number you like from the results. On the “Buy a Number” page, select your country and check SMS in the “Capabilities” field. Note that if you have a free account, you will be using your trial credit for this purchase. Log in to the Twilio Console, select Phone Numbers, and then click on the “Buy a number” button to buy a Twilio number. If you haven't done so already, your first task is to purchase a Twilio phone number to send SMS. Click on the directory to find and download the file and save it to your java_voice project folder. Scroll down to find the directory named after the latest release version. The latest version of the jar files at the time of writing is twilio-9.0. Next, you need to download the standalone Twilio Java helper library.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |