Message-ID: <143124422.15839.1614958389425.JavaMail.confluence@wiki> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_15838_1301416735.1614958389425" ------=_Part_15838_1301416735.1614958389425 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html createSubAccount - Java

createSubAccount - Java

=20
=20
=20
=20

 

=20
=20
=20
=20
=20
=20

Create a new account, linked to your main account (requires additional p= ermissions on your account, please contact Text Marketer to apply).

=20
=20
=20
=20
=20
=20
Example
=20
Hashtable<String, String> account;
account =3D tmClient.createSubAccount("My Client", "44700000=
0000",=20
"notifications@myclient.com", "newusername", "newp=
assword", "PROMOCODE", true);
System.out.println("Account ID: " + account.get("account_id&=
quot;));
=20
=20
=20
=20
=20
=20
=20

Arguments:

=20
=20
=20
=20

 

=20
=20
=20
=20
=20
=20

String companyName: 

=20
=20
=20
=20

the company name for the new account. Between 3 and 40 characters, inclu= sive. No special restrictions.

=20
=20
=20
=20
=20
=20

String notificationMobile:

=20
=20
=20
=20

(optional*) a mobile number to which notifications and alerts are sent. = Must be a valid UK mobile number. *Required if notificationEmail is not set.

=20
=20
=20
=20
=20
=20

String notificationEmail:

=20
=20
=20
=20

(optional*) an email address to which notifications and alerts are sent.= *Required if notificationMobile is not set.

=20
=20
=20
=20
=20
=20

String username:

=20
=20
=20
=20

(optional) the username you wish to set on the new account - the API use= rname will be the same. Between 5 and 20 characters, inclusive. Alpha-numer= ic (no accented letters), '-' and '_' characters allowed. If this is not se= t, one will be set for you.

=20
=20
=20
=20
=20
=20

String password: 

=20
=20
=20
=20

(optional) the password you wish to set on the new account - the API pas= sword will be the same. Between 5 and 20 characters, inclusive. Alpha-numer= ic (no accented letters), '-' and '_' characters allowed. If this is not se= t, one will be set for you.

=20
=20
=20
=20
=20
=20

String promoCode:

=20
=20
=20
=20

(optional) a promotional code entitling the new account to extra credits= .

=20
=20
=20
=20
=20
=20

boolean overrideRates:

=20
=20
=20
=20

if set to true, use the credits rates set on your main account (the acco= unt used to access the API), rather than the Text Marketer defaults.

=20
=20
=20
=20
=20
=20

Returns:

an Hashtable<String, String> with 10 keys: 'api_password', 'api_us= ername', 'company_name', 'create_date', 'credits', 'password' and 'username= ', 'notification_email', 'notification_mobile', 'account_id'

=20
=20
=20
=20
Hashtable key Value
api_password 

String. The new account API password

api_username

String. The new account API username

company_name  String. The new account company name
create_date 

String. The creation date of the account in I= SO 8601 format

credit 

Integer. The number of credits on the new acc= count.

password

String. The new account web interface passwor= d.

username String. The new account web interface username.<= /td>
notification_email 

String. The new account email address used fo= r notifications.

notification_mobile

String. The new account UK mobile number used= for notifications.

account_id 

String. The ID of the account used for identi= fication in other functions.

=20
=20
=20
=20
=20
=20

Specific error codes:

=20
=20
=20
=20
Code Meaning
0 Either the email address or mobile number must b= e supplied.
1 The company name must be supplied.
2 The email address you specified is invalid.
3

The mobile number you specified is not a vali= d UK mobile number.

4

A value you tried to set is either too long o= r too short. See specific error text.

5 A value you tried to set does not match the requ= ired pattern. See specific error text.
6 A parameter was missing (see specific error text= ).
7 The username you specified is already in use. Pl= ease choose another.
8

You have reached your limit for= the number of accounts you can create. Please contact Text Marketer to inc= rease this.

=20
=20
=20
=20
=20
=20
=20 =20
=20
=20
=20
=20

 

=20
=20
=20
=20

 

=20
=20
=20
------=_Part_15838_1301416735.1614958389425--