This method is a reseller only method and will not work with a standard account
This method retrieves transactions for a specific client.
Parameters:<?xml version='1.0'?> <request> <interface>PHP</interface> <version>0.3</version> <key>API_KEY</key> <secret>API_SECRET</secret> <method>transactions.get-users</method> <params> <user_id>1</user_id> <offset>0</offset> <limit>0</limit> <dateStart /> <dateEnd /> </params> </request>
<?xml version='1.0'?> <xml> <method>transactions.get-users</method> <total>2</total> <time>2010-01-27 04:27:06 GMT</time> <timestamp>1264566426 GMT</timestamp> <information>The dataset is limited between 2009-12-27 00:00:00 and 2010-01-27 04:27:06 - all dates are in GMT</information> <dataset> <data> <id>2423</id> <description>Message Send</description> <amount>-0.173</amount> <balance_standing>$4.114</balance_standing> <datetime_entry>2010-01-21 02:25:54</datetime_entry> <message_id>28391</message_id> <message_status>Sent</message_status> <message_cost>0.173</message_cost> <message_revenue>0.081</message_revenue> </data> <data> <id>2419</id> <description>Message Send</description> <amount>-0.347</amount> <balance_standing>$4.287</balance_standing> <datetime_entry>2010-01-21 01:52:38</datetime_entry> <message_id>28390</message_id> <message_status>Sent</message_status> <message_cost>0.347</message_cost> <message_revenue>0.163</message_revenue> </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
$user_id = 1;
$offset = 0;
$limit = 0;
$dateStart = null;
$dateEnd = null;
// execute request
$methodResponse = $transmitsmsAPI->getTransactionsForUser($user_id, $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/api-wrapper/transactions.get-users?apikey=API_KEY&apisecret=API_SECRET&user_id=USER_ID&offset=0&limit=10&dateStart=2010-01-01&dateEnd=2010-01-31