Let's use Twilio in Java! (Introduction)

From now on, I'll write an article about using Twilio in several parts. There seems to be an article in Ruby and PHP, but I didn't have much Java, so I decided to write it.

About Twilio

Simply put, it is a cloud service with functions such as voice call, SMS, and fax. You can send SMS and make phone calls from your application. In Japan, KDDI Web Communications seems to be the agency.

https://www.twilio.com/ja/ https://cloudapi.kddi-web.com/availability/

Twilio registration

You'll need to register for a Twilio account and purchase a phone number. Registration is also written in other articles, so I will omit it.

In addition, it seems that trial registration is also possible. It seems that there are restrictions such as only one free phone number, but you should probably be able to do it this time.

Purpose

I've been addicted to using Twilio, so I hope it helps people who are in trouble in similar areas.

I'm planning

It is three of.

By the way, SMS is cholo. Voice calls and faxes can be a bit annoying.

Environment and other assumptions

This article assumes the following:

If you want to use different libraries individually, write them each time. (There should be no problem even if the version is different)

Let's create a development environment

It is a premise that maven has a template of Spring Boot.

pom.xml Add the Twilio SDK to pom.xml.

pom.xml


<!-- Twilio SDK -->
<dependency>
  <groupId>com.twilio.sdk</groupId>
  <artifactId>twilio</artifactId>
  <version>7.42.0</version>
</dependency>

Next time preview

I will try to implement the best SMS transmission.

Recommended Posts

Let's use Twilio in Java! (Introduction)
Use OpenCV in Java
Use PreparedStatement in Java
Let's use Java New FileIO! (Introduction, for beginners)
Use Redis Stream in Java
[Java] Do not use "+" in append!
Use composite keys in Java Map.
How to use classes in Java?
[Java] Introduction
Do you use Stream in Java?
Multilingual Locale in Java How to use Locale
Use OpenCV_Contrib (ArUco) in Java! (Part 2-Programming)
[Java] Use cryptography in the standard library
Use "Rhino" which runs JavaScript in Java
Let's use Swift Package Manager (SwiftPM) ~ Introduction ~
Let's study Java
Partization in Java
Changes in Java 11
Rock-paper-scissors in Java
Let's use jcmd
[Java] Introduction to Java
[Java] Use Collectors.collectingAndThen
Introduction to java
Pi in Java
FizzBuzz in Java
[Java] Use of final in local variable declaration
Let's create a super-simple web framework in Java
[Java] Let's create a mod for Minecraft 1.14.4 [Introduction]
Let's keep this in mind What's new in Java 9
[Java] Let's create a mod for Minecraft 1.16.1 [Introduction]
[JAVA] [Spring] [MyBatis] Use IN () with SQL Builder
Why use setters/getters instead of public/private in Java
Java Performance Chapter 1 Introduction
[java] sort in list
[Java] Let's declare variables used in the loop in the loop [Variables in the block]
Read JSON in Java
[LeJOS] Let's program mindstorm-EV3 in Java [Environment construction part 2]
Interpreter implementation in Java
Make Blackjack in Java
Let's touch on Java
Rock-paper-scissors app in Java
[Introduction to Computer Science No. 0: Try Machine Learning] Let's implement k-means clustering in Java
Constraint programming in Java
Put java8 in centos7
NVL-ish guy in Java
Combine arrays in Java
"Hello World" in Java
Callable Interface in Java
Use java.time in Jackson
I want to use ES2015 in Java too! → (´ ・ ω ・ `)
Azure functions in java
Format XML in Java
Simple htmlspecialchars in Java
Boyer-Moore implementation in Java
Use Interceptor in Spring
Hello World in Java
Quick learning Java "Introduction?" Part 2 Let's write the process
webApi memorandum in java
Type determination in Java
Ping commands in Java
Various threads in java