Before the first line of code
Create an account
Free and without a card. Confirm your e-mail address.
Create a key
Portal → API keys. Name it after the app; tick only the scopes it needs. The secret is shown once.
Export it
Store PUBLIC:SECRET as SMS_KEY in your environment or secrets manager — never in the repository.
Send
curl — with an idempotency key and dry_run switched on
curl -X POST https://sms.itbc.dk/api/v1/send \
-H "X-Api-Key: $SMS_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order-58213-shipped" \
-d '{"to": "+4512345678",
"body": "Order 58213 is on its way. Track: https://gyk.dk/x7Q",
"sender": "WebShop",
"dry_run": true}'
PHP — plain cURL extension, no SDK needed
<?php
$ch = curl_init('https://sms.itbc.dk/api/v1/send');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'X-Api-Key: ' . getenv('SMS_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'to' => '+4512345678',
'body' => 'Your code is 481 220',
'sender' => 'MyApp',
]),
]);
$res = json_decode(curl_exec($ch), true);
echo $res['message_id'] ?? $res['error']['code'];
Python — httpx (requests works the same way)
import os, httpx
r = httpx.post(
"https://sms.itbc.dk/api/v1/send",
headers={"X-Api-Key": os.environ["SMS_KEY"]},
json={"to": "+4512345678", "body": "Server db-2: disk 91 %",
"sender": "Ops"},
timeout=10,
)
r.raise_for_status()
print(r.json()["message_id"])
Node.js 18+ — built-in fetch
const r = await fetch("https://sms.itbc.dk/api/v1/send", {
method: "POST",
headers: {
"X-Api-Key": process.env.SMS_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
to: "+4512345678",
body: "Ticket #4471 was answered",
sender: "Helpdesk",
}),
});
const data = await r.json();
console.log(data.message_id ?? data.error.code);
Receive delivery reports
A webhook is a POST to your URL. Check the signature on the raw body before you trust the payload, answer 2xx quickly and do the work afterwards.
Python
import hmac, hashlib, time
def verify(headers, method, path, raw: bytes, secret: str) -> bool:
ts = headers["X-Lynbro-Timestamp"]
base = f"{ts}.{method} {path}.".encode() + raw
want = "v1=" + hmac.new(secret.encode(), base,
hashlib.sha256).hexdigest()
fresh = abs(time.time() - int(ts)) <= 300
return fresh and hmac.compare_digest(
want, headers.get("X-Lynbro-Signature", ""))Node.js
import crypto from "node:crypto";
// raw body, method and path exactly as received
function verify(req, raw, secret) {
const ts = req.headers["x-lynbro-timestamp"];
const base = `${ts}.${req.method} ${req.url}.${raw}`;
const want = "v1=" + crypto.createHmac("sha256", secret)
.update(base).digest("hex");
const got = req.headers["x-lynbro-signature"] || "";
return Math.abs(Date.now() / 1000 - Number(ts)) <= 300 &&
got.length === want.length &&
crypto.timingSafeEqual(Buffer.from(got), Buffer.from(want));
}Then read the message from GET /api/v1/messages/{id} before you change anything important — the webhook is a hint, the API is the record. The PHP version and the full header list are in the WordPress guide. WordPress integration guide
Sandbox: dry_run
Every key accepts "dry_run": true on send, batch and verify. The request is validated, split into parts and priced exactly as it would be live, but nothing is queued and nothing is charged. For CI pipelines or a staging site we can mark a key as sandbox-only, so it can never send for real — ask through the contact form.
When something goes wrong
| HTTP | error.code | |
|---|---|---|
| 401 | invalid_key | missing, mistyped or revoked key |
| 402 | quota_exceeded | balance or credit used up |
| 403 | scope_missing | the key is not allowed to do this |
| 422 | validation | a field is missing or malformed; details name it |
| 429 | rate_limited | slow down and retry after Retry-After seconds |