SIGN IN

Developers

Free Trial

transactions.get-users


XML Request Example   XML Response Example   PHP Example   GET Example  

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

This method retrieves transactions for a specific client.

Parameters:
  • user_id - integer - the client system id - can be retrieved using the 'clients.get' method
  • 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-users</method>
	<params>
		<user_id>1</user_id>
		<offset>0</offset>
		<limit>0</limit>
		<dateStart />
		<dateEnd />
	</params>
</request>




XML Response Example

<?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 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
$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 />';
}

?>




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://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