Replace user, password, msisdn, sid and message accordingly.
1. Below is the sample code for php for Single Message:
<?php
$user = 'abc';
$password = 'xyz';
$msisdn = '919898xxxxxx';
$sid = 'SenderId';
$message = 'test message';
$fl = '0';
$gwid = '2';
$url = 'http://sms.domainadda.com/vendorsms/pushsms.aspx?user=' . $user . '&password=' . $password . '&msisdn=' . $msisdn . '&sid=' . $sid . '&msg=' . urlencode($message) . '&fl=' . $fl . '&gwid=' . $gwid;
$response = file_get_contents($url);
if ($response === false) {
echo 'Error sending request';
} else {
echo 'API response: ' . $response;
}
?>
2. Below is the sample code for php for Multiple Messages:
<?php
$user = 'abc';
$password = 'xyz';
$msisdns = '919898xxxxxx,919898xxxxxx'; // Comma-separated list of phone numbers
$sid = 'SenderId';
$message = 'test message';
$fl = '0';
$gwid = '2';
$url = 'http://sms.domainadda.com/vendorsms/pushsms.aspx?user=' . $user . '&password=' . $password . '&msisdn=' . urlencode($msisdns) . '&sid=' . $sid . '&msg=' . urlencode($message) . '&fl=' . $fl . '&gwid=' . $gwid;
$response = file_get_contents($url);
if ($response === false) {
echo 'Error sending request';
} else {
echo 'API response: ' . $response;
}
?>