HI, Questetra users! I’m HATANAKA, Questetra CTO.
At the end of the previous blog post “Phone Number Verification through Web Form Application”, I mentioned that
Some may say that if I specialize the phone number to mobile phone, SMS is enough rather than a phone call.
Twilio can also handle SMS, so I’d like to work on sending SMS.
To do so, I will utilize “Send an SMS with the SMS API” of Twilio.
I needed two steps for the API to make a phone call, but this can be realized in one step. Simple.
Just send a POST request for a specific URL, including the following parameters.
- Source number
- Destination telephone number
However, there are caveats in the phone numbers to be used. Which is, SMS cannot be sent with a Japanese telephone number that can be purchased at Twilio. Therefore, I need to purchase a phone number that is “other than Japan” and capable of sending SMS to Japan. Depending on the country, there may be cases where even though you can use SMS, it is capable of sending only to the number in the same country. With a U.S. phone number, you can send SMS anywhere in the world.
Although all of voice/SMS/MMS/FAX can be sent if these were checked at buying like in the above figure, I will ignore MMS (Multimedia Messaging Service) since the service is not provided in Japan.
Now, I will create a simple Workflow App.
It is a flow that
- At “Input” Step, destination phone number and a message text are entered.
- “Send” (auto) Step is a Throwing Message Intermediate Event (HTTP), and it calls “SMS API”.
Data Items are as follows.
Although the input check etc is not the points this time, I set it continuing the contents of the last time.
|Data Item||Type||Required||Permission at “Input” Step|
|Title||String type single line||No||Editable|
|Phone number||String type single line||Yes||Editable|
|Regular expression to be satisfied:
Please start with the country code (+81).<br>Only numeric without a hyphen.
|Text body||String type multiple lines||Yes||Editable|
I will show you a list of variables used in the App.
|AccountSID||Account ID of Twilio|
|AuthToken||token used for accessing API (AUTHTOKEN). Something like a password.|
|PhoneNumber||The phone number to call. Those purchased from Twilio. Designated in international call format.|
Finally, it is the setting of Throwing Message Intermediate Event (HTTP).
|HTTP Method||POST (application/x-www-form-urlencoded)|
|Security||Connect with Basic Authentication|
Regarding Send parameters, it is as follows.
That’s it, for the development of the App. The content as exactly as entered in the text body will be sent to the destination mobile phone/smartphone via SMS.
There is one point to note. In the setting of the mobile phone/smartphone receiving SMS, it could be set to not receiving SMS from overseas. Also, instead of the settings of the terminal, but also the setting of the mobile carrier could be so. In that case, SMS sent from this Workflow App cannot be received. That is because the SMS is not from Japan.
That’s it for today. Next time, I would like to substitute the part of Throwing Message Intermediate Event (HTTP) with a Script Task. See you around.