<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Text Marketer - Email SMS, Bulk SMS Gateway, SMS Marketing Blog &#187; php</title>
	<atom:link href="http://www.textmarketer.co.uk/blog/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.textmarketer.co.uk/blog</link>
	<description>SMS Gateway</description>
	<lastBuildDate>Tue, 07 Feb 2012 09:50:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>SMS Gateway in PHP</title>
		<link>http://www.textmarketer.co.uk/blog/2011/02/dev/sms-gateway-in-php/</link>
		<comments>http://www.textmarketer.co.uk/blog/2011/02/dev/sms-gateway-in-php/#comments</comments>
		<pubDate>Mon, 28 Feb 2011 16:36:29 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[All SMS Gateway Documentation]]></category>
		<category><![CDATA[Bulk SMS]]></category>
		<category><![CDATA[Development Blog]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[sms gateway in php]]></category>

		<guid isPermaLink="false">http://www.textmarketer.co.uk/blog/?p=2206</guid>
		<description><![CDATA[Build an SMS Gateway in PHP It&#8217;s a very straightforward task to build a small script in PHP to utilise our SMS Gateway to send out text messages. The benefit of integrating your SMS Gateway with Text Marketer is that we have the lowest cost per message of any company &#8230; <a href="http://www.textmarketer.co.uk/blog/2011/02/dev/sms-gateway-in-php/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h2>Build an <a href="http://www.textmarketer.co.uk/sms-gateway.htm">SMS Gateway in PHP</a></h2>
<p>It&#8217;s a very straightforward task to build a small script in PHP to utilise our SMS Gateway to send out text messages.</p>
<p>The benefit of integrating your SMS Gateway with Text Marketer is that we have the <a href="http://www.textmarketer.co.uk/bulk-sms-prices.htm">lowest cost per message</a> of any company in the UK.</p>
<p>You can find a sample PHP script for our <a href="http://www.textmarketer.co.uk/sms-gateway.htm">SMS Gateway</a> here and with a few basic modifications of the user details you should be able to have your application integrated within minutes.</p>
<p>We do also provide code snippets for other languages;</p>
<ul>
<li><span style="font-size: x-small;"><a href="http://www.textmarketer.co.uk/blog/2009/05/sms-gateway/text-marketer-apigateway-spec/">PHP code example</a></span></li>
<li><span style="font-size: x-small;"><a href="http://www.textmarketer.co.uk/blog/2011/01/technical/sms-visual-c-net-console-example/">Visual C#.Net Console</a></span></li>
<li><span style="font-size: x-small;"><a href="http://www.textmarketer.co.uk/blog/2010/02/technical/1045/">Delphi/Pascal Interface</a></span></li>
<li><span style="font-size: x-small;"><a href="http://www.textmarketer.co.uk/blog/2009/07/sms-gateway/net-examples/">.NET examples</a></span></li>
<li><span style="font-size: x-small;"><a href="http://www.textmarketer.co.uk/blog/2009/06/documentation/bulk-sms-api-asp-help/">ASP examples</a></span></li>
<li><span style="font-size: x-small;"><a href="http://www.textmarketer.co.uk/blog/2010/03/business-sms/rest-sms-api-specification-document/">REST examples</a></span></li>
</ul>
<p>If you have any queries or questions, our friendly and highly experienced technical team will be happy to help you out.</p>
<p>After 11 years of building SMS Gateways in PHP and other programming lanuguages, we&#8217;re confident we can help you overcome any task.</p>
<img src="http://www.textmarketer.co.uk/wordpress/?ak_action=api_record_view&id=2206&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.textmarketer.co.uk/blog/2011/02/dev/sms-gateway-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>REST SMS API Code Examples</title>
		<link>http://www.textmarketer.co.uk/blog/2010/03/dev/rest-sms-api-code-examples/</link>
		<comments>http://www.textmarketer.co.uk/blog/2010/03/dev/rest-sms-api-code-examples/#comments</comments>
		<pubDate>Mon, 22 Mar 2010 10:56:58 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[All SMS Gateway Documentation]]></category>
		<category><![CDATA[Development Blog]]></category>
		<category><![CDATA[PHP Classes]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php5]]></category>
		<category><![CDATA[RESTful]]></category>
		<category><![CDATA[sms api]]></category>
		<category><![CDATA[support]]></category>

		<guid isPermaLink="false">http://87.106.109.73/blog/?p=1157</guid>
		<description><![CDATA[This blog post has been superseded with our website documentation In our REST API specification document we saw, in general terms, how to make a request to our REST SMS API and how to deal with the response. Here we provide you with some more concrete examples that you can copy &#38; paste! &#8230; <a href="http://www.textmarketer.co.uk/blog/2010/03/dev/rest-sms-api-code-examples/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.textmarketer.co.uk/developers/restful-api.htm">This blog post has been superseded with our website documentation</a></p>
<p>In our <a title="REST SMS API specification" href="/blog/2010/03/business-sms/rest-sms-api-specification-document/" target="_self">REST API specification document</a> we saw, in general terms, how to make a request to our REST SMS API and how to deal with the response. Here we provide you with some more concrete examples that you can copy &amp; paste!</p>
<p>NOTE: You will want to add additional error checking to the examples below.</p>
<p>In each of the languages used here we create a request, send it, receive the response, and parse its contents.</p>
<p><strong>PHP</strong></p>
<p>Example for getting the number of credits:</p>
<pre>$url = 'http://www.textmarketer.biz/services/rest/credits';
$username = 'myAPIusername'; // CHANGE THIS!!!
$password = 'myAPIpassword'; // CHANGE THIS!!!
$url = "$url?username=$username&amp;password=$password";

// we're using the curl library to make the request
$curlHandle = curl_init();
curl_setopt($curlHandle, CURLOPT_URL, $url);
curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true);
$responseBody = curl_exec($curlHandle);
$responseInfo  = curl_getinfo($curlHandle);
curl_close($curlHandle);

// deal with the response
if ($responseInfo['http_code']==200)
{
	$xml_obj = simplexml_load_string($responseBody);
	$credits = (int) $xml_obj-&gt;credits;
	// do something with the result
	echo $credits;

} else {
	// handle the error
	var_dump($responseBody);
}</pre>
<p>Example for getting the list of delivery reports:</p>
<pre>$url = 'http://www.textmarketer.biz/services/rest/deliveryReports';
$username = 'myAPIusername'; // CHANGE THIS!!!
$password = 'myAPIpassword'; // CHANGE THIS!!!
$url = "$url?username=$username&amp;password=$password";

// we're using the curl library to make the request
$curlHandle = curl_init();
curl_setopt($curlHandle, CURLOPT_URL, $url);
curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true);
$responseBody = curl_exec($curlHandle);
$responseInfo  = curl_getinfo($curlHandle);
curl_close($curlHandle);

