954,587 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

SMS API Integration

I have purchased SMS gateway from one hosting company. How can i integrate my SMS gateway with my website?

Karthik_pranas
Posting Pro
564 posts since Feb 2011
Reputation Points: 96
Solved Threads: 97
 

If in case the SMS Gateway allows sending SMSes by a accessing a simple url with authentication etc params ( example:, http:///index.php?username=john@smith.com&password=randompassword&to=9876543210&message=testmessage)

then this all you need is
1. a simple html form
2. which can post the message
3. to a php script which can make a CURL call to the SMS Gateway URL

sample code for a CURL call

$url = "http://somethirdpartysmsgatewaydomain.com/index.php";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POSTFIELDS, 'username=john@smith.com&password=randompassword&to=9876543210&message=testmessage');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
echo $result;


Anyways, this is just A solution in case the SMS Gateway is operating in the above assumed fashion
Beyond this it would help checking out with the SMS gateway provider itself as to how all of this needs to be integrated

Any more info from them here would help

jigarvyas
Newbie Poster
11 posts since Oct 2009
Reputation Points: 10
Solved Threads: 3
 

If in case the SMS Gateway allows sending SMSes by a accessing a simple url with authentication etc params ( example:, http:///index.php?username=john@smith.com&password=randompassword&to=9876543210&message=testmessage)

then this all you need is 1. a simple html form 2. which can post the message 3. to a php script which can make a CURL call to the SMS Gateway URL

sample code for a CURL call

$url = "http://somethirdpartysmsgatewaydomain.com/index.php";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POSTFIELDS, 'username=john@smith.com&password=randompassword&to=9876543210&message=testmessage');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
echo $result;

Anyways, this is just A solution in case the SMS Gateway is operating in the above assumed fashion Beyond this it would help checking out with the SMS gateway provider itself as to how all of this needs to be integrated

Any more info from them here would help


Ok.. Thanks for your reply. Now i'm deling with the SMS gateway provider for the API.

Karthik_pranas
Posting Pro
564 posts since Feb 2011
Reputation Points: 96
Solved Threads: 97
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: