POST method with Content-Type: application/json header.
fetch('https://senderil.com/api/balance', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
api_key: 'YOUR_API_KEY'
})
})
.then(res => res.json())
.then(data => console.log(data))
Response:
{ "credits": 1000, "sender_name": "MyBrand" }
| Parameter | Type | Required | Description |
|---|---|---|---|
| api_key | string | Yes | Your API key |
| to | string | Yes | Phone number (972...) |
| message | string | Yes | SMS text |
| sender | string | No | Sender name (max 11 chars) |
fetch('https://senderil.com/api/send_sms', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
api_key: 'YOUR_API_KEY',
to: '972541234567',
message: 'Hello!',
sender: 'MyBrand'
})
})
.then(res => res.json())
.then(data => console.log(data))
Response:
{ "success": true, "message": "Sent", "sender_used": "MyBrand" }
| Parameter | Type | Required | Description |
|---|---|---|---|
| api_key | string | Yes | Your API key |
| numbers | array | Yes | Array of phone numbers |
| message | string | Yes | SMS text |
| sender | string | No | Sender name (max 11 chars) |
fetch('https://senderil.com/api/send_bulk', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
api_key: 'YOUR_API_KEY',
numbers: ['972541234567', '972521234567'],
message: 'Hello from SenderIL!',
sender: 'MyBrand'
})
})
.then(res => res.json())
.then(data => console.log(data))
Response:
{ "success": true, "sent": 2, "sender": "MyBrand", "credits_remaining": 998 }
| Code | Meaning |
|---|---|
| 400 | Missing parameters |
| 401 | Invalid API key |
| 402 | Not enough credits |
| 405 | Wrong method (use POST, not GET) |
| 500 | Server error |