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 used to get your balance (in currency or credits).


Parameters:


This method doesn't require any parameters


 




 




XML Request Example


<?xml version='1.0'?>

<request>

	<interface>PHP</interface>

	<version>0.4</version>

	<key>API_KEY</key>

	<secret>API_SECRET</secret>

	<method>profile.get-balance</method>

	<params>

	</params>

</request>







XML Response Example


<xml>

<method>profile.get-balance</method>

<total>1</total>

<time>2013-01-17 12:34:26 GMT</time>

<timestamp>1358426066 GMT</timestamp>

<data>

	<balance>15140.256</balance>

	<currency>AUD</currency>

</data>

</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);



// execute request

$methodResponse = $transmitsmsAPI->getBalance();



// parse response into xml object

$xml = @simplexml_load_string($methodResponse);

echo "Your balance is {$xml->data->balance} {$xml->data->currency}";





?>







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/profile.get-balance?apikey=API_KEY&apisecret=API_SECRET