Send SMS programmatically using a simple HTTP POST request. All responses return JSON.
| Parameter | Type | Required | Description |
|---|---|---|---|
api_key | string | Yes | Your API key |
to | string | Yes | Recipient phone number (e.g. 01712345678) |
message | string | Yes | SMS body text |
type | string | No | non_masking (default), readymade, or custom |
sender_id | string | Conditional | Required for readymade type. Auto-filled for custom. |
curl -X POST http://test.ottwala.xyz/api/send.php \ -H "Content-Type: application/json" \ -d '{ "api_key": "sk_live_your_api_key_here", "to": "01712345678", "message": "Hello from SHEBA SMS!", "type": "non_masking" }'
$response = file_get_contents('http://test.ottwala.xyz/api/send.php', false, stream_context_create(['http' => [ 'method' => 'POST', 'header' => 'Content-Type: application/json', 'content' => json_encode([ 'api_key' => 'sk_live_your_api_key_here', 'to' => '01712345678', 'message' => 'Hello from SHEBA SMS!', 'type' => 'non_masking' ]) ]]) ); print_r(json_decode($response, true));
{
"success": true,
"message": "SMS sent successfully",
"data": {
"recipient": "01712345678",
"segments": 1,
"cost": 0.35,
"balance": 985.50
}
}