SMSlenz API Integration Guide for Developers
Integrate SMS functionality directly into your applications with our powerful and easy-to-use REST API.
WooCommerce & WordPress Integration
smslenz.lk offers a dedicated WooCommerce add-on plugin, allowing you to integrate SMS notifications seamlessly into your WordPress store. With this plugin, you can send automated SMS updates to customers for various purchase events, enhancing engagement and communication.
Download the plugin SMSlenz for WooCommerce and start sending SMS notifications from your WordPress-powered store today!.
REST API Endpoint Guide
Need to integrate SMSlenz.lk with your custom development? No worries! We provide a complete guide for our direct API endpoints β you can call them directly from your application and start using our SMS services instantly.
Our API supports all major programming languages, including PHP, JavaScript, Python, Java,
C#,
Ruby, Go, and Node.js.
It works seamlessly with any type of application, whether itβs a web platform, desktop software,
or mobile app (Android or iOS).
Direct Endpoints for smslenz.lk SMS Actions
Send SMS
POSTGETUse this endpoint directly to send SMS to a contact number.
Request
URL: https://mail.smslenz.lk/api/send-sms
Parameters
| Key | Required | Value |
|---|---|---|
user_id |
Required | User ID from your settings page. |
api_key |
Required | API key from your settings page. |
sender_id |
Required | Your approved Sender ID. Use SMSlenzDEMO for testing. This one
is case
sensitive. |
contact |
Required | The recipient, Should be in the format of
+9476XXXXXXX.
|
message |
Required | The message. Max: 1500 chars. |
Response
You will get a JSON response in a success attempt.
Content-Type: application/json
Body:
{
"success": true,
"message": "SMS sent successfully",
"data": {
"status": "success",
"campaign_id": 42,
"message": "Welcome to SMSlenz!",
"sender_id": "SMSlenzDEMO",
"pages": 1,
"recipient_number": "9475XXXXXXX",
"sms_credit_balance": "2,513.95",
"charged_from": "main"
}
}
sms_credit_balance is the remaining balance of the pool the
sender ID draws from: its allocated credit when the sender has an active credit allocation,
otherwise your main balance. charged_from tells you which
(allocation or main).
Send Bulk SMS
POSTUse this endpoint directly to send SMS to multiple contact numbers.
Request
URL: https://mail.smslenz.lk/api/send-bulk-sms
Parameters
| Key | Required | Value |
|---|---|---|
user_id |
Required | User ID from your settings page. |
api_key |
Required | API key from your settings page. |
sender_id |
Required | Your approved Sender ID. Use SMSlenzDEMO for testing. This one
is case
sensitive. |
contacts |
Required | The number of the recipients, Should be in the format of array["+9476XXXXXXX","+9475XXXXXXX"].
|
message |
Required | The message. Max: 1500 chars. |
Response
You will get a JSON response in a success attempt.
Content-Type: application/json
Body:
{
"success": true,
"message": "SMS sent successfully",
"data": {
"status": "success",
"campaign_id": 43,
"message": "Welcome to bulk sms API!",
"sender_id": "SMSlenzDEMO",
"pages": 1,
"no_of_recipients": 2,
"sms_credit_balance": "2,512.77",
"charged_from": "main"
}
}
sms_credit_balance is the remaining balance of the pool the
sender ID draws from: its allocated credit when the sender has an active credit allocation,
otherwise your main balance. charged_from tells you which
(allocation or main).
Account Status
POSTGETUse this endpoint to check the status of your account.
Request
URL: https://mail.smslenz.lk/api/account-status
Parameters
| Key | Required | Value |
|---|---|---|
user_id |
Required | User ID from your settings page. |
api_key |
Required | API key from your settings page. |
Response
You will get a JSON response in a success attempt.
Content-Type: application/json
Body:
{
"success": true,
"message": "Account status retrieved successfully",
"data": {
"status": "active",
"sms_credit_balance": "2,515.72",
"allocated_credit_total": "1,500.00",
"sender_id_balances": [
{
"sender_id": "YOURBRAND",
"allocated_balance": "1,500.00",
"active": true
}
],
"active_plan": "Pay As You Go",
"total_contacts": 3,115,
"total_sender_ids": 6
}
}
sms_credit_balance is your main balance.
sender_id_balances lists sender IDs holding a credit allocation; a sender with
an active allocation is charged only from its allocated balance.
Go to API Settings Page.
See something missing? Please contact us and let us know your concern.
We are always happy to help with integrations.
Go back to smslenz.lk Home Page




