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:<?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 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
// 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 />';
}
?>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/clients.get?apikey=API_KEY&apisecret=API_SECRET&offset=0&limit=10