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 allows you change keyword status


Parameters:


  • id - integer - keyword ID
  • status - string - new status.
    can be:
    • draft
    • open
    • paused
    • closed


Expected response:


  • OK - keyword status was saved
  • NO_ACCESS - you don't have access to this keyword
  • INVALID STATUS - the status you provided doesn't exist


 




 




XML Request Example


<?xml version='1.0'?>

<request>

	<version>0.4</version>

	<key>API_KEY</key>

	<secret>API_SECRET</secret>

	<method>keywords.set-status</method>

	<params>

		<id>148</id>

		<status>closed</status>

	</params>

</request>	







XML Response Example


<?xml version='1.0'?>

<xml>

	<method>keywords.set-status</method>

	<total>1</total>

	<time>2012-11-21 17:02:47 GMT</time>

	<timestamp>1353517367 GMT</timestamp>

	<response>OK</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 some vars

$id=100;

$status='paused';



// execute request

$methodResponse = $transmitsmsAPI->setKeywordStatus($id, status);



// parse response into xml object

$xml = @simplexml_load_string($methodResponse);



// an error has occurred (usually this is because the list name already exists)

if (property_exists($xml, 'error')) {

	echo "Keyword status was not updated: " . (string) $xml->error;

}

else {

	echo "Keyword has been updated";	

}



?>






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.set-status?apikey=API_KEY&apisecret=API_SECRET&keyword=KEYWORD_ID&status=NEW_STATUS