How to Configure Sending SMS via Alpha SMS
Alpha SMS allows sending SMS messages, including OTP (one-time-password) for client verification. This is useful for providing access to a wide range of services (discounts, personal account, online payment capability, and more).
📖 Documentation: For more details about Alpha SMS API, read on the official website.
Prerequisites
- Active Alpha SMS account
- API key from Alpha SMS
- Registered alpha name for mailings
Obtaining API Key
- Sign in to Alpha SMS management panel
- Go to the API section
- Create or copy the API key
Obtaining Alpha Name
- In the Alpha SMS panel, go to the settings section
- Register an alpha name for mailings
- Wait for approval
Configuring action sms_alphasms_send
For sending SMS, the sms_alphasms_send action is used.
Configuration
Fill in the JSON config:
{
"auth": "635f14be894033beded246d3adf9b199fdd51e06",
"url": "https://alphasms.ua/api/http.php",
"sms_signature": "Alpha"
}
Parameters:
auth— your API key to the Alphasms serviceurl— API URL for requests to the Alphasms servicesms_signature— alpha name for mailings (obtained through the Alphasms service)
Required Variables
For correct action operation, you need to have 3 variables in state:
otp— OTP generated on the ConnectiveOne sidephone— user phone number to which the SMS message will be sentid— sequential message number (must be unique)
⚠️ Important: Variables must be set in state before calling the action.
Example Scenario Configuration for Sending OTP
Step 1: Generating OTP and ID
Use action for generation:
{
"id": "roundTo(random(1)*1000000,0)",
"otp": "roundTo(random(1)*10000,0)"
}
Explanation:
id— 6-digit message number (random number from 0 to 1 is generated, multiplied by 1000000, rounded)otp— 4-digit OTP for sending to user (random number from 0 to 1 is generated, multiplied by 10000, rounded)
Step 2: Getting Phone Number
Get the user's phone number through the "Wait for user response" block with phone number validation setting.
Step 3: Using sms_alphasms_send
After generating OTP and getting the phone number, use the sms_alphasms_send action.
Result: In case of success, the previously generated OTP code will arrive at the specified user number.
Step 4: Verifying Entered Code
After successful sending, add a block to verify the code entered by the user.
JSON config setting for if_else action:
{
"if": {
"{{sended_otp}}=={{otp}}": "ok",
"event": "ok"
}
}
Logic:
- If
sended_otpequalsotp— transition byokevent - On success, the user gets access to information
- If verification is not passed — they will be offered to retry or contact the operator
Error Handling
If SMS sending ended with an error, the action returns "error". In the scenario, you can handle this event for:
- Retry
- Sending message to user
- Transfer to operator
Limitations
- Action configuration requires access to a third-party SMS sending service API and basic JSON knowledge
- Phone number must be in the correct format (depends on Alphasms requirements)
- OTP code must be numeric
- Message ID must be unique
Related Articles
- AlphaSMS API Documentation — official AlphaSMS documentation
- Create custom action — creating custom actions through ActionJail