Edit an existing client


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!


Parameter

Description

Required

client_idThe ID of the clientYES
nameClient company name. Must be uniqueNO
contactContact nameNO
emailClient email addressNO
passwordClient passwordNO
msisdnClient phone numberNO
timezoneA valid timezone, Australia/Sydney. Defaults to your ownNO
client_paysSet to true if the client will pay (the default) or false if you will payNO
sms_marginThe number of cents to add to the base SMS price. A decimal value.NO


Example


curl https://api.transmitsms.com/edit-client.json \
  -u 2e24c1cbdd987221e165d543f34b84bf:secret \
  -d client_id=1709 \
  -d name='Joe Brown' \
  -d email='joebrown@example.com'


JSON Response

{
  id: 56423,
  name: "Terry's Repairs",
  contact: "Terry Richards",
  email: "terry@example.com",
  phone: "02 9999 7777",
  currency: "AUD",
  timezone: "Australia/Sydney",
  created: "2013-02-14 13:45:22",
  client_pays: false,
  sms_margin: 3.1,
  apikey: "2e24xxxxxxxxxxxxxxxxxxxxxx4b84bf",
  apisecret: "YyYD2lad*88",
  recharge_amount: 20,
  total_lists: 34,
  total_sms: 575665,
  total_contacts: 542,
  total_spend: 450.464,
  total_revenue: 234.12,
  credits_based: false,
  balance: 43.56
}

XML Response

<?xmlversion="1.0"encoding="UTF-8"?>
<response>
  <id>56423</id>
  <name>Terry&amp;#39;s Repairs</name>
  <contact>Terry Richards</contact>
  <email>terry@example.com</email>
  <phone>02 9999 7777</phone>
  <currency>AUD</currency>
  <timezone>Australia/Sydney</timezone>
  <created>2013-02-14 13:45:22</created>
  <client_pays>false</client_pays>
  <sms_margin>3.1</sms_margin>
  <apikey>2e24xxxxxxxxxxxxxxxxxxxxxx4b84bf</apikey>
  <apisecret>YyYD2lad*88</apisecret>
  <recharge_amount>20</recharge_amount>
  <total_lists>34</total_lists>
  <total_sms>575665</total_sms>
  <total_contacts>542</total_contacts>
  <total_spend>450.464</total_spend>
  <total_revenue>234.12</total_revenue>
  <credits_based>false</credits_based>
  <balance>43.56</balance>
</response>


PHP Example


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

 $api = new transmitsmsAPI('API_KEY', 'API_SECRET');
 $result = $api->editClient(1908,null,'client@email.com');

 if ($result->error->code == 'SUCCESS') {
   echo 'Client saved';

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