Integrate bulk SMS into any application in minutes. RESTful JSON API with SDKs for PHP, Python, Node.js and more.
Choose your language and copy the example below. Your first message can be sent in under 10 minutes.
// SrilankaBulkSMS PHP SDK Example $apiKey = 'your_api_key_here'; $endpoint = 'https://api.srilankabulksms.com/v1/send'; $response = file_get_contents($endpoint, false, stream_context_create([ 'http' => [ 'method' => 'POST', 'header' => "Authorization: Bearer {$apiKey}\r\n" . "Content-Type: application/json\r\n", 'content' => json_encode([ 'to' => '+94771234567', 'from' => 'MYCOMPANY', 'message' => 'Your OTP is 482910. Valid for 5 minutes.', ]), ], ])); $result = json_decode($response, true); echo "Message ID: " . $result['message_id']; echo "Status: " . $result['status'];
# SrilankaBulkSMS Python Example import requests API_KEY = 'your_api_key_here' ENDPOINT = 'https://api.srilankabulksms.com/v1/send' response = requests.post( ENDPOINT, headers={ 'Authorization': f'Bearer {API_KEY}', 'Content-Type': 'application/json', }, json={ 'to': '+94771234567', 'from': 'MYCOMPANY', 'message': 'Your OTP is 482910. Valid for 5 minutes.', } ) data = response.json() print(f"Message ID: {data['message_id']}") print(f"Status: {data['status']}")
curl -X POST https://api.srilankabulksms.com/v1/send \ -H "Authorization: Bearer your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "to": "+94771234567", "from": "MYCOMPANY", "message": "Your OTP is 482910. Valid for 5 minutes." }'
All endpoints are relative to the base URL: https://api.srilankabulksms.com
All API requests must include your API key as a Bearer token in the Authorization header.
Include your API key in every request using the standard HTTP Authorization header:
Authorization: Bearer your_api_key_here
To get your API key, log in to portal.srilankabulksms.com, navigate to Settings > API Keys, and click Generate. You can create multiple keys for different projects and rotate them at any time without service interruption.
View Full Documentation →Built for reliability, built for scale.