Retrieve your iSMS SMS credit balance programmatically using PHP and the iSMS balance API.
Use this endpoint to retrieve your current iSMS credit balance and expiry date programmatically.
https://www.isms.com.my/isms_balance.php?un=your_username&pwd=your_password<?php
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => 'https://www.isms.com.my/isms_balance.php?un=your_username&pwd=your_password',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_SSL_VERIFYPEER => true,
CURLOPT_TIMEOUT => 15,
]);
$balance = curl_exec($ch);
$err = curl_error($ch);
curl_close($ch);
if ($err) {
echo 'Error: ' . $err;
} else {
// Response is plain text e.g. "250.0"
echo 'SMS Credits Remaining: ' . trim($balance);
}
Contact our team — we reply within 1 business day.