<?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; specification</title>
	<atom:link href="http://www.textmarketer.co.uk/blog/tag/specification/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>REST SMS Gateway API &#8211; Specification Document</title>
		<link>http://www.textmarketer.co.uk/blog/2010/03/business-sms/rest-sms-api-specification-document/</link>
		<comments>http://www.textmarketer.co.uk/blog/2010/03/business-sms/rest-sms-api-specification-document/#comments</comments>
		<pubDate>Mon, 22 Mar 2010 10:57:16 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[Business SMS]]></category>
		<category><![CDATA[Documentation]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[All SMS Gateway Documentation]]></category>
		<category><![CDATA[RESTful]]></category>
		<category><![CDATA[sms api]]></category>
		<category><![CDATA[specification]]></category>

		<guid isPermaLink="false">http://87.106.109.73/blog/?p=1134</guid>
		<description><![CDATA[This blog post has been superseded with our website documentation For an overview of what REST and our RESTful SMS API is all about you may like to read our RESTful SMS API Overview. If you prefer you can use the simple SMS gateway, rather than our RESTful implementation. To get straight into the details, &#8230; <a href="http://www.textmarketer.co.uk/blog/2010/03/business-sms/rest-sms-api-specification-document/">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>For an overview of what REST and our RESTful SMS API is all about you may like to read our <a title="RESTful SMS API Overview" href="/blog/2010/03/sms-gateway/restful-web-services-sms-api-overview/" target="_self">RESTful SMS API Overview</a>.</p>
<p>If you prefer you can use the <a title="simple sms gateway" href="http://www.textmarketer.co.uk/blog/2009/05/sms-gateway/text-marketer-apigateway-spec/">simple SMS gateway</a>, rather than our RESTful implementation.</p>
<p><strong>To get straight into the details, jump to:</strong></p>
<p><a title="Quick Start SMS API" href="#quickstart" target="_self">Quick Start</a><br />
<a title="Error Codes" href="#error_codes">Error codes</a></p>
<p><a title="Sandbox for testing" href="#sandbox">Sandbox</a></p>
<p>You can preform the following actions using the REST web service:</p>
<ul>
<li>send an SMS (<a title="sms post" href="#sms_resource">sms post</a>)</li>
<li>get the number of credits available (<a title="credits get" href="/blog/2010/06/sms-gateway/rest-sms-gateway-api-credits-resource/#get">credits get</a>)</li>
<li>transfer credits from one account to another (<a title="credits post" href="/blog/2010/06/sms-gateway/rest-sms-gateway-api-credits-resource/#post">credits post</a>)</li>
<li>get a list of delivery reports (<a title="deliveryReports get" href="/blog/2010/06/business-sms/rest-sms-gateway-api-deliveryreports-resource/#get">deliveryReports get</a>)</li>
<li>get the contents of a specific delivery report (<a title="deliveryReport get" href="/blog/2010/06/sms-gateway/rest-sms-gateway-api-deliveryreport-resource/#get">deliveryReport get</a>)</li>
<li>check availability of a given keyword on our ShortCode number (<a title="keywords get" href="/blog/2010/06/sms-gateway/rest-sms-gateway-api-keywords-resource/#get">keywords get</a>)</li>
<li>check the names and IDs of your send groups (<a title="Groups GET" href="/blog/2011/04/sms-gateway/rest-sms-gateway-api-group-resource/">groups get</a>)</li>
<li>add number(s) to a send group (<a title="group post" href="/blog/2011/04/sms-gateway/rest-sms-gateway-api-group-resource/#post">group post</a>)</li>
</ul>
<h2><a title="The Resource Identifier" href="#resource_identifier">Specification of the resources</a></h2>
<ol>
<li><a href="#credits_resource">credits</a></li>
<li><a title="deliveryReports resource" href="#deliveryReports_resource">deliveryReports</a></li>
<li><a title="deliveryReport resource" href="#deliveryReport_resource">deliveryReport</a></li>
<li><a title="sms resource" href="#sms_resource">sms</a></li>
<li><a title="keywords resource" href="#keywords_resource">keywords</a></li>
<li><a title="group resource" href="#group_resource">group</a></li>
<li><a title="groups resource" href="#groups_resource">groups</a></li>
</ol>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><strong>QUICK START</strong><br />
Three things are essentially needed to use the REST SMS API:</p>
<ol>
<li>Ability to make a HTTP request
<ul>
<li>e.g. to https://www.textmarketer.biz/services/rest/credits</li>
</ul>
</li>
<li>Ability to read the HTTP response headers
<ul>
<li>e.g. &#8217;200 OK&#8217;</li>
</ul>
</li>
<li>Ability to parse the XML response
<ul>
<li>e.g. &lt;<span class="start-tag">credits</span>&gt;37&lt;/<span class="end-tag">credits</span>&gt;</li>
</ul>
</li>
</ol>
<p><strong>The Request URI </strong><strong>Explained</strong></p>
<p>You will make the HTTP request to a request URI such as:</p>
<pre>https://www.textmarketer.biz/services/rest/credits</pre>
<p>The base request URI is thus composed of :</p>
<p>&#8216;<em><strong>https://www.textmarketer.biz/services/rest/</strong></em><em>&#8216;</em> + a string that denotes the resource to be accessed, e.g. &#8216;<em>credits</em>&#8216;, &#8216;<em>deliveryReports</em>&#8216;, etc.</p>
<p>You can use http instead of https, but https is recommended.</p>
<p>Note that cAsE matters, i.e. &#8216;<em>deliveryReports</em>&#8216; will work, whereas &#8216;<em>deliveryreports</em>&#8216; (lower case &#8216;r&#8217;) will return an error.</p>
<p>You must obviously identify yourself during the request. If you know how to handle HTTP <a href="http://en.wikipedia.org/wiki/Digest_access_authentication" target="_blank">Digest Authentication</a>, that is the preferred method of authentication.</p>
<p>Otherwise you should attach the following to the end of the resource URI:</p>
<pre>?username=myAPIusername&amp;password=myAPIpassword</pre>
<p>Or, in the case of a POST request, such as for sending an SMS, include the username/password parameters in the POST parameters (e.g. see <a title="sms post" href="#sms_resource">sms post</a>).</p>
<p>In our example, the complete URI that results is:</p>
<pre>https://www.textmarketer.biz/services/rest/credits?username=myAPIusername&amp;password=myAPIpassword</pre>
<p>And this should return XML containing the number of credits available on your account.</p>
<p><strong>The HTTP Response Headers</strong></p>
<p>The only vital part of the response headers that you need is the status code. <em>200</em> means a successful request, all other codes returned will be errors.</p>
<p>If you get an error, the status message may give you some extra information about the error. For more details about the error codes and their meanings, see <a title="Error Codes" href="#error_codes" target="_self">Error Codes</a> below.</p>
<p><strong>The XML response</strong></p>
<p>The structure of the XML response is generally quite simple. The response to our <em>credits</em> request example would look like this:</p>
<pre id="line1">&lt;<span class="start-tag">response</span><span class="attribute-name"> processed_date</span>=<span class="attribute-value">"2010-03-19T14:08:40+00:00"</span>&gt;
&lt;<span class="start-tag">credits</span>&gt;37&lt;/<span class="end-tag">credits</span>&gt;
&lt;/<span class="end-tag">response</span>&gt;</pre>
<p>Your preferred programming language will have a method for parsing the XML response to obtain the value.</p>
<p><strong>Example PHP code</strong></p>
<pre>&lt;?php
/**
 * GET request on the 'credits' resource
 */
$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);
}

