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 retrieves quantity of SMS sent from this number for a specific period of time. This is an actual SMS quantity, e.g. if you sent a campaign to 2 recipients, and the message length is 200 chars - you will get 4 SMS


Parameters:


  • number - integer - number the messages were sent from.
  • 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.4</version>

	<key>API_KEY</key>

	<secret>API_SECRET</secret>

	<method>number-stats.total-sms</method>

	<params>

		<number>6140000000</limit>

		<dateStart>2009-04-01</dateStart>

		<dateEnd>2009-12-31</dateEnd>

	</params>

</request>







XML Response Example


<xml>

<method>number-stats.total-sms</method>

<time>2012-11-08 15:08:25 GMT</time>

<timestamp>1352387305 GMT</timestamp>

<response>17</response>

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

$number = 614000000000;

$dateStart = null;

$dateEnd = null;



// execute request

$methodResponse = $transmitsmsAPI->getNumberStatsSMS($number, $dateStart, $dateEnd);



// parse response into xml object

$xml = @simplexml_load_string($methodResponse);





	echo $xml->response.' SMS were sent from this number';



?>






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/number-stats.total-sms?apikey=API_KEY&apisecret=API_SECRET&number=6140000000&dateStart=2010-01-01&dateEnd=2010-01-31