This method retrieves transactions for your account.
Parameters:<?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 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
// 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 />';
}
?>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://burstsms.com.au/api-wrapper/transactions.get?apikey=API_KEY&apisecret=API_SECRET&offset=0&limit=10&dateStart=2010-01-01&dateEnd=2010-01-31