REST API · v1 · JSON
SIMBOX 24/7 API
SMS OTP-API voor ontwikkelaars: huur virtuele nummers en ontvang verificatiecodes via REST-API en webhooks, met codevoorbeelden in curl, PHP, Python en Node.js
REST · JSONOndertekende webhooksInsluitbare sms-inboxPublieke API zonder sleutelAutomatische terugbetaling
Aan de slag
Base URL
https://simbox247.com/api/v1Format
JSON · UTF-8Rate limit
30/min (public) · 300/min (key)curl -s https://simbox247.com/api/v1/me \
-H "Authorization: Bearer sb_xxxxxxxx.your_secret"
# buy an OTP number
curl -s -X POST https://simbox247.com/api/v1/otp/buy \
-H "Authorization: Bearer sb_xxxxxxxx.your_secret" \
-H "Content-Type: application/json" \
-d '{"country":"usa","service":"google"}'<?php
$key = 'sb_xxxxxxxx.your_secret';
$ch = curl_init('https://simbox247.com/api/v1/otp/buy');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $key, 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode(['country' => 'usa', 'service' => 'google']),
]);
$order = json_decode(curl_exec($ch), true)['data'];
echo $order['phone'];import time, requests
API = 'https://simbox247.com/api/v1'
H = {'Authorization': 'Bearer sb_xxxxxxxx.your_secret'}
order = requests.post(f'{API}/otp/buy', json={'country': 'usa', 'service': 'google'}, headers=H).json()['data']
print('Use this number:', order['phone'])
while True:
o = requests.get(f"{API}/otp/{order['id']}", headers=H).json()['data']
if o['status'] != 'waiting':
print(o['status'], o.get('code'))
break
time.sleep(5)const API = 'https://simbox247.com/api/v1';
const H = { Authorization: 'Bearer sb_xxxxxxxx.your_secret', 'Content-Type': 'application/json' };
const { data: order } = await fetch(`${API}/otp/buy`, {
method: 'POST', headers: H,
body: JSON.stringify({ country: 'usa', service: 'google' }),
}).then(r => r.json());
console.log('Use this number:', order.phone);Authenticatie
Maak een API-sleutel aan bij Instellingen en stuur die mee in de Authorization-header. Houd de sleutel geheim — zet hem nooit in frontendcode.
Authorization: Bearer sb_xxxxxxxx.your_secret
Foutcodes en limieten
| HTTP | code | Betekenis |
|---|---|---|
| 401 | UNAUTHORIZED | Missing or invalid API key |
| 404 | NOT_FOUND | Unknown endpoint, number or order |
| 409 | RENT_FAILED · OTP_FAILED · ESIM_FAILED | Not enough credits, sold out, or provider unavailable (see message) |
| 429 | RATE_LIMITED | Too many requests — retry after a minute |
| 503 | API_DISABLED | API temporarily disabled |
Publieke data (geen sleutel)
GET/countriesList countries that have free public numbers.
curl -s https://simbox247.com/api/v1/countries
Response 200
{
"success": true,
"data": [
{
"country": "us",
"name": "United States",
"dial": "1",
"public_numbers": 12
}
]
}
GET/numbersList free public numbers, newest SMS first.
| country | string | ISO code, e.g. us (optional) |
curl -s https://simbox247.com/api/v1/numbers
Response 200
{
"success": true,
"data": [
{
"id": 17,
"number": "+15550001111",
"country": "us",
"last_sms_at": 1796312643
}
]
}
GET/numbers/{id}/messagesMessages on a public number (last 24 h). Poll with since=<last id>.
| since | int | Return messages with id greater than this |
curl -s https://simbox247.com/api/v1/numbers/{id}/messagesResponse 200
{
"success": true,
"data": [
{
"id": 981,
"from": "Google",
"text": "G-482913 is your Google verification code",
"otp": "482913",
"received_at": 1796312643
}
]
}
Account en berichten
GET/meAPI keyYour account and credit balance.
curl -s https://simbox247.com/api/v1/me \ -H "Authorization: Bearer sb_xxxxxxxx.your_secret"
Response 200
{
"success": true,
"data": {
"id": 42,
"credits": 15700
}
}
GET/my/numbersAPI keyNumbers you rent or have reserved.
curl -s https://simbox247.com/api/v1/my/numbers \ -H "Authorization: Bearer sb_xxxxxxxx.your_secret"
Response 200
{
"success": true,
"data": [
{
"id": 2,
"number": "+15550002222",
"country": "us",
"kind": "private",
"rented_until": 1796399043
}
]
}
GET/my/messagesAPI keyMessages only you can see (private numbers & reservations).
| number_id | int | Filter by number (optional) |
| since | int | Return messages with id greater than this |
curl -s https://simbox247.com/api/v1/my/messages \ -H "Authorization: Bearer sb_xxxxxxxx.your_secret"
Response 200
{
"success": true,
"data": [
{
"id": 990,
"number": "+15550002222",
"from": "Telegram",
"text": "Telegram code 55120",
"otp": "55120",
"received_at": 1796313001
}
]
}
Privénummers
POST/private/rentAPI keyRent a private number. Credits are charged immediately.
| country | string | ISO code, e.g. us |
| plan | string | day | month |
curl -s -X POST https://simbox247.com/api/v1/private/rent \
-H "Authorization: Bearer sb_xxxxxxxx.your_secret" \
-H "Content-Type: application/json" \
-d '{"country":"code","plan":"month"}'Response 200
{
"success": true,
"data": {
"id": 2,
"number": "+15550002222",
"rented_until": 1796399043
}
}
OTP kopen
POST/otp/buyAPI keyBuy a one-time number for a service. Auto-refund if no code arrives in time.
| country | string | 5sim country name, e.g. usa, england |
| service | string | e.g. facebook, google, telegram |
curl -s -X POST https://simbox247.com/api/v1/otp/buy \
-H "Authorization: Bearer sb_xxxxxxxx.your_secret" \
-H "Content-Type: application/json" \
-d '{"country":"name","service":"facebook"}'Response 200
{
"success": true,
"data": {
"id": 311,
"phone": "+447700900123",
"status": "waiting",
"credits": 1200,
"expires_at": 1796313900
}
}
GET/otp/{id}API keyOrder status. Poll every 5 s until status is received or refunded.
curl -s https://simbox247.com/api/v1/otp/{id} \
-H "Authorization: Bearer sb_xxxxxxxx.your_secret"Response 200
{
"success": true,
"data": {
"id": 311,
"phone": "+447700900123",
"status": "received",
"code": "482913",
"text": "Your code is 482913"
}
}
eSIM
GET/esim/packageseSIM data plans with price in credits.
| country | string | ISO code (optional) |
curl -s https://simbox247.com/api/v1/esim/packages
Response 200
{
"success": true,
"data": [
{
"code": "JP_3_7",
"country": "jp",
"name": "Japan 3GB 7 days",
"data_mb": 3072,
"days": 7,
"credits": 19900
}
]
}
POST/esim/buyAPI keyBuy an eSIM plan.
| package | string | Package code from /esim/packages |
curl -s -X POST https://simbox247.com/api/v1/esim/buy \
-H "Authorization: Bearer sb_xxxxxxxx.your_secret" \
-H "Content-Type: application/json" \
-d '{"package":"\/esim\/packages"}'Response 200
{
"success": true,
"data": {
"id": 77,
"status": "pending",
"package_name": "Japan 3GB 7 days"
}
}
GET/esim/{id}API keyOrder status and QR code once ready.
curl -s https://simbox247.com/api/v1/esim/{id} \
-H "Authorization: Bearer sb_xxxxxxxx.your_secret"Response 200
{
"success": true,
"data": {
"id": 77,
"status": "ready",
"qr_url": "https://…/qr.png",
"iccid": "8985…",
"activation_code": "LPA:1$…"
}
}
10 integratievoorbeelden
Kopieer en gebruik direct — vervang alleen je sleutel en nummer
1Een sms-inbox insluiten op je websitePlak één regel code en bezoekers zien binnenkomende berichten live op je site — zonder programmeren
<!-- Public number (id from /api/v1/numbers) -->
<iframe src="https://simbox247.com/embed/17" width="100%" height="420"
style="border:0;border-radius:14px" loading="lazy"></iframe>
<!-- Your private number: create a share link on the number page, then -->
<iframe src="https://simbox247.com/embed/s/YOUR_SHARE_TOKEN?theme=dark" width="100%" height="420"
style="border:0;border-radius:14px"></iframe>2Berichten tonen in je eigen ontwerp (JavaScript)Haal berichten op via de publieke API en toon ze in je eigen ontwerp, elke 4 seconden bijgewerkt — geen sleutel
<ul id="sms"></ul>
<script>
const API = 'https://simbox247.com/api/v1', NUMBER_ID = 17;
let since = 0;
async function poll() {
const r = await fetch(`$https://simbox247.com/api/v1/numbers/${NUMBER_ID}/messages?since=${since}`);
const { data } = await r.json();
data.reverse().forEach(m => {
since = Math.max(since, m.id);
const li = document.createElement('li');
li.textContent = `${m.from}: ${m.text}` + (m.otp ? ` [code ${m.otp}]` : '');
document.getElementById('sms').prepend(li);
});
}
poll(); setInterval(poll, 4000);
</script>3WordPress-plug-in (shortcode)Zet [simbox_inbox id="17"] op een willekeurige WordPress-pagina om een sms-inbox te tonen
<?php
/* Plugin Name: SIMBOX Inbox */
add_shortcode('simbox_inbox', function ($atts) {
$id = (int)($atts['id'] ?? 0);
$res = wp_remote_get("https://simbox247.com/api/v1/numbers/{$id}/messages", ['timeout' => 8]);
$rows = json_decode(wp_remote_retrieve_body($res), true)['data'] ?? [];
$html = '<ul class="simbox-inbox">';
foreach ($rows as $m) {
$html .= '<li><b>' . esc_html($m['from']) . '</b> ' . esc_html($m['text']) . '</li>';
}
return $html . '</ul>';
});4Geautomatiseerd testen van registratie (Python)Koop een OTP-nummer, wacht op de code en gebruik die in je testscript. Geen code = automatische terugbetaling.
import time, requests
API, H = 'https://simbox247.com/api/v1', {'Authorization': 'Bearer sb_xxxxxxxx.your_secret'}
def get_code(service='google', country='usa', timeout=600):
o = requests.post(f'https://simbox247.com/api/v1/otp/buy', json={'service': service, 'country': country}, headers=H).json()['data']
print('Enter this number in your app:', o['phone'])
end = time.time() + timeout
while time.time() < end:
s = requests.get(f"https://simbox247.com/api/v1/otp/{o['id']}", headers=H).json()['data']
if s['status'] == 'received':
return s['code']
if s['status'] == 'refunded':
return None
time.sleep(5)
print('code =', get_code())5Sms ontvangen in je systeem via webhooks (Node.js)Elk bericht naar je privénummers gaat direct naar je server; controleer de handtekening voordat je opslaat
import express from 'express';
import crypto from 'node:crypto';
const SECRET = process.env.SIMBOX_WEBHOOK_SECRET;
const app = express();
app.post('/sms-hook', express.raw({ type: '*/*' }), (req, res) => {
const p = Object.fromEntries(String(req.get('X-Simbox-Signature')).split(',').map(x => x.split('=')));
const calc = crypto.createHmac('sha256', SECRET).update(p.t + '.' + req.body).digest('hex');
if (Math.abs(Date.now() / 1000 - +p.t) > 300 || calc !== p.v1) return res.sendStatus(401);
const { data } = JSON.parse(req.body);
console.log(`New SMS on ${data.number} from ${data.from}: ${data.text}`);
// save to your database here
res.sendStatus(200);
});
app.listen(3000);6OTP-codes naar de Telegram-groep van het team sturen (PHP)Het hele team ziet codes tegelijk in een Telegram-groep via webhooks
<?php
// sms-hook.php — set this URL as your webhook in SIMBOX settings
$raw = file_get_contents('php://input');
parse_str(str_replace(',', '&', $_SERVER['HTTP_X_SIMBOX_SIGNATURE'] ?? ''), $sig);
$ok = hash_equals(hash_hmac('sha256', ($sig['t'] ?? '') . '.' . $raw, 'YOUR_WEBHOOK_SECRET'), $sig['v1'] ?? '');
if (!$ok || abs(time() - (int)$sig['t']) > 300) { http_response_code(401); exit; }
$d = json_decode($raw, true)['data'];
$text = "📩 {$d['number']}\nFrom: {$d['from']}\n{$d['text']}" . ($d['otp'] ? "\nCode: {$d['otp']}" : '');
file_get_contents('https://api.telegram.org/botYOUR_BOT_TOKEN/sendMessage?' . http_build_query([
'chat_id' => 'YOUR_GROUP_CHAT_ID', 'text' => $text,
]));7Berichten naar de Discord van het team sturenKoppel onze webhook aan een Discord-kanaal en krijg direct een melding bij elke sms
// inside your verified /sms-hook handler (see the webhook example)
const { data } = JSON.parse(req.body);
await fetch('https://discord.com/api/webhooks/YOUR_ID/YOUR_TOKEN', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
content: `**${data.number}** ← ${data.from}\n${data.text}` + (data.otp ? `\n\`${data.otp}\`` : ''),
}),
});8Elk bericht vastleggen in Google SheetsGebruik Google Apps Script om webhooks te ontvangen en automatisch rijen aan een sheet toe te voegen — ideaal voor teamadministratie
// Extensions → Apps Script → Deploy → Web app (Anyone).
// Use <web-app-url>?key=YOUR_PRIVATE_KEY as the webhook URL in SIMBOX settings.
// (Apps Script cannot read request headers, so a private key in the URL protects the sheet.)
const KEY = 'YOUR_PRIVATE_KEY';
function doPost(e) {
if (e.parameter.key !== KEY) return ContentService.createTextOutput('forbidden');
const d = JSON.parse(e.postData.contents).data;
SpreadsheetApp.getActiveSpreadsheet().getSheetByName('SMS')
.appendRow([new Date(d.received_at * 1000), d.number, d.from, d.text, d.otp || '']);
return ContentService.createTextOutput('ok');
}9Geautomatiseerde end-to-end-webtests (Playwright)Laat een testbot het nummer invullen, op de OTP wachten en die intypen — werkt in CI
import { test, expect } from '@playwright/test';
const API = 'https://simbox247.com/api/v1', H = { Authorization: `Bearer ${process.env.SIMBOX_KEY}` };
test('sign-up with phone OTP', async ({ page, request }) => {
const { data: o } = await (await request.post(`$https://simbox247.com/api/v1/otp/buy`, { headers: H,
data: { service: 'other', country: 'usa' } })).json();
await page.goto('https://your-app.example/signup');
await page.fill('#phone', o.phone);
await page.click('text=Send code');
let code = '';
for (let i = 0; i < 60 && !code; i++) {
const { data } = await (await request.get(`$https://simbox247.com/api/v1/otp/${o.id}`, { headers: H })).json();
code = data.code || ''; if (!code) await page.waitForTimeout(5000);
}
await page.fill('#otp', code);
await expect(page.locator('text=Welcome')).toBeVisible();
});10Verkoop eSIM's in je app of op je websiteToon eSIM-bundels, plaats bestellingen en toon de QR-code die de klant scant
<?php
$api = 'https://simbox247.com/api/v1';
$h = ['Authorization: Bearer sb_xxxxxxxx.your_secret', 'Content-Type: application/json'];
$call = function ($method, $path, $body = null) use ($api, $h) {
$ch = curl_init($api . $path);
curl_setopt_array($ch, [CURLOPT_CUSTOMREQUEST => $method, CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => $h, CURLOPT_POSTFIELDS => $body ? json_encode($body) : null]);
return json_decode(curl_exec($ch), true)['data'];
};
$plans = $call('GET', '/esim/packages?country=jp'); // show these to your customer
$order = $call('POST', '/esim/buy', ['package' => $plans[0]['code']]);
do { sleep(3); $o = $call('GET', '/esim/' . $order['id']); } while ($o['status'] === 'pending');
echo '<img src="' . htmlspecialchars($o['qr_url']) . '" alt="eSIM QR">';Webhooks
Vul je HTTPS-URL in bij Instellingen. Elke sms naar je nummers wordt daar direct naartoe gestuurd, met een handtekening om te verifiëren.
POST https://your-site.com/sms-hook
X-Simbox-Signature: t=1796313001,v1=5f2c…(hex)
{
"event": "sms.received",
"data": {
"id": 990,
"number": "+15550002222",
"from": "Telegram",
"text": "Telegram code 55120",
"otp": "55120",
"received_at": 1796313001
}
}
Handtekening verifiëren
<?php
$raw = file_get_contents('php://input');
parse_str(str_replace(',', '&', $_SERVER['HTTP_X_SIMBOX_SIGNATURE'] ?? ''), $sig);
$calc = hash_hmac('sha256', $sig['t'] . '.' . $raw, 'YOUR_WEBHOOK_SECRET');
if (abs(time() - (int)$sig['t']) > 300 || !hash_equals($calc, $sig['v1'] ?? '')) {
http_response_code(401); exit;
}
$event = json_decode($raw, true); // $event['data']['otp']import crypto from 'node:crypto';
// Express: app.post('/sms-hook', express.raw({type: '*/*'}), handler)
function verify(raw, header, secret) {
const p = Object.fromEntries(header.split(',').map(x => x.split('=')));
const calc = crypto.createHmac('sha256', secret).update(p.t + '.' + raw).digest('hex');
return Math.abs(Date.now() / 1000 - +p.t) <= 300 &&
crypto.timingSafeEqual(Buffer.from(calc), Buffer.from(p.v1 || ''));
}import hmac, hashlib, time
def verify(raw: bytes, header: str, secret: str) -> bool:
p = dict(x.split('=', 1) for x in header.split(','))
calc = hmac.new(secret.encode(), f"{p['t']}.".encode() + raw, hashlib.sha256).hexdigest()
return abs(time.time() - int(p['t'])) <= 300 and hmac.compare_digest(calc, p.get('v1', ''))