// deal with the response
if ($responseInfo['http_code']==200)
{
	$xml_obj = simplexml_load_string($responseBody);
	$atts = $xml_obj-&gt;reports-&gt;attributes();
	$num_reports = (int) $atts-&gt;quantity;

	if ($num_reports &gt; 0)
	{
		echo "$num_reports reports\n";
		$reports = array();
		foreach ($xml_obj-&gt;reports-&gt;report as $xml_report)
		{
			$atts = $xml_report-&gt;attributes();
			$name = (string) $atts-&gt;name;
			$updated = (string) $atts-&gt;last_updated;
			$reports[] = array('name'=&gt;$name, 'modified'=&gt;$updated);
		}
		// do something with the report details
		var_dump($reports);
	} else {
		echo 'No reports available';
	}
} else {
	// handle the error
	var_dump($responseBody);
}</pre>
<p>Example for getting the details of a particular delivery report:</p>
<pre>// TODO the URL will change according to the delivery report to retrieve...
$url = 'http://www.textmarketer.biz/services/rest/deliveryReport/GatewayAPI_09-02-10';
$username = 'myAPIusername'; // CHANGE THIS!!!
$password = 'myAPIpassword'; // CHANGE THIS!!!
$url = "$url?username=$username&amp;password=$password";

// we're using the curl library to make the request
$curlHandle = curl_init();
curl_setopt($curlHandle, CURLOPT_URL, $url);
curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true);
$responseBody = curl_exec($curlHandle);
$responseInfo  = curl_getinfo($curlHandle);
curl_close($curlHandle);

