Account sign-up
Confirm the mobile number before an account is created.
Send login codes, sign-up verification and payment confirmations to Dialog, SLT-Mobitel, Hutch and Airtel numbers with one API call. You generate the code; we get it to the phone.
An OTP that arrives late is a customer who gives up. The API is built to hand codes over quickly and tell you what happened to each one.
Generate a random 4 to 6 digit code and store it with an expiry time.
POST the phone number and the message to the send endpoint with your API key.
The SMS arrives from your sender ID, typically within a few seconds.
Compare what the customer typed with the stored code, then discard the code.
The same endpoint sends a single OTP or a campaign. Add your own reference to match the delivery report to a login attempt.
# one request, any number of recipients curl -X POST https://avcsms.lk/api/v1/sms/send \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"to": "0771234567", "message": "Your OTP is 482913", "sender_id": "MYSHOP"}'
$ch = curl_init('https://avcsms.lk/api/v1/sms/send'); curl_setopt_array($ch, [ CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY', 'Content-Type: application/json'], CURLOPT_POSTFIELDS => json_encode(['to' => '0771234567', 'message' => 'Your OTP is 482913']), ]); $reply = json_decode(curl_exec($ch), true);
const res = await fetch("https://avcsms.lk/api/v1/sms/send", { method: "POST", headers: { Authorization: "Bearer YOUR_API_KEY", "Content-Type": "application/json" }, body: JSON.stringify({ to: "0771234567", message: "Your OTP is 482913" }), }); console.log(await res.json());
import requests r = requests.post("https://avcsms.lk/api/v1/sms/send", headers={"Authorization": "Bearer YOUR_API_KEY"}, json={"to": ["0771234567", "0712345678"], "message": "ඔබේ OTP 482913"}) print(r.status_code, r.json())
/api/v1/sms/sendSend one or up to 10,000 messages
GET/api/v1/sms/{id}Status of one message
GET/api/v1/balanceBalance and rate
POST/api/v1/countParts and cost before sending
Anywhere you need to know that the person really holds the phone number.
Confirm the mobile number before an account is created.
Ask for a code as well as the password on new devices.
Let customers recover an account without calling you.
Confirm a transfer, a top-up or a card payment.
Confirm the order is real before you dispatch it.
Verify a change of phone number, email or bank details.
Create an account, copy your API key and send a test code to your own phone.