Connecting to Twilio and send SMS
This page explains how to integrate Kuroco with Twilio and send SMS from Kuroco.
SMS transmissions from Kuroco are compatible with Japanese domestic phone numbers starting with "090", "080", "070", and "060".
Integrate with Twilio
1. Register a Twillio account
Register your Twilio account. Visit Twilio's site.
Click "Start for free" on the top right.
Fill in the required fields, check "I accept the Twilio Terms of Service..." and click the red button "Start Your Free Trial". A dialog box will appear to verify that you are not a robot. Please follow the instructions and proceed.
The following screen will be displayed and a confirmation email will be sent.
Please check your email and open the email sent by Twilio. Click the red button in the email body that says "Verify Your Email". Sign up is now complete.
2. Set up two-factor authentication
Then set up two-factor authentication. Please log in to the Twilio console screen from the URL below.
https://www.twilio.com/login
Please enter your mobile phone number to set up two-factor authentication.
Check the SMS sent to your mobile device and enter the verification code.
The recovery code will be displayed as shown below, so please make a note of it. You can use it when you lose your mobile device.
Enter your phone number again to verify your identity.
The settings of two-factor authentication is now complete.
The survey from Twilio will be displayed. Answer about the service you're looking to build using Twilio products.
3. Get the phone number to send from
Instructions for getting started with Twilio products are displayed. Click the blue button that says "Get a Twilio phone number" to get one USA or Canada phone number. This number will be used as the source phone number when sending SMS using Twilio.
4. make a payment
Next, click "Upgrade" in the header and proceed with payment.
5. Get system linkage information
Click on the part that says "My first Twilio account" in the header to go to the console top page. From the section labeled "Account Info," please copy and keep the following values.
- Account SID
- Auth Token
- My Twilio Phone number
6. Set up on Kuroco Admin panel
Next, access your Kuroco admin panel and click[External system integration] > [Text(SMS)] on the side menu.
Check "Enable" for [Text(SMS)] and enter Account SID, Auth Token and My Twilio Phone number you saved previously.
Then click [Update].
The settings on admin panel is now complete.
How to use linked SMS
To send SMS from Kuroco, you need to write an SMS sending program in your custom process. Originally, some timing such as batch processing or a specific Post-process is used as a trigger to call custom function.
Here, we will implement custom function for testing and try to execute it manually.
1. Add custom function
Click [Operation] > [Custom function] on the side menu.
Click [Add] on the top right of the page.
Enter as follows and click [Add].
item | value |
---|---|
Title | Enter any name. (SMS sending test in this tutorial) |
Category | Select the type of custom function (uncategorized in this tutorial) |
Identifier | Enter the identifier to be used when calling this custom process from another. (sms_test in this tutorial) |
Please implement the custom function as below and click the "Test" button. Please write the recipient's phone number without hyphens, such as 090xxxxxxxx, for the part written as "(phone number)".
Sending SMS from Kuroco is limited to phone numbers in Japan starting with "090", "080", "070", "060".
{sendmail
var=result
to="(phone number)@twilio.r-cms.jp"
subject="Test"
contents="This is sent from Kuroco"}
You cannot send SMS to any phone number from Twilio during the trial period. If you want to test sending SMS during the trial period, you need to register the destination phone number in "Verified Caller IDs".
The test is successful if the message below arrives on the terminal.
Now you can send SMS by linking Kuroco and Twilio.
Support
If you have any other questions, please contact us or check out Our Slack Community.