This method is a reseller only method and will not work with a standard account


This method retrieves transactions for all your clients in a single call.


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-clients</method>
<params>
<offset>0</offset>
<limit>0</limit>
<dateStart>2008-12-23</dateStart>
<dateEnd>2011-12-23</dateEnd>
</params>
</request>







XML Response Example


<?xml version='1.0'?>

<xml>
<method>transactions.get-clients</method>
<time>2010-01-20 22:47:10 GMT</time>
<timestamp>1264027630 GMT</timestamp>
<dataset>
<user>
<id>813</id>
<name>Client 1</name>
<name_company>Client 1</name_company>
<transactions>
<transaction>
<id>1752</id>
<user_id>821</user_id>
<description>Message Send</description>
<amount>-1.670</amount>
<balance_standing>$8.330</balance_standing>
<datetime_entry>2009-12-17 05:52:27</datetime_entry>
<payment_id>0</payment_id>
<message_id>28134</message_id>
<client_id>0</client_id>
<message_status>Sent</message_status>
<message_cost>1.67</message_cost>
<message_revenue>0.641</message_revenue>
</transaction>
<transaction>
<id>1552</id>
<user_id>813</user_id>
<description>Credit Transfer - $10</description>
<amount>10.000</amount>
<balance_standing>$10.000</balance_standing>
<datetime_entry>2009-12-10 23:47:48</datetime_entry>
<payment_id>594</payment_id>
<client_id>0</client_id>
</transaction>
</transactions>
</user>
<user>
<id>820</id>
<name>Client 2</name>
<name_company>Client 2</name_company>
<transactions>
<transaction>
<id>2276</id>
<user_id>820</user_id>
<description>System Debit</description>
<amount>-36.400</amount>
<balance_standing>$273.690</balance_standing>
<datetime_entry>2010-01-13 01:04:19</datetime_entry>
<payment_id>0</payment_id>
<client_id>0</client_id>
</transaction>
<transaction>
<id>2269</id>
<user_id>820</user_id>
<description>System Credit</description>
<amount>36.400</amount>
<balance_standing>$310.090</balance_standing>
<datetime_entry>2010-01-13 00:42:43</datetime_entry>
<payment_id>0</payment_id>
<client_id>0</client_id>
</transaction>
</transactions>
</user>
</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->getTransactionsForClients($offset, $limit, $dateStart, $dateEnd);

// parse response into xml object
$xml = @simplexml_load_string($methodResponse);

foreach ($xml->dataset->user as $user) {
echo 'Showing transactions for ' . $user->name . '<hr />';
foreach ($user->transactions->transaction as $transaction) {
echo $transaction->description . ' ' . $transaction->amount . '<br />';
}
echo '<hr />';
}

?>






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-clients?apikey=API_KEY&apisecret=API_SECRET&offset=0&limit=10&dateStart=2010-01-01&dateEnd=2010-01-31