This method is used to get a list of your numbers (owned or shared).


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>numbers.get</method>
<params>
</params>
</request>







XML Response Example


<xml>

<method>numbers.get</method>
<total>3</total>
<time>2012-11-08 15:35:23 GMT</time>
<timestamp>1352388923 GMT</timestamp>
<dataset>
<data>
<longcode>6140000000</longcode>
<date_next_charge>2012-09-13</date_next_charge>
<renew>yes</renew>
<status>expired</status>
</data>
<data>
<longcode>6140000001</longcode>
<date_next_charge>2012-12-01</date_next_charge>
<renew>yes</renew>
<status>active</status>
</data>
<data>
<longcode>6140000002</longcode>
<date_next_charge>2012-11-19</date_next_charge>
<renew>yes</renew>
<status>active</status>
</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);

// execute request
$methodResponse = $transmitsmsAPI->getNumbers();

// parse response into xml object
$xml = @simplexml_load_string($methodResponse);

echo 'There are ' . $xml->total . ' numbers<hr />';
foreach ($xml->dataset->data as $number) {
echo 'Number ' . (string) $number->longcode . ' is ' . (string) $number->status . ' and will expire '.$number->date_next_charge;
}

?>






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