Send SMS programmatically from your own application using your GOSMS API key.
Generate your API key from Dashboard → API. Include it as the api_key parameter on every request.
POST https://ns.gosms.click/api/send-sms.php
| Parameter | Type | Description |
|---|---|---|
| api_key | string | Your API key |
| number | string | Recipient number, e.g. 01700000000 |
| message | string | SMS text, max 1600 characters |
curl -X POST https://ns.gosms.click/api/send-sms.php \ -d "api_key=YOUR_API_KEY" \ -d "number=01700000000" \ -d "message=Hello World"
$ch = curl_init('https://ns.gosms.click/api/send-sms.php');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, [
'api_key' => 'YOUR_API_KEY',
'number' => '01700000000',
'message' => 'Hello World',
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = json_decode(curl_exec($ch), true);
use Illuminate\Support\Facades\Http;
$response = Http::asForm()->post('https://ns.gosms.click/api/send-sms.php', [
'api_key' => config('services.gosms.key'),
'number' => '01700000000',
'message' => 'Hello World',
])->json();
import requests
response = requests.post('https://ns.gosms.click/api/send-sms.php', data={
'api_key': 'YOUR_API_KEY',
'number': '01700000000',
'message': 'Hello World',
})
print(response.json())
const response = await fetch('https://ns.gosms.click/api/send-sms.php', {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: new URLSearchParams({
api_key: 'YOUR_API_KEY',
number: '01700000000',
message: 'Hello World',
}),
});
const data = await response.json();
console.log(data);
{
"success": true,
"message": "SMS sent successfully",
"log_id": 1023,
"cost": 0.4,
"balance": 99.6
}
| HTTP | Code | Meaning |
|---|---|---|
| 401 | MISSING_API_KEY | No api_key parameter sent |
| 401 | INVALID_API_KEY | Key is wrong or has been revoked |
| 403 | ACCOUNT_SUSPENDED | Your account is suspended |
| 400 | MISSING_PARAMETERS | number or message missing |
| 400 | INVALID_NUMBER | Not a valid BD phone number |
| 400 | MESSAGE_TOO_LONG | Message exceeds 1600 characters |
| 402 | INSUFFICIENT_CREDITS | Not enough SMS credits |
| 429 | RATE_LIMITED | Too many requests - max 60/minute per key |