Skip to main content

Sending SMS Messages

Send SMS messages to one or multiple recipients using the LightSMS API.

Quick Start​

Endpoint:

GET https://www.lightsms.com/external/get/send.php

Required Parameters:

ParameterTypeDescription
loginstringYour LightSMS login
signaturestringMD5 hash signature
phonestringRecipient phone number(s)
textstringSMS message text
senderstringApproved sender name
timestampintegerUTC timestamp

Optional Parameters:

ParameterTypeDescription
sendingTimestringSchedule delivery (format: YYYY-MM-DD HH:MM)
returnstringResponse format: json or xml

Single SMS Example​

Send an SMS to one recipient:

Request​

curl "https://www.lightsms.com/external/get/send.php?login=YourLogin&signature=generated_signature&phone=37061234567&text=Hello!&sender=YourSender&timestamp=1732809600&return=json"

Response (JSON)​

{
"37061234567": {
"error": "0",
"id_sms": "4092112510348380960001",
"cost": "0.0144",
"count_sms": "1"
}
}

Response (XML)​

<?xml version="1.0" encoding="utf-8"?>
<response>
<phones>
<phone phone="37061234567" error="0" id_sms="4092112510348380960001" cost="0.0144" count_sms="1" />
</phones>
</response>

Multiple Recipients​

Send SMS to multiple recipients by separating phone numbers with commas.

Recipient Limit

Maximum 100 phone numbers per request.

Example​

curl "https://www.lightsms.com/external/get/send.php?login=YourLogin&signature=generated_signature&phone=37061234567,37062345678,37063456789&text=Hello%20everyone!&sender=YourSender&timestamp=1732809600&return=json"

Response​

{
"37061234567": {
"error": "0",
"id_sms": "4092112510348380960001",
"cost": "0.0144",
"count_sms": "1"
},
"37062345678": {
"error": "0",
"id_sms": "4092112510348380960002",
"cost": "0.0144",
"count_sms": "1"
},
"37063456789": {
"error": "0",
"id_sms": "4092112510348380960003",
"cost": "0.0144",
"count_sms": "1"
}
}

Scheduled SMS​

Schedule SMS delivery for a future date and time.

Example​

curl "https://www.lightsms.com/external/get/send.php?login=YourLogin&signature=generated_signature&phone=37061234567&text=Reminder&sender=YourSender&timestamp=1732809600&sendingTime=2024-05-30%2014:06&return=json"

Format: YYYY-MM-DD HH:MM

Example: 2024-05-30 14:06

Timezone

The time is in your account's configured timezone (usually local time).


Character Limits​

Standard SMS (GSM-7 encoding)​

  • Single SMS: 160 characters
  • Multi-part SMS: 153 characters per part

Supported characters:

A-Z a-z 0-9 @ Β£ $ Β₯ Γ¨ Γ© ΓΉ Γ¬ Γ² Γ‡ Ø ΓΈ Γ… Γ₯ Ξ” _ Ξ¦ Ξ“ Ξ› Ξ© Ξ  Ξ¨ Ξ£ Θ Ξ
Γ† Γ¦ ß Γ‰ ! " # Β€ % & ' ( ) * + , - . / : ; < = > ? Β‘ Γ„ Γ– Γ‘ Ü Β§ ΒΏ Γ€ ΓΆ Γ± ΓΌ Γ 

Unicode SMS (Special characters/emojis)​

  • Single SMS: 70 characters
  • Multi-part SMS: 67 characters per part

Examples: Cyrillic, Arabic, Chinese, emojis (😊 πŸŽ‰ ❀️)

Character Count

The system automatically detects if your message requires Unicode encoding based on the characters used.


PHP Example​

<?php
function sendSMS($login, $apiKey, $phone, $text, $sender) {
// Get timestamp
$timestamp = file_get_contents('https://www.lightsms.com/external/get/timestamp.php');
$timestamp = trim($timestamp);

// Prepare parameters
$params = [
'login' => $login,
'phone' => $phone,
'text' => $text,
'sender' => $sender,
'timestamp' => $timestamp,
'return' => 'json'
];

// Create signature
ksort($params);
$signature = md5(implode($params) . $apiKey);
$params['signature'] = $signature;

// Make request
$url = 'https://www.lightsms.com/external/get/send.php?' . http_build_query($params);
$response = file_get_contents($url);

return json_decode($response, true);
}

// Usage
$result = sendSMS(
'YourLogin',
'your_api_key',
'37061234567',
'Hello from LightSMS!',
'YourSender'
);

print_r($result);
?>

Python Example​

import requests
import hashlib
from urllib.parse import urlencode

def send_sms(login, api_key, phone, text, sender):
# Get timestamp
timestamp_response = requests.get('https://www.lightsms.com/external/get/timestamp.php')
timestamp = timestamp_response.text.strip()

# Prepare parameters
params = {
'login': login,
'phone': phone,
'text': text,
'sender': sender,
'timestamp': timestamp,
'return': 'json'
}

# Create signature
sorted_params = sorted(params.items())
param_string = ''.join([str(value) for key, value in sorted_params])
signature = hashlib.md5((param_string + api_key).encode()).hexdigest()
params['signature'] = signature

# Make request
url = f'https://www.lightsms.com/external/get/send.php?{urlencode(params)}'
response = requests.get(url)

return response.json()

# Usage
result = send_sms(
'YourLogin',
'your_api_key',
'37061234567',
'Hello from LightSMS!',
'YourSender'
)

print(result)

JavaScript Example​

const crypto = require('crypto');
const axios = require('axios');

async function sendSMS(login, apiKey, phone, text, sender) {
// Get timestamp
const timestampResponse = await axios.get('https://www.lightsms.com/external/get/timestamp.php');
const timestamp = timestampResponse.data.trim();

// Prepare parameters
const params = {
login,
phone,
text,
sender,
timestamp,
return: 'json'
};

// Create signature
const sortedKeys = Object.keys(params).sort();
const paramString = sortedKeys.map(key => params[key]).join('');
const signature = crypto.createHash('md5').update(paramString + apiKey).digest('hex');
params.signature = signature;

// Make request
const queryString = new URLSearchParams(params).toString();
const url = `https://www.lightsms.com/external/get/send.php?${queryString}`;
const response = await axios.get(url);

return response.data;
}

// Usage
sendSMS(
'YourLogin',
'your_api_key',
'37061234567',
'Hello from LightSMS!',
'YourSender'
).then(result => {
console.log(result);
});

Response Fields​

FieldTypeDescription
errorstringError code (0 = success)
id_smsstringUnique SMS identifier for tracking
coststringCost in your account currency
count_smsstringNumber of SMS parts sent

Common Errors​

Error Code 8: Invalid sender name​

Problem: The sender name is not valid

Solutions:

  • Use only approved sender names
  • Register sender names through Lists > Senders in LightSMS platform
  • Wait for administration approval

Error Code 9: Sender name not registered​

Problem: The sender name hasn't been registered

Solutions:

  • Register the sender name first
  • Use an already approved sender

Error Code 11: Forbidden words in text​

Problem: Message contains prohibited content

Solutions:

  • Remove inappropriate words or abbreviations
  • Contact support if you believe this is an error

Error Code 13: Phone in blacklist​

Problem: Recipient's number is blacklisted

Solutions:

Error Code 32: Not enough money​

Problem: Insufficient account balance

Solutions:

  • Add funds to your Paysera account
  • Check balance using the balance endpoint

Next Steps​