// deal with the response
if ($responseInfo['http_code']==200)
{
	$xml_obj = simplexml_load_string($responseBody);

	$reportRows = array();
	foreach ($xml_obj-&gt;report-&gt;reportrow as $xml_reportRow)
	{
		$atts = $xml_reportRow-&gt;attributes();
		$mobile = (string) $atts-&gt;mobile_number;
		$updated = (string) $atts-&gt;last_updated;
		$msgID = (int) $atts-&gt;message_id;
		$status = (string) $atts-&gt;status;
		$reports[] = array('mobile'=&gt;$mobile, 'modified'=&gt;$updated, 'messageID'=&gt;$msgID, 'status'=&gt;$status);
	}
	// do something with the report details
	var_dump($reports);

} else {
	// handle the error
	var_dump($responseBody);
}</pre>
<p>Example for sending an SMS:</p>
<pre>$url = 'http://www.textmarketer.biz/services/rest/sms';
$username = 'myAPIusername'; // CHANGE THIS!!!
$password = 'myAPIpassword'; // CHANGE THIS!!!

$data = array('message'=&gt;'hello','mobile_number'=&gt;'447777777777', 'originator'=&gt;'me',
	'username'=&gt;$username, 'password'=&gt;$password);
$data = http_build_query($data, '', '&amp;');
// we're using the curl library to make the request
$curlHandle = curl_init();
curl_setopt($curlHandle, CURLOPT_URL, $url);
curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curlHandle, CURLOPT_POSTFIELDS, $data);
curl_setopt($curlHandle, CURLOPT_POST, 1);
$responseBody = curl_exec($curlHandle);
$responseInfo  = curl_getinfo($curlHandle);
curl_close($curlHandle);

// deal with the response
if ($responseInfo['http_code']==200)
{
	$xml_obj = simplexml_load_string($responseBody);
	// do something with the result
	echo "Message ID: $xml_obj-&gt;message_id\n";
	echo "Credits used: $xml_obj-&gt;credits_used\n";

	var_dump($responseBody);

} else {
	// handle the error
	var_dump($responseInfo);
	var_dump($responseBody);
}</pre>
<p>Example for transferring credits:</p>
<pre>
<div>&lt;?php</div>
<div>/**</div>
<div> * POST request on the 'credits' resource (credit transfer)</div>
<div> */</div>
<div>$url = '<a href="http://www.textmarketer.biz/services/rest/credits" target="_blank">http://www.textmarketer.biz/services/rest/credits</a>';</div>
<div>// for testing:</div>
<div>//$url = '<a href="http://sandbox.textmarketer.biz/services/rest/credits" target="_blank">http://sandbox.textmarketer.biz/services/rest/credits</a>';</div>
<div>$username = 'myAPIusername'; // CHANGE THIS!!! - the username of the account you're transferring FROM</div>
<div>$password = 'myAPIpassword'; // CHANGE THIS!!!</div>
<div>$targetAccountNumber = 0; // CHANGE THIS!!</div>
<div></div>
<div>$data = array('quantity'=&gt;'1','target'=&gt;$targetAccountNumber,</div>
<div><span>	</span>'username'=&gt;$username, 'password'=&gt;$password);</div>
<div>$data = http_build_query($data, '', '&amp;');</div>
<div>// we're using the curl library to make the request</div>
<div>$curlHandle = curl_init();</div>
<div>curl_setopt($curlHandle, CURLOPT_URL, $url);</div>
<div>curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true);</div>
<div>curl_setopt($curlHandle, CURLOPT_POSTFIELDS, $data);</div>
<div>curl_setopt($curlHandle, CURLOPT_POST, 1);</div>
<div>$responseBody = curl_exec($curlHandle);</div>
<div>$responseInfo  = curl_getinfo($curlHandle);</div>
<div>curl_close($curlHandle);</div>
<div></div>
<div>// deal with the response</div>
<div>if ($responseInfo['http_code']==200)</div>
<div>{</div>
<div> // success - you may want to read in the return data here to see how many credits were  left on each account</div>
<div></div>
<div>} else {</div>
<div><span>	</span>// handle the error here</div>
<div><span>	</span>// var_dump($responseInfo);</div>
<div><span>	</span>// var_dump($responseBody);</div>
<div>}</div>

