/bulk-sms-service/php-example/

Sample Atomic SMS Sender API use with PHP

We are offering connection to our SMS gateway free of charge. SMS gateway usage helps to automate bulk sms sending and integrate Atomic SMS Sender service into various projects.

Implementation of the required code and integrating it with our system is very easy if you have just basic PHP knowledge.

See below the source code of the PHP implementation:

 
 
<?php
$src = '<?xml version="1.0" encoding="UTF-8"?>
<SMS>
<operations>
<operation>SEND</operation>
</operations>
<authentification>
<username></username>
<password></password>
</authentification>
<message>
<sender>SMS</sender>
<text>Test message [UTF-8]</text>
</message>
<numbers>
<number>380972920000</number>
</numbers>
</SMS>';

$Curl = curl_init();
$CurlOptions = array(
CURLOPT_URL=>'https://api.atompark.com/members/sms/xml.php',
CURLOPT_FOLLOWLOCATION=>false,
CURLOPT_POST=>true,
CURLOPT_HEADER=>false,
CURLOPT_RETURNTRANSFER=>true,
CURLOPT_CONNECTTIMEOUT=>15,
CURLOPT_TIMEOUT=>100,
CURLOPT_POSTFIELDS=>array('XML'=>$src),
);
curl_setopt_array($Curl, $CurlOptions);
if(false === ($Result = curl_exec($Curl))) {
throw new Exception('Http request failed');
}

curl_close($Curl);

echo $Result;
?>
 

Getting status of sent sms*:

<?php	
	$src = '<?xml version="1.0" encoding="UTF-8"?>	
	<SMS>	
	<operations>	
	<operation>GETSTATUS</operation>	
	</operations>	
	<authentification>	
	<username></username>	
	<password></password>	
	</authentification>	
	<statistics>
        <messageid>msg11</messageid>	
	</statistics>	
	</SMS>';	

	$Curl = curl_init();	
	$CurlOptions = array(	
	CURLOPT_URL=>'http://api.atompark.com/members/sms/xml.php',	
	CURLOPT_FOLLOWLOCATION=>false,	
	CURLOPT_POST=>true,	
	CURLOPT_HEADER=>false,	
	CURLOPT_RETURNTRANSFER=>true,	
	CURLOPT_CONNECTTIMEOUT=>15,	
	CURLOPT_TIMEOUT=>100,	
	CURLOPT_POSTFIELDS=>array('XML'=>$src),	
	);	
	curl_setopt_array($Curl, $CurlOptions);	
	if(false === ($Result = curl_exec($Curl))) {	
	throw new Exception('Http request failed');	
	}	

	curl_close($Curl);	

	echo $Result;	
	?>

The sms status information will be available in a few minutes

Getting a price of the sms:

<?php	
	$src = '<?xml version="1.0" encoding="UTF-8"?>	
	<SMS>	
	<operations>	
	<operation>GETPRICE</operation>	
	</operations>	
	<authentification>	
	<username></username>	
	<password></password>	
	</authentification>	
	<message>	
	<sender>SMS</sender>	
	<text>Test message [UTF-8]</text>	
	</message>	
	<numbers>	
	<number messageID="msg11">380972920000</number>	
	</numbers>	
	</SMS>';	

	$Curl = curl_init();	
	$CurlOptions = array(	
	CURLOPT_URL=>'http://api.atompark.com/members/sms/xml.php',	
	CURLOPT_FOLLOWLOCATION=>false,	
	CURLOPT_POST=>true,	
	CURLOPT_HEADER=>false,	
	CURLOPT_RETURNTRANSFER=>true,	
	CURLOPT_CONNECTTIMEOUT=>15,	
	CURLOPT_TIMEOUT=>100,	
	CURLOPT_POSTFIELDS=>array('XML'=>$src),	
	);	
	curl_setopt_array($Curl, $CurlOptions);	
	if(false === ($Result = curl_exec($Curl))) {	
	throw new Exception('Http request failed');	
	}	

	curl_close($Curl);	

	echo $Result;	
	?>

Getting current balance:

<?php	
	$src = '<?xml version="1.0" encoding="UTF-8"?>	
	<SMS>	
	<operations>	
	<operation>BALANCE</operation>	
	</operations>	
	<authentification>	
	<username></username>	
	<password></password>	
	</authentification>		
	</SMS>';	

	$Curl = curl_init();	
	$CurlOptions = array(	
	CURLOPT_URL=>'http://api.atompark.com/members/sms/xml.php',	
	CURLOPT_FOLLOWLOCATION=>false,	
	CURLOPT_POST=>true,	
	CURLOPT_HEADER=>false,	
	CURLOPT_RETURNTRANSFER=>true,	
	CURLOPT_CONNECTTIMEOUT=>15,	
	CURLOPT_TIMEOUT=>100,	
	CURLOPT_POSTFIELDS=>array('XML'=>$src),	
	);	
	curl_setopt_array($Curl, $CurlOptions);	
	if(false === ($Result = curl_exec($Curl))) {	
	throw new Exception('Http request failed');	
	}	

	curl_close($Curl);	

	echo $Result;	
	?>

SMS messaging price is as low as the price stated in Atomic SMS Sender service.

If you still have any questions concerning integration with our sms gateway, please do not hesitate to contact our support team, we will be glad to help you.

Perfect service! I work with the module for WHMC. Thank you!!!!  Read more »
Roman
VoiceHost
i am grateful for this development and i recommend you so much. Keep it up Read more »
United Nation GH Ashanti
Start using Atomic SMS Sender today for free!

 

Activate your account and get 10 SMS messages to try our service for free.

Click the «download» button to download software and then click the «save file» button when prompted.