?&gt;</pre>
<p>See the <a title="REST SMS API Examples" href="http://www.textmarketer.co.uk/blog/2010/03/campaign-articles/dev/rest-sms-api-code-examples/" target="_self">REST API Code Examples</a> for some more example code that you can use.</p>
<p>That&#8217;s the end of the Quick Start. You know to send the request, check the status code is <em>200</em>, and then parse the XML according to its declared structure.</p>
<p style="color: white;">Error codes</p>
<p><strong>ERROR CODES</strong></p>
<p>The HTTP status codes returned by our REST SMS API follow normal HTTP conventions. An example of the HTTP response headers from a request to our REST API:</p>
<pre>Date: Wed, 24 Mar 2010 14:45:54 GMT
Server: Apache/2.2.3 (Red Hat)
X-Powered-By: PHP/5.2.11 ZendServer/4.0
Content-Length: 317
Connection: close
Content-Type: application/xml

404 Not Found :  (ERR101)</pre>
<p>You see the status code, 404 on the last line. Their meaning of the status codes in the context of our REST SMS API are as follows:</p>
<table border="0">
<tbody>
<tr>
<td><strong>Code</strong></td>
<td><strong>Meaning</strong></td>
</tr>
<tr>
<td>200</td>
<td>OK. We were able to successfully execute the requested operation.</td>
</tr>
<tr>
<td>400</td>
<td>Bad request. There was a problem with your request data, see the status message for details.</td>
</tr>
<tr>
<td>403</td>
<td>You do not have sufficient rights to access the specified resource.</td>
</tr>
<tr>
<td>404</td>
<td>The resource specified could not be found.</td>
</tr>
<tr>
<td>405</td>
<td>The specified method (get, post, put or delete) is not allowed for this resource.</td>
</tr>
<tr>
<td>500</td>
<td>An unexpected error occurred.</td>
</tr>
<tr>
<td>501</td>
<td>The method requested has not been implemented.</td>
</tr>
<tr>
<td>503</td>
<td>Service Unavailable. The Web Service is not currently available to serve your request.</td>
</tr>
</tbody>
</table>
<p>This list is not exhaustive, any code from the <a title="HTTP status  codes" href="http://en.wikipedia.org/wiki/List_of_HTTP_status_codes" target="_blank">complete list of HTTP status codes</a> may be returned.</p>
<p>IMPORTANT NOTE: Error 503 may be returned if you exceed a certain number of requests per minute. You will see an error message similar to: &#8220;Your 201 requests exceed the maximum allowed of 100 requests within 15 minute(s). Please try again later&#8221;. This to reduce load on our servers, in order to guarantee a good service to all our users.  <em>There is no restriction on SMS sends.</em></p>
<p>USEFUL NOTE: the HTTP status message may contain more specific information. If you encounter an unexpected error, the &#8216;(ERRnn)&#8217; found in the status message is useful in any reports you send us.</p>
<p>In addition to the status codes, an error will also produce an XML response containing details of the error. In this example the XML response might look like this:</p>
<pre>&lt;<span class="start-tag">response</span><span class="attribute-name"> processed_date</span>=<span class="attribute-value">"2010-03-24T14:45:54+00:00"</span>&gt;
&lt;<span class="start-tag">errors</span>&gt;
	&lt;<span class="start-tag">error</span><span class="attribute-name"> code</span>=<span class="attribute-value">"404"</span>&gt;Not Found :  (ERR101)&lt;/<span class="end-tag">error</span>&gt;
