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 to edit existing keyword


please note you can't change the keyword itself


please use keywords.status to change status


Parameters:


  • id - integer - keyword ID
  • name - string - name (reference) for the keyword
  • list_id - integer - list to add incoming recipients. REQUIRED for reply_message_dupe
  • reply_message - string - automatic response SMS for new incoming recipients.
  • reply_message_dupe - string - automatic response SMS for incoming recipients which are already in the list.
  • pass_to_url - string - callback URL for responses.
  • pass_to_email - string - list of emails to forward response to. please use comma to separate multiple values.
  • pass_to_sms - string - list of numbers to forward response as SMS. please use comma to separate multiple values. please use numbers in international format.


Expected response:


  • EDITED - keyword change was saved
  • NO_ACCESS - you don't have access to this keyword
  • EMAIL_INVALID - you provided an invalid email
  • NUMBER_INVALID - you provided an invalid number
  • NUMBER_LOCAL - you provided a number in local format


 




 




XML Request Example


<?xml version='1.0'?>

<request>

	<version>0.4</version>

	<key>API_KEY</key>

	<secret>API_SECRET</secret>

	<method>keywords.edit</method>

	<params>

		<id>148</id>

		<name>my keyword edited</name>

	</params>

</request>	







XML Response Example


<?xml version='1.0'?>

<xml>

	<method>keywords.edit</method>

	<total>1</total>

	<time>2012-11-21 16:56:45 GMT</time>

	<timestamp>1353517005 GMT</timestamp>

	<data>

		<status>EDITED</status>

		<id>148</id>

	</data>

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

$name='my keyword name';



// execute request

$methodResponse = $transmitsmsAPI->editKeyword($id, array('name'=>$name));



// 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 was not edited: " . (string) $xml->error;

}

else {

	echo "Keyword has been edited";	

}



?>






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.edit?apikey=API_KEY&apisecret=API_SECRET&id=KEYWORD_ID&name=MY_KEYWORD