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 messages (campaigns or API calls) sent from this number for a specific period of time.


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

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

<timestamp>1352387305 GMT</timestamp>

<response>14</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->getNumberStatsMessages($number, $dateStart, $dateEnd);



// parse response into xml object

$xml = @simplexml_load_string($methodResponse);





	echo $xml->response.' messages 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-messages?apikey=API_KEY&apisecret=API_SECRET&number=6140000000&dateStart=2010-01-01&dateEnd=2010-01-31