Important: Supported Number Format
The SMS Gateway ONLY supports Sri Lankan phone numbers. You must format numbers as 10 digits starting with '0'.
10 Digits, starts with 0
Do not use country code (+94)
Authentication
The API uses Basic Authentication. You must provide your credentials with every request.
- Username: Your Account Email Address
- Password: Your API Key
Send SMS - Single (GET Method)
The easiest way to send an SMS is by simply calling a URL in your browser or code.
URL Parameters
| Name | Required Value | Description |
|---|---|---|
| FUN | SEND_SINGLE | Function Name |
| with_get | true | Enables GET mode |
| un | User Email | Account Email |
| up | API Key | Account API Key |
| senderID | Sender ID | Your approved Sender Name |
| to | Receiver Phone | Format: 07xxxxxxxx (10 digits) |
| text | Message | URL Encoded Message |
Send SMS - Single (POST Method)
Endpoint: https://sender.hashnetlk.com/api.php?FUN=SEND_SINGLE
Send the data as a JSON object in the body.
{
"senderID": "MySendID",
"to": "0701234567",
"msg": "A Test Message"
}
Send Bulk SMS (Same Message)
Endpoint: https://sender.hashnetlk.com/api.php?FUN=SEND_BULK_SAME
{
"senderID": "MySendID",
"to": [
"0701234567",
"0712345678"
],
"msg": "A Test Message",
"check_cost": true
}
* check_cost is optional. Set to true to check price before sending.
Send Bulk SMS (Different Messages)
Endpoint: https://sender.hashnetlk.com/api.php?FUN=SEND_BULK_DIFFERENT
{
"senderID": "MySendID",
"msg_list": [
{
"msg": "A Test Message 1",
"to": "0701234567"
},
{
"msg": "A Test Message 2",
"to": "0712345678"
}
]
}
Check Account Balance
Endpoint: https://sender.hashnetlk.com/api.php?FUN=CHECK_BALANCE
Method: POST