We created a new viewing experience for our SMS API documentation. It's now all in one central location. Click here to check it out!

This method retrieves transactions for your account.


Parameters:


  • offset - integer - used to specify where to start reading from in the data set - 0 being the first item.
  • limit - integer - used to specify maximum number of records to return. 0 disables any limit but should only be used for small data sets.
  • dateStart - integer - used to specify the starting date range - expected in Y-m-d H:i:s format (e.g 2009-12-15 17:15:00), if null is passed the date will default to 1 month ago.
  • dateEnd - integer - used to specify the ending date range - expected in Y-m-d H:i:s format (e.g 2009-12-15 17:15:00), if null is passed the date will default to today.


 




 




XML Request Example


<?xml version='1.0'?>

<request>

	<interface>PHP</interface>

	<version>0.3</version>

	<key>API_KEY</key>

	<secret>API_SECRET</secret>

	<method>transactions.get</method>

	<params>

		<offset>0</offset>

		<limit>0</limit>

		<dateStart />

		<dateEnd />

	</params>

</request>







XML Response Example


<?xml version='1.0'?>

<xml>

	<method>transactions.get</method>

	<total>3</total>

	<time>2009-12-21 23:11:39 GMT</time>

	<timestamp>1261437099 GMT</timestamp>

	<information>The dataset is limited between 2009-11-21 00:00:00 and 2009-12-21 23:11:39 - all dates are in GMT</information>	

	<dataset>

		<data>

			<id>1797</id>

			<description>Single SMS</description>

			<amount>-0.08</amount>

			<balance_standing>$14.41</balance_standing>

			<datetime_entry>2009-12-21 23:10:37</datetime_entry>

		</data>

		<data>

			<id>1795</id>

			<description>Message Send</description>

			<amount>-0.08</amount>

			<balance_standing>$14.49</balance_standing>

			<datetime_entry>2009-12-21 22:58:48</datetime_entry>

			<message_id>28153</message_id>

			<message_status>Sent</message_status>

			<message_cost>0.08</message_cost>

		</data>

		<data>

			<id>1793</id>

			<description>TAX_REMOVED</description>

			<amount>-1.00</amount>

			<balance_standing>$14.57</balance_standing>

			<datetime_entry>2009-12-21 22:52:59</datetime_entry>

		</data>

	</dataset>

</xml>







PHP Example


Download the PHP API Client


<?php



// change api key and secret to your own

$myAPIKey = "API_KEY";

$myAPISecret = "API_SECRET";



// include base class

require('APIclient.php');



// create new client object

$transmitsmsAPI = new transmitsmsAPI($myAPIKey, $myAPISecret);



// set parameters

$offset = 0;

$limit = 0;

$dateStart = null;

$dateEnd = null;



// execute request

$methodResponse = $transmitsmsAPI->getTransactions($offset, $limit, $dateStart, $dateEnd);



// parse response into xml object

$xml = @simplexml_load_string($methodResponse);



foreach ($xml->dataset->data as $transaction) {

	echo $transaction->description . ' ' . $transaction->amount . '<br />';

}



?>






GET Example


Using a URL based request system you can request this method by using the below URL - be sure to url encode all your variables!


http://burst.transmitsms.com/api-wrapper/transactions.get?apikey=API_KEY&apisecret=API_SECRET&offset=0&limit=10&dateStart=2010-01-01%2000:00:00&dateEnd=2010-01-31%2000:00:00