API Quickstart
From token to real call data in five minutes. Follow along with curl, then see the same flow in PHP and JavaScript.
Got your token? Let's build something real.
Log in to the ConsoleStep 1 — Get a token
- Log in at console.simpletelecom.com.au/login.
- Go to Settings → API Access.
- Click Generate API Token and copy it.
Tokens look like st_.... Keep it secret — see Authentication for how to handle it safely.
Step 2 — List your services
Every integration starts here: find out what services are on your account and their IDs.
curl -X GET "https://api.simpletelecom.com.au/v1/api/services" \
-H "Authorization: Bearer st_your_token_here"
You'll get a data array of services. Note the service_id (used for routing) and service_number (used for CDRs) for the number you care about — for example service_id: 123, service_number: "1300858751".
Step 3 — Pull call detail records
Now fetch the actual call records for that number:
curl -X GET "https://api.simpletelecom.com.au/v1/api/cdrs?service_number=1300858751&start_date=2026-07-01&end_date=2026-07-31" \
-H "Authorization: Bearer st_your_token_here"
Each record shows the call times, duration, source, destination and cost. That's it — you're now reading live call data from the Simple Telecom API.
The same flow in PHP
<?php
$token = "st_your_token_here";
$base = "https://api.simpletelecom.com.au/v1";
function api_get($url, $token) {
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer $token"],
]);
return json_decode(curl_exec($ch), true);
}
$services = api_get("$base/api/services", $token);
$service = $services['data'][0];
echo "Service: {$service['service_number']} (id {$service['service_id']})\n";
$cdrs = api_get("$base/api/cdrs?service_number={$service['service_number']}&start_date=2026-07-01&end_date=2026-07-31", $token);
foreach ($cdrs['data'] ?? [] as $cdr) {
echo " {$cdr['start_time']} {$cdr['duration_sec']}s \${$cdr['cost']}\n";
}
The same flow in JavaScript
const token = "st_your_token_here";
const base = "https://api.simpletelecom.com.au/v1";
const auth = { headers: { Authorization: `Bearer ${token}` } };
async function main() {
const { data: services } = await fetch(`${base}/api/services`, auth).then(r => r.json());
const service = services[0];
console.log(`Service: ${service.service_number} (id ${service.service_id})`);
const params = new URLSearchParams({
service_number: service.service_number,
start_date: "2026-07-01",
end_date: "2026-07-31",
});
const { data: cdrs } = await fetch(`${base}/api/cdrs?${params}`, auth).then(r => r.json());
for (const cdr of cdrs) {
console.log(` ${cdr.start_time} ${cdr.duration_sec}s $${cdr.cost}`);
}
}
main();
Next steps
- See how far you can go: Your services, Call detail records, Read call routing.
- Make changes: Manage forwarding, Call recording.
- Get a full snippet library: Code examples.
- Build it properly: Error handling.
