OTP SMS delivers a one-time password to a user's phone to verify a sign-up, login or payment. BG TEL SMS routes OTP and other transactional messages through a high-priority channel, and most arrive within 1–5 seconds on every operator in Bangladesh. You send them with one HTTPS API call, marked as transactional, from any language or platform.
What is OTP SMS?
An OTP (one-time password) SMS is a short code, usually 4–6 digits, that your system generates and sends to a user's phone. The user types it back to prove they own that number. Apps, websites, banks, MFS wallets and e-commerce checkouts in Bangladesh use OTP SMS for:
- Phone number verification at sign-up
- Two-factor authentication (2FA) at login
- Payment and transaction confirmation
- Password reset and account recovery
- Cash-on-delivery order confirmation
For why SMS is still the most widely used second factor, read why OTP SMS is still the gold standard for 2FA.
What makes a good OTP SMS provider
| Requirement | Why it matters | BG TEL SMS |
|---|---|---|
| Speed | Users abandon sign-ups if the code is late | Priority route for OTP and transactional SMS; most messages delivered within 1–5 seconds |
| Operator coverage | A code that never reaches a network means a lost user | Direct connections with all major operators in Bangladesh |
| Licensing | Business SMS must travel through licensed routes | BTRC A2P SMS Aggregator licence (2021) |
| Delivery reports | Lets you show a "resend" button only when needed | Real-time reports via portal and /deliveryreport API |
| Branded sender | Users trust codes from a name they know | Masking sender ID available |
| Support | OTP outages are urgent at any hour | 24/7 Network Operations Centre |
Send an OTP with the BG TEL SMS API
Generate the code in your own backend, store a hash of it with an expiry time, then send it with one HTTPS request. Set transactionType to T (transactional) and leave contentID empty. Full details are in the API documentation.
cURL
curl -X POST https://apipro.bgtelsms.com/onetomany \
-H "Content-Type: application/json" \
-d '{"acode":"YOUR_ACCOUNT_CODE","api_key":"YOUR_API_KEY","senderid":"YOUR_SENDER_ID",
"type":"text","msg":"Your YourBrand code is 482913. It expires in 5 minutes. Do not share it.",
"contacts":"+8801XXXXXXXXX","transactionType":"T","contentID":""}'
PHP
$otp = random_int(100000, 999999);
$payload = [
'acode' => getenv('BGTEL_ACODE'), 'api_key' => getenv('BGTEL_API_KEY'),
'senderid' => 'YOUR_SENDER_ID', 'type' => 'text',
'msg' => "Your YourBrand code is $otp. It expires in 5 minutes. Do not share it.",
'contacts' => '+8801XXXXXXXXX', 'transactionType' => 'T', 'contentID' => '',
];
$ch = curl_init('https://apipro.bgtelsms.com/onetomany');
curl_setopt_array($ch, [CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode($payload)]);
$response = json_decode(curl_exec($ch), true);
Python
import os, secrets, requests
otp = f"{secrets.randbelow(900000) + 100000}"
r = requests.post("https://apipro.bgtelsms.com/onetomany", json={
"acode": os.environ["BGTEL_ACODE"], "api_key": os.environ["BGTEL_API_KEY"],
"senderid": "YOUR_SENDER_ID", "type": "text",
"msg": f"Your YourBrand code is {otp}. It expires in 5 minutes. Do not share it.",
"contacts": "+8801XXXXXXXXX", "transactionType": "T", "contentID": ""}, timeout=10)
print(r.json()["response"])
Keep your API key on the server. Never call the SMS API directly from a browser or mobile app, where the key could be extracted.
OTP security best practices
- Short expiry: 2–5 minutes is typical. Invalidate a code once it has been used.
- Limit attempts: lock verification after 3–5 wrong codes, and limit how often a number can request a new code. This stops SMS pumping fraud that burns your balance.
- Use a cryptographically secure random generator (
random_intin PHP,secretsin Python), never a timestamp or sequence. - Say who it is from and "do not share": it protects users from social-engineering scams.
- Keep the message in English text when possible: a 160-character segment, cheaper and universally readable. Use Bangla Unicode if your audience needs it.
- Watch delivery reports: offer "resend" or a voice or email fallback only when the report shows a failure.
Plugins and platforms
No code needed for common platforms: the official Odoo module (17, 18, 19), the WooCommerce extension and the WordPress plugin can send order and verification SMS. For any other platform, our team can build a connector where feasible, free of charge.
BG TEL SMS