?&gt;</pre>
<p>For more details on creating <a title="REST requests in PHP" href="http://www.gen-x-design.com/archives/making-restful-requests-in-php/" target="_blank">REST requests in PHP, see here</a>.</p>
<img src="http://www.textmarketer.co.uk/wordpress/?ak_action=api_record_view&id=1157&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.textmarketer.co.uk/blog/2010/03/dev/rest-sms-api-code-examples/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to integrate our SMS Gateway API into your systems</title>
		<link>http://www.textmarketer.co.uk/blog/2009/05/sms-gateway/how-to-integrate-our-sms-gateway-api-into-your-systems/</link>
		<comments>http://www.textmarketer.co.uk/blog/2009/05/sms-gateway/how-to-integrate-our-sms-gateway-api-into-your-systems/#comments</comments>
		<pubDate>Wed, 20 May 2009 14:34:32 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[All SMS Gateway Documentation]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[gateway]]></category>
		<category><![CDATA[integrate]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[sms]]></category>
		<category><![CDATA[Web to SMS]]></category>

		<guid isPermaLink="false">http://87.106.109.73/blog/?p=70</guid>
		<description><![CDATA[Introduction Adding SMS as a communication method to a system is often very useful, for instance you don&#8217;t have issues with spam filtering, it doesn&#8217;t require the person to make an immediate response like a phone call, so it&#8217;s great for alerts and triggers. Another good application for SMS (text &#8230; <a href="http://www.textmarketer.co.uk/blog/2009/05/sms-gateway/how-to-integrate-our-sms-gateway-api-into-your-systems/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h2>Introduction</h2>
<p>Adding SMS as a communication method to a system is often very useful, for instance you don&#8217;t have issues with spam filtering, it doesn&#8217;t require the person to make an immediate response like a phone call, so it&#8217;s great for alerts and triggers. Another good application for SMS (text messaging) which is often over looked is the ability to use it as a method to update a system or retrieve information without needing any equipment other than a mobile phone, any one would work. This is done using a short code.</p>
<p><strong>Consider this example:</strong></p>
<p>You own a fictitious &#8220;temporary employment agency&#8221; with several hundred people on your books.  Your client has asked you to fulfill a specific job such as a receptionist. You send an SMS:</p>
<p><strong>Receptionist cover required for 2 weeks 4 hr per day @ £10 per hr, location Bristol. Reply with &#8220;more 4567a&#8221; for more info.</strong></p>
<p>The last bit (more 4567a) is the information that allows us to automate things, the keyword <strong>more</strong> is used to identify you, and the code would be a reference to the job. The potential candidate could then reply where by (in this case) you could :</p>
<ol>
<li>Send more details from the job description</li>
<li>Update the database that this person is a likely candidate</li>
<li>The person has expressed interest in the receptionist job, we could make an assumption that they maybe interested in other receptionist jobs so you could start creating groups that could be used for later targeting.</li>
</ol>
<h2>Implementation</h2>
<p><strong>So how do we set up the <a title="SMS Gateway" href="http://www.textmarketer.co.uk/sms-gateway.htm">SMS gateway</a> and send messages? Fortunately it&#8217;s easy.</strong><br />
First you need an <a href="http://www.textmarketer.co.uk/free-bulk-sms-software.htm">account</a> (it&#8217;s free) and automated. You&#8217;ll get the user name and password you need plus you get some free sends. You will also need to ask for the API URL.</p>
<p>Next use the out bound API (sometimes called an SMS gateway) for your message. This is a simple HTTP GET request which can either be sent via http or https. You will need to url encode the message.<br />
<strong>http://&lt;request the url&gt;?username=myUsername&amp;password=myPassword&amp;number=447777777777&amp;message=Receptionist+cover+required+for+2+weeks+4+hr+per+day+%40+%C2%A310+per+hr%2C+location+Bristol.+Reply+with+%22more+4567a%22&amp;orig=88802</strong><br />
You can try the above in any old browser.</p>
<p><a title="Example PHP5 send SMS class" href="http://www.textmarketer.co.uk/blog/2009/05/technical/text-marketer-apigateway-spec/" target="_blank">There is an example class (in PHP 5)</a> that would do this for you</p>
<h3>Next we want to use the incoming response from the recipient</h3>
<p>This is the bit where we need to speak to or email the company,  a keyword is required  (which is free) on the 88802 short code, in our example we are using the word &#8220;more&#8221;. You then supply Text Marketer with a URL on your domain that will get notified with the parameters once a response is received. For example www.mydomain.com/myscript.php</p>
<p>If the applicant replied with &#8220;more 4567a&#8221; you would receive an HTTP GET like this <strong>http://www.mydomain.com/myscript.php?number=4477777777&amp;message=more+4567a&amp;network=ORANGEUK</strong></p>
<p>It is then up to you how you use this information, the example gives a few ideas.</p>
<img src="http://www.textmarketer.co.uk/wordpress/?ak_action=api_record_view&id=70&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.textmarketer.co.uk/blog/2009/05/sms-gateway/how-to-integrate-our-sms-gateway-api-into-your-systems/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SMS Gateway API &#8211; Specification</title>
		<link>http://www.textmarketer.co.uk/blog/2009/05/sms-gateway/text-marketer-apigateway-spec/</link>
		<comments>http://www.textmarketer.co.uk/blog/2009/05/sms-gateway/text-marketer-apigateway-spec/#comments</comments>
		<pubDate>Wed, 20 May 2009 12:06:50 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[All SMS Gateway Documentation]]></category>
		<category><![CDATA[Documentation]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[gateway]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[sms]]></category>
		<category><![CDATA[specification]]></category>

		<guid isPermaLink="false">http://87.106.109.73/blog/?p=77</guid>
		<description><![CDATA[This blog post has been superseded with our website documentation It is recommended that you use the  RESTful version of the API which has largely superseded this document (you can do more with it). However if you want to get up and running quickly then it might still be the best way for you. When you create a free account &#8230; <a href="http://www.textmarketer.co.uk/blog/2009/05/sms-gateway/text-marketer-apigateway-spec/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.textmarketer.co.uk/developers/simple-sms-api.htm">This blog post has been superseded with our website documentation</a></p>
<p>It is <strong>recommended</strong> that you use the  <a href="http://www.textmarketer.co.uk/blog/2010/03/business-sms/rest-sms-api-specification-document/">RESTful version of the API</a> which has largely superseded this document (you can do more with it). However if you want to get up and running quickly then it might still be the best way for you.</p>
<p>When you create a <a href="http://www.textmarketer.co.uk/free-bulk-sms-software.htm">free account</a> you can also use the Text Marketer API (sometimes known as a gateway).<br />
The API uses simple HTTP GET requests to communicate with the Text Marketer gateway server. The requests allow you to send SMS&#8217;s through the system, you can also retrieve <a href="http://www.textmarketer.co.uk/blog/2009/05/sms-gateway/using-the-api-automating-delivery-report-collection/">delivery reports discussed here</a>.</p>
<h3>HTTP GET Request Parameters</h3>
<h4></h4>
<table border="0" cellpadding="2" cellspacing="5">
<tbody>
<tr>
<td><strong>Parameter</strong></td>
<td><strong>Comment</strong></td>
</tr>
<tr>
<td>username</td>
<td>Can be found by logging in to your account : Settings -&gt; API Settings</td>
</tr>
<tr>
<td>password</td>
<td>Can be found by logging in to your account : Settings -&gt; API Settings</td>
</tr>
<tr>
<td>orig</td>
<td>Who is the message from? This can be 11 alpha-numeric or 16 numeric characters</td>
</tr>
<tr>
<td>number</td>
<td>The recipient. Please make sure you include the international code e.g <strong>44</strong>77777777</td>
</tr>
<tr>
<td>message</td>
<td>up to 612 character message</td>
</tr>
<tr>
<td>option</td>
<td>can be blank or set to xml (recommended) *</td>
</tr>
</tbody>
</table>
<p>* optional parameter, discussed below.</p>
<p><strong>URL ENCODING<br />
</strong>You must <a href="http://www.blooberry.com/indexdot/html/topics/urlencoding.htm">url encode</a> the <strong>orig</strong> and <strong>message</strong> parameters, if you dont do this you&#8217;ll get gateway failures or odd results.</p>
<p><strong>SUPPORTED CHARACTERS</strong><br />
The GSM alphabet is a subset of ISO-8859-1. The SMS GSM characters we can support is <a title="GSM Character Set" href="http://www.textmarketer.co.uk/blog/2009/07/bulk-sms/supported-and-unsupported-characters-in-text-messages-gsm-character-set/" target="_blank">documented here</a></p>
<p><strong>CONCATENATION</strong><br />
If you exceed 160 characters you automatically covert to concatenation sending, this has the following connotations. Each message consists of a 153 character &#8216;chunk&#8217; (not 160 chars) the extra characters are used to glue the messages together. Therefore a message that is 307 characters long will require 3 messages to send.</p>
<h3>An Example HTTP GET Request</h3>
<p><span style="color: #808080;"><em><span style="color: #0000ff;">http://www.textmarketer.biz/gateway/?username=n&amp;password=s&amp;number=4477777777&amp;message=test&amp;orig=me&amp;option=xml</span></em></span></p>
<p>This would send an SMS to 4477777777 from &#8220;me&#8221; with the message test, remember the username &#8220;n&#8221; and password &#8220;p&#8221; can be found un your account under the <strong>Text Response =&gt; API Settings </strong>menu option.</p>
<p><strong>SSL (HTTPS) Support</strong></p>
<p>The API also supports SSL, just use port 443 instead (<strong> https</strong>:// )</p>
<h3>Gateway Responses</h3>
<p>The API or Gateway can respond in 2 formats depending if you have set the option=xml (recommended) or not.</p>
<p><strong>No option parameter (or option blank).  Simple &#8216;plain text&#8217; response </strong></p>
<p>Once you have made a successful connection (HTTP 200) to our server and sent the request the server will reply in two different ways.</p>
<ul>
<li>SUCCESS &lt;new line&gt;&lt;number of credits remaining&gt;&lt;new line&gt;</li>
<li>FAILED &lt;new line&gt; &lt;reasons&gt;&lt;number of credits remaining if available&gt;&lt;new line&gt;</li>
</ul>
<table border="1" cellpadding="2">
<tbody>
<tr>
<td>SUCCESS<br />
4</td>
</tr>
<tr>
<td>Or</td>
</tr>
<tr>
<td>FAILED<br />
invalid number, not an integer<br />
invalid number, too short<br />
3</td>
</tr>
</tbody>
</table>
<p>The final line of the response contains the number of credits you have remaining, you get 10 free credits with your account.</p>
<p><a href="http://www.textmarketer.co.uk/blog/2009/06/technical/php-5-simple-sms-send-class/">A simple PHP 5 class for sending bulk SMS is available here</a></p>
<p><strong>Using the option=xml (recommended)</strong></p>
<p>A better way of decoding the response is to use the parameter <strong>option</strong>, this will make the gateway respond in the  XML format which gives room for future proofing and also it&#8217;s a better way to interpret / parse the results.</p>
<p><strong>XML Example (success)</strong></p>
<pre>&lt;?xml version="1.0" encoding="UTF-8"?&gt;</pre>
<pre>&lt;!DOCTYPE response SYSTEM "http://www.textmarketer.biz/dtd/api_response.dtd"&gt;</pre>
<pre>&lt;response status="success" id="1213465434"&gt;</pre>
<pre>    &lt;credits&gt;1000&lt;/credits&gt;</pre>
<pre>   &lt;credits_used&gt;1&lt;/credits_used&gt;</pre>
<pre>&lt;/response&gt;</pre>
<p><strong>XML Example (failure)</strong></p>
<pre>&lt;?xml version="1.0" encoding="UTF-8"?&gt;</pre>
<pre>&lt;!DOCTYPE response SYSTEM "http://www.textmarketer.biz/dtd/api_response.dtd"&gt;</pre>
<pre>&lt;response status="failed" id="0"&gt;</pre>
<pre>   &lt;reason&gt;invalid message or missing&lt;/reason&gt;</pre>
<pre>   &lt;reason&gt;invalid number or too short&lt;/reason&gt;</pre>
<pre>&lt;/response&gt;
<strong> </strong></pre>
<p><a href="http://www.textmarketer.biz/dtd/api_response.dtd">The DTD for the xml is available here</a>. In reality it doesn&#8217;t get any more complicated than the above.</p>
<p><a href="http://www.textmarketer.co.uk/blog/2009/06/technical/php-5-simple-sms-send-class/">A simple PHP 5 class for sending bulk SMS is available here</a></p>
<p><a href="http://www.textmarketer.co.uk/blog/2009/07/technical/using-our-short-code-and-gateway-apis-to-create-a-game/" target="_blank">Help and an example of our short code API</a></p>
<p><a href="http://www.textmarketer.co.uk/blog/2009/06/documentation/bulk-sms-api-asp-help/">Help with ASP Bulk SMS</a></p>
<p><a title=".net examples for sms gateway" href="http://www.textmarketer.co.uk/blog/2009/07/sms-gateway/net-examples/" target="_blank">NET Examples<br />
</a><br />
<a title="allowed characters for sms" href="http://www.textmarketer.co.uk/blog/2009/07/bulk-sms/supported-and-unsupported-characters-in-text-messages-gsm-character-set/" target="_blank">Supported and Unsupported characters in Text Messages &#8211; GSM Character Set<br />
</a><br />
<a title="sms delivery reports help" href="http://www.textmarketer.co.uk/blog/2009/06/sms-gateway/php-5-delivery-report-helper-class/" target="_blank">PHP 5 Delivery Report Helper Class for our SMS Gateway<br />
</a><br />
<a title="implementing listeners for sms gateway" href="http://www.textmarketer.co.uk/blog/2009/06/sms-gateway/php-5-sms-send-class-implementing-listeners/" target="_blank">PHP 5 SMS Send Class implementing listeners on our SMS Gateway<br />
</a><br />
<a title="delivery reports for sms api" href="http://www.textmarketer.co.uk/blog/2009/05/sms-gateway/using-the-api-automating-delivery-report-collection/" target="_blank">Using the SMS Gateway API, Automating Delivery Report Collection<br />
</a><br />
<a title="short code sms api" href="http://www.textmarketer.co.uk/blog/2009/05/sms-gateway/text-marketer-short-code-api-options/" target="_blank">Text Marketer short code API options</a></p>
<img src="http://www.textmarketer.co.uk/wordpress/?ak_action=api_record_view&id=77&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.textmarketer.co.uk/blog/2009/05/sms-gateway/text-marketer-apigateway-spec/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

