Languages
JavaScript
Prerequisites
A server runtime with fetch (Node, Deno, Bun, or a backend for your SPA). Do not embed API keys in client-side bundles.
Authentication
Build a Basic Auth header: btoa(`${email}:${apiKey}`) in environments that provide btoa, or use Buffer in Node.
SEND_SINGLE example
Equivalent to the documented curl POST (server-side):
const email = process.env.VELOBOTIX_EMAIL;
const apiKey = process.env.VELOBOTIX_API_KEY;
const auth = Buffer.from(`${email}:${apiKey}`).toString('base64');
const res = await fetch('https://portal.velobotix.app/api.php?FUN=SEND_SINGLE', {
method: 'POST',
headers: {
Authorization: `Basic ${auth}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
senderID: 'VeloBotix',
to: '0701234567',
msg: 'Your OTP is 483920. Valid for 5 minutes.',
}),
});
console.log(res.status, await res.text());Common mistakes
Shipping the API key to the browser.
CORS errors from trying to call the portal directly from a public SPA — proxy through your backend instead.
Wrong phone format — use 07XXXXXXXX.
Create account
Sign up in the portal and get your API key — username is your email, password is the key.
Open portal — get API key