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 is a reseller only method and will not work with a standard account


This method is used to return your clients. Use 'clients.get-full' if you require balance data included.


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.


 




 




XML Request Example


<?xml version='1.0'?>

<request>

	<interface>PHP</interface>

	<version>0.3</version>

	<key>API_KEY</key>

	<secret>API_SECRET</secret>

	<method>clients.get</method>

	<params>

		<offset>0</offset>

		<limit>10</limit>

	</params>

</request>







XML Response Example


<?xml version='1.0'?>

<xml>

	<method>clients.get</method>

	<total>1</total>

	<time>2010-01-20 22:45:10 GMT</time>

	<timestamp>1264027510 GMT</timestamp>

	<dataset>

		<data>

			<id>xxx</id>

			<name>Client Name</name>

			<name_company>Client Company Name</name_company>

			<email>client@email.com</email>

			<phone>xxxxxxx</phone>

			<currency>AUD</currency>

			<timezone>Australia/Sydney</timezone>

			<reseller_markup>3.1</reseller_markup>

			<reseller_markup_campaign>0.00</reseller_markup_campaign>

			<apikey>client_api_key</apikey>

			<apisecret>client_api_secret</apisecret>

			<balance_recharge>0</balance_recharge>

		</data>

	</dataset>

</xml>







PHP Example


<?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 = 10;



// execute request

$methodResponse = $transmitsmsAPI->getClients($offset, $limit);



// parse response into xml object

$xml = @simplexml_load_string($methodResponse);



echo 'There are ' . $xml->total . ' clients<hr />';

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

	echo 'Client ' . (string) $client->name . ' has an id of ' . (string) $client->id . '<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/clients.get?apikey=API_KEY&apisecret=API_SECRET&offset=0&limit=10