<?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; support</title>
	<atom:link href="http://www.textmarketer.co.uk/blog/tag/support/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 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 get help with your text system</title>
		<link>http://www.textmarketer.co.uk/blog/2009/05/campaign-articles/how-to-get-help-with-your-campaign-system/</link>
		<comments>http://www.textmarketer.co.uk/blog/2009/05/campaign-articles/how-to-get-help-with-your-campaign-system/#comments</comments>
		<pubDate>Mon, 18 May 2009 10:08:36 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[All Bulk SMS Account Documentation]]></category>
		<category><![CDATA[Campaign Articles]]></category>
		<category><![CDATA[help]]></category>
		<category><![CDATA[support]]></category>

		<guid isPermaLink="false">http://87.106.109.73/blog/?p=51</guid>
		<description><![CDATA[We&#8217;ve produced a few helpful videos that can help guide you through the main aspects of your Text Marketer SMS System. Try these first but if that doesn&#8217;t cover what your looking for you can also try our FAQ&#8217;s area for more help.]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve produced a few <a href="http://www.textmarketer.co.uk/instructions.htm">helpful videos</a> that can help guide you through the main aspects of your Text Marketer SMS System. Try these first but if that doesn&#8217;t cover what your looking for you can also try our <a href="http://www.textmarketer.co.uk/help/">FAQ&#8217;s area</a> for more help.</p>
<img src="http://www.textmarketer.co.uk/wordpress/?ak_action=api_record_view&id=51&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.textmarketer.co.uk/blog/2009/05/campaign-articles/how-to-get-help-with-your-campaign-system/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

