How to send bulk sms using php and http api

Sending bulk sms using our robust http api is very easy. Simply copy and paste the code sample below and replace the placeholders with yours

$email = urlencode(‘your-login-email’);
$password = urlencode(‘your-password’);
$type = ‘0 or 1’;
$dlr = ‘0 or 1’;
$destination = urlencode(‘gsm-1,gsm-2,gsm-3,…’);
$sender = urlencode(‘sender’);
$message = urlencode(‘message’);

$url = ‘http://smsgator.com/bulksms?email=’.$email.’&password=’.$password.’&type=’.$type.’&dlr=’.$dlr.’&destination=’.$destination.’&sender=’.$sender.’&message=’.$message;

$response = file_get_contents($url);

echo $response;

?>

A response  from our API will look like this

error code|destination|message id|units,error code|destination|message id|units,error code|destination|message id|units…

For more information, visit our API page http://smsgator.com/Developer

Let us know how it went.

Leave a Reply

Your email address will not be published. Required fields are marked *