&lt;/<span class="end-tag">errors</span>&gt;
&lt;/<span class="end-tag">response</span>&gt;</pre>
<p>Some resources, such as <a title="sms resource" href="#sms_resource">http://www.textmarketer.biz/services/rest/sms</a>, have additional error codes specific to the resource. These are documented along with the description of the resource.</p>
<p style="color: white;">Resource Identifier</p>
<p><strong>THE RESOURCE IDENTIFIER</strong></p>
<p>The example of a resource identifier used previously was:</p>
<p><span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; line-height: 18px; font-size: 12px; white-space: pre;">https://www.textmarketer.biz/services/rest/credits</span></p>
<p>All our REST SMS Web Service resource identifiers take the general form:</p>
<pre>PROTOCOL://RESOURCE_NAMESPACE/RESOURCE_NAME[/RESOURCE_ID]</pre>
<p>where</p>
<pre>PROTOCOL = http|https
RESOURCE_NAMESPACE = www.textmarketer.biz/services/rest
RESOURCE_NAME = credits|deliveryReports|deliveryReport|sms|keywords|etc</pre>
<pre>RESOURCE_ID = an_ID (optional) which specifies a particular resource element, e.g. a specific delivery report</pre>
<p>e.g.</p>
<pre>https://www.textmarketer.biz/services/rest/deliveryReport/GatewayAPI_09-02-10</pre>
<p>will access a delivery report named &#8216;<em>GatewayAPI_09-02-10</em>&#8216;.</p>
<p style="color: white;">Resources</p>
<p><strong>RESOURCES</strong></p>
<p>The currently implemented resources are:</p>
<ol>
<li><a href="#credits_resource">credits</a></li>
<li><a title="deliveryReports resource" href="#deliveryReports_resource">deliveryReports</a></li>
<li><a title="deliveryReport resource" href="#deliveryReport_resource">deliveryReport</a></li>
<li><a title="sms resource" href="#sms_resource">sms</a></li>
<li><a title="keywords resource" href="#keywords_resource">keywords</a></li>
<li><a title="group resource" href="#group_resource">group</a></li>
<li><a title="groups resource" href="#groups_resource">groups</a></li>
</ol>
<p><em><strong>1. credits</strong></em></p>
<pre>http://www.textmarketer.biz/services/rest/credits</pre>
<ul>
<li>GET method -<em> </em>get the number of credits currently available on your account</li>
<li><em><span style="font-style: normal;">POST method</span> </em>- transfer credits between accounts</li>
</ul>
<p>See the <a title="credits resource" href="/blog/2010/06/sms-gateway/rest-sms-gateway-api-credits-resource/" target="_self">full description</a> of this resource for details.</p>
<p><em><strong>2. deliveryReports</strong></em></p>
<pre>http://www.textmarketer.biz/services/rest/deliveryReports</pre>
<ul>
<li>GET method - Gets a list of available delivery report names</li>
</ul>
<p>See the <a title="deliveryReports resource" href="/blog/2010/06/business-sms/rest-sms-gateway-api-deliveryreports-resource/" target="_self">full description</a> of this resource for details.</p>
<p><em><strong>3. deliveryReport</strong></em></p>
<pre>http://www.textmarketer.biz/services/rest/deliveryReport/test-190310</pre>
<ul>
<li>GET method - Gets the contents of a delivery report &#8211; the delivery status of sent messages for a given day/campaign.</li>
</ul>
<p>See the <a title="deliveryReport resource" href="/blog/2010/06/sms-gateway/rest-sms-gateway-api-deliveryreport-resource/" target="_self">full description</a> of this resource for details.</p>
<p>NOTE: An individual delivery report that is accessed using this resource shows the current known status of all messages sent on a given day, or for a particular campaign. The REST API resource <em><a title="deliveryReports resource" href="#deliveryReports_resource" target="_self">deliveryReport</a><strong><a title="deliveryReports resource" href="#deliveryReports_resource" target="_self">s</a> </strong></em>(note the trailing s) gets a list of available delivery report names, including delivery reports for campaigns (see <a title="deliveryReports resource" href="#deliveryReports_resource" target="_self">above</a>).</p>
<p><em><strong>4. sms</strong></em></p>
<pre>http://www.textmarketer.biz/services/rest/sms</pre>
<ul>
<li><strong><em>POST method</em></strong> - Used to send an SMS message.</li>
</ul>
<p>See the <a title="sms resource" href="/blog/2010/06/sms-gateway/rest-sms-gateway-api-sms-resource/" target="_self">full description</a> of this resource for details.</p>
<p><em><strong>5. keywords </strong></em></p>
<pre>http://www.textmarketer.biz/services/rest/keywords/mykeyword</pre>
<ul>
<li><strong><em>GET method</em></strong><strong> </strong>- get the availability of a given keyword (see <a href="http://www.textmarketer.co.uk/shortcode_sms.htm" target="_blank">Short Code SMS Service</a>)</li>
</ul>
<p>See the <a title="keywords resource" href="/blog/2010/06/sms-gateway/rest-sms-gateway-api-keywords-resource/" target="_self">full description</a> of this resource for details.</p>
<p><em><strong>6. group</strong></em></p>
<pre>http://www.textmarketer.biz/services/rest/group</pre>
<ul>
<li><strong><em>POST method</em></strong><strong> </strong>- add number(s) to a send group</li>
</ul>
<p>See the <a title="group resource" href="/blog/2011/04/sms-gateway/rest-sms-gateway-api-group-resource/">full description</a> of this resource for details.</p>
<p><em><strong>7. groups</strong></em></p>
<pre>http://www.textmarketer.biz/services/rest/groups</pre>
<ul>
<li><strong><em>GET method</em></strong><strong> </strong>- list the available send groups</li>
</ul>
<p>See the <a href="http://www.textmarketer.co.uk/blog/2011/04/sms-gateway/rest-sms-gateway-api-group-resource/">full description</a> of this resource for details.</p>
<p style="color: white;">Sandbox</p>
<p><strong>TESTING/SANDBOX</strong></p>
<p>A sandbox service is available to allow you to test your integration code without using any credits or executing any function that would modify the data in your account. The service is available at</p>
<p><a title="Sandbox" href="http://sandbox.textmarketer.biz/services/rest">http://sandbox.textmarketer.biz/services/rest</a></p>
<p>i.e. only the hostname changes from <em>www.textmarketer.biz</em> to <em>sandbox.textmarketer.biz</em> within the resource URI.</p>
<p>The sandbox will do the same validation of your request as the live REST API and return the appropriate errors, but will not perform any action that modifies your account data or your credits. Nor will it actually send any SMS messages, so no delivery report will be generated.</p>
<p>NOTE: Accesses to the sandbox is limited to a certain number of requests per minute &#8211; to reduce load on our servers &#8211; in order to guarantee a good service to all our users. Therefore you may prefer to use the Sandbox only to check that individual requests work correctly, rather than testing bulk SMS sends. There is no restriction on SMS sends on the live system.</p>
<img src="http://www.textmarketer.co.uk/wordpress/?ak_action=api_record_view&id=1134&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.textmarketer.co.uk/blog/2010/03/business-sms/rest-sms-api-specification-document/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>

