Edit your dedicated virtual number options.


Parameter

Description

Required

numberThe dedicated virtual number.YES
forward_emailForward incoming messages to a set of email addresses.NO
forward_smsForward incoming messages to a set of mobile numbers.NO
forward_urlForward incoming messages to a URL.NO
list_idAdd new numbers that message in to this list.NO
welcome_messageAuto-response for all messages received.NO
members_messageAuto-response if the number is already on the list. (must be adding the number to a list)NO


Example

curl https://api.transmitsms.com/edit-number-options.json \
  -u 2e24c1cbdd987221e165d543f34b84bf:secret \
  -d number='61412345678' \
  -d forward_email='email@yourdomain.com' \
  -d forward_sms='61487654321' \
  -d forward_url='https://yoururl.domain.com' \
  -d list_id='123456' \
  -d welcome_message='You have been added to the list!' \
  -d members_message='You're already on the list!'


JSON Response

{
  "error": {
    "code": "SUCCESS",
    "description": "OK"
  }
}

XML Response

<?xmlversion="1.0"?>
<response>
  <error>
    <code>SUCCESS</code>
    <description>OK</description>
  </error>
</response>


PHP Examples

<?php
 include '../../APIClient2.php';

 $api = new transmitsmsAPI('API_KEY','API_SECRET');
 $api->url = 'https://api.transmitsms.com/edit-number-options';
 $number = '61412345678';
 $forward_email = 'email@yourdomain.com';
 $forward_sms= '61487654321';
 $forward_url = 'https://yoururl.domain.com';
 $list_id = '123456';
 $welcome_message = 'You have been added to the list!';
 $members_message = 'You're already on the list!';

 $result = $api->editNumberOptions($number, $forward_email, $forward_sms, $forward_url, $list_id, $welcome_message, $members_message);
 
 if ($result->error->code == 'SUCCESS') {
   echo var_export($result, true);
 
 } else {
   echo 'Error: ' . $result->error->description;
 }