Edit an existing keyword.


Parameter

Description

Required

 keywordThe first word of a text messageYES
 numberThe dedicated virtual number that the keyword belongs toYES
 referenceYour own reference (up to 100 characters)NO
 statusOpen, will set the Keyword to being active. Closed, will close the Keyword.NO
 list_id
ID of a list to add respondents to, list ID's can be found in the title of a list or in the list page URL
NO
 welcome_messageSMS message to send to new membersNO
 members_messageSMS message to existing membersNO
 activateWhether to make the keyword active immediately.

Possible values:
true - activate immediately (default)
false - create the keyword but do not activate
NO
 forward_urlForward messages to a URLNO
 forward_emailForward messages to a set of email addressesNO
 forward_smsForward messages to a set of msisdnsNO


Example

curl https://api.transmitsms.com/edit-keyword.json \
  -u 2e24c1cbdd987221e165d543f34b84bf:secret \
  -d 'keyword=NEWS' \
  -d 'reference=Gym news' \
  -d 'number=61491570156' \
  -d 'status=active' \
  -d list_id=0 \
  -d "welcome_message=Welcome to Mike's gym news" \
  -d 'members_message=Thanks for your continued support' \
  -d 'forward_url=http://example.com/gym-promo' \
  -d 'forward_email=news@http://example.com,mike@http://example.com' \
  -d 'forward_sms=61491570157,61491570158'


JSON Response

{
  keyword: "NEWS",
  reference: "Gym news",
  number: "61491570156",
  status: "active",
  list_id: 0,
  welcome_message: "Welcome to Mike's gym news",
  members_message: "Thanks for your continued support",
  forward_url: "http://example.com/gym-promo",
  forward_email: "news@example.com,mike@example.com",
  forward_sms: "61491570157,61491570158"
}

XML Response

<?xmlversion="1.0"encoding="UTF-8"?>
<response>
  <keyword>NEWS</keyword>
  <reference>Gym news</reference>
  <number>61491570156</number>
  <status>active</status>
  <list_id>0</list_id>
  <welcome_message>Welcome to Mike&amp;#39;s gym news</welcome_message>
  <members_message>Thanks for your continued support</members_message>
  <forward_url>http://example.com/gym-promo</forward_url>
  <forward_email>news@example.com,mike@example.com</forward_email>
  <forward_sms>61491570157,61491570158</forward_sms>
</response>


PHP Examples

<?php
 include '../../APIClient2.php';
 $ap i= new transmitsmsAPI('API_KEY','API_SECRET');
 
 //pause a keyword
 //$result = $api->editKeyword('KEYWORD', '6140000000', null, null, null, null, 'paused');
 
 //change welcome message
 $result = $api->editKeyword('KEYWORD','6140000000', null, null, 'new welcome message');
 
 if ($result->error->code == 'SUCCESS') {
   echo 'Keyword saved';

 }  else {
   echo 'Error: {$result->error->description}';
 }