SMS API — Configure Inbound SMS Routing
Route incoming SMS on your SMS-enabled local numbers to another phone number, an email address, or a webhook URL — fully configurable via API. No separate SMS platform needed.
How SMS Forwarding Works with Israelnumber
SMS-enabled virtual numbers can forward every incoming message to one of three destination types.
|
| ||||
| |||||
SMS-to-Webhook Forwarding Syntax
Set this up in your account under Forward Type → API, with an API URL field. Placeholders are replaced with live values on every incoming message — include them exactly as shown, curly braces included.
https://example.com/api?from={CallerID}&text={SMS_TEXT}&to={SMS_DST_ADDR}
✓ {CallerID} — sender phone number | ✓ {SMS_TEXT} — text content of the SMS |
✓ {SMS_DST_ADDR} — recipient destination number | |
Example with sender 1234567890, message Hello, recipient 0987654321:
https://example.com/api?from=1234567890&text=Hello&to=0987654321
Code Samples
All endpoints use HTTP POST. Authenticate first to get your account id and account_token.
// Requires: npm install node-fetch form-data
const fetch = require("node-fetch");
const FormData = require("form-data");
const BASE = "https://newsip.israelnumber.com";
// ── Step 1: Login ───────────────────────────────────────────
async function login() {
const f = new FormData();
f.append("username", "YOUR_ACCOUNT_NUMBER");
f.append("password", "YOUR_PASSWORD");
const r = await fetch(`${BASE}/api/login/`, { method: "POST", body: f });
return r.json(); // → { id, account_token }
}
// ── Step 2: Create an SMS forwarding config ─────────────────
// Forward incoming SMS on a DID to an email address
async function addSmsForwardToEmail(id, token, did, destEmail) {
const f = new FormData();
f.append("action", "add");
f.append("did", did);
f.append("dest_email", destEmail);
f.append("id", id);
f.append("token", token);
const r = await fetch(`${BASE}/api/sms`, { method: "POST", body: f });
return r.json();
}
// ── Step 3: Run ─────────────────────────────────────────────
(async () => {
const { id, account_token } = await login();
const result = await addSmsForwardToEmail(
id,
account_token,
"+447911123456", // your SMS-enabled virtual number
"alerts@yourdomain.com"
);
console.log("SMS forwarding configured:", result);
})();# Step 1 — Login and capture id + token
LOGIN=$(curl -s -X POST https://newsip.israelnumber.com/api/login/ \
-d "username=YOUR_ACCOUNT_NUMBER" \
-d "password=YOUR_PASSWORD")
ID=$(echo "$LOGIN" | python3 -c "import sys,json; print(json.load(sys.stdin)['id'])")
TOKEN=$(echo "$LOGIN" | python3 -c "import sys,json; print(json.load(sys.stdin)['account_token'])")
# Step 2 — Add SMS forwarding to another SMS number
curl -s -X POST https://newsip.israelnumber.com/api/sms \
-d "action=add" \
-d "did=+447911123456" \
-d "dest_sms=+19175550100" \
-d "id=$ID" \
-d "token=$TOKEN"
# Step 3 — List all SMS forwarding configs on the account
curl -s -X POST https://newsip.israelnumber.com/api/sms \
-d "action=list" \
-d "id=$ID" \
-d "token=$TOKEN"More API Guides
|
| ||||
|
|
FAQ — SMS API
Can I receive SMS on a virtual local number?
Yes, on SMS-enabled virtual numbers. When ordering, look for numbers with the SMS or Mobile voice+SMS DID type. Incoming SMS can be forwarded to another SMS number, an email address, or a webhook URL.
How does the new SMS-to-webhook forwarding work?
Set Forward Type to API in your account and provide an API URL using the template https://example.com/api?from={CallerID}&text={SMS_TEXT}&to={SMS_DST_ADDR}. Each placeholder is replaced with live values when an SMS arrives, and your endpoint receives an HTTP request in real time.
Can I forward SMS to more than one destination?
Each SMS Config entry is tied to a specific DID and destination. To forward to multiple destinations, use the SMS Config API to manage separate configurations, or route to a single webhook endpoint and fan out from there.
Which countries support SMS on virtual numbers?
SMS support varies by country and number type. Check available DID types for your target country before provisioning to confirm SMS or Mobile voice+SMS numbers are offered there.
Start Configuring SMS Routing Today
Get your free API key and set up your first SMS forwarding rule in minutes.