This method retrieves responses for a keyword.


Parameters



  • id - integer - keyword ID

  • offset - integer - where to begin reading the dataset from

  • limit - integer - the number of responses to return


 




 




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.responses</method>
<params>
<id>1</id>
<offset>0</offset>
<limit>1000</limit>
</params>
</request>







XML Response Example


<?xml version='1.0'?>

<xml>
<method>keywords.responses</method>
<total>6</total>
<time>2012-08-28 13:55:14 GMT</time>
<timestamp>1346162114 GMT</timestamp>
<dataset>
<data>
<firstname></firstname>
<lastname></lastname>
<mobile>6141111111</mobile>
<response>test</response>
<datetime_entry_orig>2012-08-21 11:51:46</datetime_entry_orig>
<datetime_entry_local>2012-08-21 14:51:46</datetime_entry_local>
</data>
<data>
<firstname></firstname>
<lastname></lastname>
<mobile>6141111111</mobile>
<response>test</response>
<datetime_entry_orig>2012-08-21 11:49:30</datetime_entry_orig>
<datetime_entry_local>2012-08-21 14:49:30</datetime_entry_local>
</data>
<data>
<firstname></firstname>
<lastname></lastname>
<mobile>6141111111</mobile>
<response>test</response>
<datetime_entry_orig>2012-08-21 11:47:51</datetime_entry_orig>
<datetime_entry_local>2012-08-21 14:47:51</datetime_entry_local>
</data>
<data>
<firstname></firstname>
<lastname></lastname>
<mobile>6141111111</mobile>
<response>test</response>
<datetime_entry_orig>2012-08-21 11:45:29</datetime_entry_orig>
<datetime_entry_local>2012-08-21 14:45:29</datetime_entry_local>
</data>
<data>
<firstname></firstname>
<lastname></lastname>
<mobile>6141111111</mobile>
<response>test</response>
<datetime_entry_orig>2012-08-21 11:34:39</datetime_entry_orig>
<datetime_entry_local>2012-08-21 14:34:39</datetime_entry_local>
</data>
<data>
<firstname></firstname>
<lastname></lastname>
<mobile>6141111111</mobile>
<response>test</response>
<datetime_entry_orig>2012-08-21 11:30:31</datetime_entry_orig>
<datetime_entry_local>2012-08-21 14:30:31</datetime_entry_local>
</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
$id=1;
$offset = 0;
$limit = 4;


// execute request
$methodResponse = $transmitsmsAPI->getKeywordResponses($id, $offset, $limit);

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

echo 'There are ' . $xml->total . ' responses<hr />';
foreach ($xml->dataset->data as $keyword) {
echo 'Response from ' . (string) $keyword->mobile . ' is ' . (string) $keyword->response . '<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.responses?apikey=API_KEY&apisecret=API_SECRET&id=1&offset=0&limit=10