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 is a reseller only method and will not work with a standard account


This method is used to add a new client to a reseller account.


Parameters:


  • name - string - the name of the client
  • email - string - the email of the client
  • password - string - the password of the client
  • phone - string - recipients mobile number in INTERNATIONAL format.
  • reseller_pays - string - sets whether you will pay for messages or not
    yes: indicates you will pay for this clients messages
          no: client will pay for their own messages
  • reseller_markup - decimal - the markup to be added to each client sms (in cents, up to 3 decimal places) when the client is paying for their own messages.
  • reseller_markup_longcode - decimal - the markup to be added to each client longcode (in dollars, up to 1 decimal place).
  • reseller_keyword_price - decimal - the amount to charge the client for keywords (in dollars, up to 1 decimal place).


 




 




XML Request Example


<?xml version='1.0'?>

<request>

	<version>0.3</version>

	<key>API_KEY</key>

	<secret>API_SECRET</secret>

	<method>clients.add</method>

	<params>

		<name>Client</name>

		<name_company>Client</name_company>

		<email>client@email.com</email>

		<password>password</password>

		<phone>6141xxxxxxx</phone>

		<reseller_pays>no</reseller_pays>

		<reseller_markup>0</reseller_markup>

	</params>

</request>







XML Response Example


<?xml version='1.0'?>

<xml>

	<method>clients.add</method>

	<total>1</total>

	<time>2009-12-14 00:30:07 GMT</time>

	<timestamp>1260750607 GMT</timestamp>

	<data>

		<result>CLIENT ADDED</result>

		<user_id>817</user_id>

		<default_list_id>1221</default_list_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 parameters

$name = 'John Doe';

$email = 'client@email.com';

$password = 'password';

$mobileIntFormat = '614824xxxxxx';



// execute request

$methodResponse = $transmitsmsAPI->addClient($name, $name_company, $email, $password, $mobileIntFormat);



// parse response into xml object

$xml = @simplexml_load_string($methodResponse);



echo ((string) $xml->data->result == 'CLIENT ADDED') ? "Client added" : "Client was not added: " . (string) $xml->data->result;



?>






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/clients.add?apikey=API_KEY&apisecret=API_SECRET&name=CLIENT_NAME&name_company=NAME_COMPANY&email=CLIENT_EMAIL&password=CLIENT_PASSWORD&phone=CLIENT_PHONE&reseller_pays=no&reseller_markup=1.5