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 returns a list of your active keywords.


Parameters:


  • offset - integer - used to specify where to start reading from in the data set - 0 being the first item.
  • limit - integer - used to specify maximum number of records to return. 0 disables any limit but should only be used for small data sets.
  • number - integer - limits keywords to the defined number


 




 




XML Request Example


<?xml version='1.0'?>

<request>

	<interface>PHP</interface>

	<version>0.4</version>

	<key>API_KEY</key>

	<secret>API_SECRET</secret>

	<method>keywords.get</method>

	<params>

		<offset>0</offset>

		<limit>4</limit>

		<number/>

	</params>

</request>







XML Response Example


<?xml version='1.0'?>

<xml>

	<method>messages.get</method>

	<total>67</total>

	<time>2009-12-21 23:08:45 GMT</time>

	<timestamp>1261436925 GMT</timestamp>

	<dataset>

		<data>

			<id>1</id>

			<message_id>11111</message_id>

			<name>kw1</name>

			<status>open</status>

			<datetime_entry>2012-08-13 16:39:14</datetime_entry>

			<longcode>61411111111</longcode>

			<keyword>kw1</keyword>

		</data>

		<data>

			<id>2</id>

			<message_id>22222</message_id>

			<name>kw2</name>

			<status>open</status>

			<datetime_entry>2012-08-06 15:58:34</datetime_entry>

			<longcode>61411111111</longcode>

			<keyword>kw2</keyword>

		</data>

		<data>

			<id>3</id>

			<message_id>33333</message_id>

			<name>kw3</name>

			<status>open</status>

			<datetime_entry>2012-04-10 15:31:40</datetime_entry>

			<longcode>61411111111</longcode>

			<keyword>kw3</keyword>

		</data>

		<data>

			<id>4</id>

			<message_id>44444</message_id>

			<name/>

			<status>open</status>

			<datetime_entry>2012-08-17 15:20:30</datetime_entry>

			<longcode>61411111111</longcode>

			<keyword>KW4</keyword>

			</data>

		</dataset>

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

$offset = 0;

$limit = 4;



// execute request

$methodResponse = $transmitsmsAPI->getKeywords($offset, $limit);



// parse response into xml object

$xml = @simplexml_load_string($methodResponse);



echo 'There are ' . $xml->total . ' keywords<hr />';

foreach ($xml->dataset->data as $keyword) {

	echo 'Keyword ' . (string) $keyword->id . ' is ' . (string) $keyword->status . '<br />';

}



?>






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/keywords.get?apikey=API_KEY&apisecret=API_SECRET&offset=0&limit=10