Message-ID: <1818565608.15691.1614957625651.JavaMail.confluence@wiki> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_15690_602608926.1614957625651" ------=_Part_15690_602608926.1614957625651 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html account PUT method

account PUT method

=20
=20
=20
=20

 

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

Create a sub-account.

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

http://api.textm= arketer.co.uk/services/rest/account/sub

=20

Creating a sub-account will attach the new account to the one used to ac= cess the API, which becomes the master account.

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

The ability to create accounts is disabled by default. To enable this, p= lease contact Text Marketer.

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

PUT arguments

=20
=20
=20
=20

 

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

The following parameters can be used in a PUT request URL:

=20
=20
=20
=20
Parameter  Value
username

The username of the accessing/master account,= for authentication. Not required if you use HTTP Basic Authentication inst= ead.

password 

The password of the accessing/master account,= for authentication. Not required if you use HTTP Basic Authentication inst= ead.

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

Request body parameters:

Under the REST methodology, data are sent in the request body.

=20
=20
=20
=20
Parameter

Value

account_password

Optional. Set an account password (for access= to the web UI). Between 5 and 20 characters, inclusive. Alpha numeric (no = accented letters), '-' and '_' characters allowed. If you don't supply one,= a random password will be used.

account_username

Optional. Set an account username (for access= to the web UI). Between 5 and 20 characters, inclusive. Alpha numeric (no = accented letters), '-' and '_' characters allowed. If you don't supply one,= a random password will be used.

company_name

Set a new company name for the account. Betwe= en 3 and 40 characters, inclusive. No special restrictions.

notification_email 

Optional (required if notification_mobile is = not set). Sets the email address to which notifications and alerts are sent= . Must be a valid email address.

notification_mobile

Optional (required if notification_email is n= ot set). Sets the mobile number to which notifications and alerts are sent.= Must be a valid UK mobile number.

override_pricing

If set to 'true', use the credits rates set o= n your main account (the account used to access the API), rather than the T= ext Marketer defaults.

promo_code  Use a promotional code to put extra credits on t= he account.
=20 =20

although you cannot set the API username/password here (they are set to = the same values as the account username/password you specify), you can modi= fy them afterwards using the POST method.

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

Specific errors:

=20
=20
=20
=20
Code Meaning
0

Either the email address or mobile number mus= t be 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 t= ext).

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 Mark= eter to increase this.

=20 =20

that a 404 status code is returned if the account ID specified does not = exist, and 403 if you do not have permission to access the account you spec= ified.

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

Example successful response body XML:

=20
=20
=20
=20
=20
<?xml version=3D"1.0" encoding=3D"ISO-8859-1"?&=
gt;
<!DOCTYPE response PUBLIC
"-//textmarketer.co.uk//DTD Web Services REST 1.6//EN"
"http://api.textmarketer.co.uk/services/rest/DTD/groups_get.dtd"&=
gt;
<response processed_date=3D"2012-04-11T11:23:14+02:00">
=09<account>
=09=09<account_id>abcdefghijklmnopqrstuvwx</account_id>
=09=09<api_password>my_api_password</api_password>
=09=09<api_username>my_api_username</api_username>
=09=09<company_name>Bill's Bakery</company_name>
=09=09<create_date>20012-02-12T01:00:00+02:00</create_date>
=09=09<credits>833</credits>
=09=09<notification_email>bill@billsbakery.com</notification_email=
>
=09=09<notification_mobile>447777777777</notification_mobile>
=09=09<password>my_UI_password</password>
=09=09<username>my_UI_username</username>
=09</account>
</response>
=20
=20
=20
=20
=20
=20
=20

DTD:

=20
=20
=20
=20
=20
<?xml version=3D"1.0" encoding=3D"UTF-8"?>
<!--
 PUBLIC ID : -//textmarketer.co.uk//DTD Web Services REST 1.6//EN
 SYSTEM ID : http://api.textmarketer.co.uk/services/rest/DTD/groups_get.dtd
-->
<!ELEMENT response (account)>
<!ATTLIST response
 processed_date CDATA #REQUIRED
>
<!ELEMENT account (account_id, api_password, api_username, company_name?=
,=20
create_date, credits, notification_email?, notification_mobile?, password,=
=20
username)>
<!ELEMENT account_id (#PCDATA)>
<!ELEMENT api_password (#PCDATA)>
<!ELEMENT api_username (#PCDATA)>
<!ELEMENT company_name (#PCDATA)>
<!ELEMENT create_date (#PCDATA)>
<!ELEMENT credits (#PCDATA)>
<!ELEMENT notification_email (#PCDATA)>
<!ELEMENT notification_mobile (#PCDATA)>
<!ELEMENT password (#PCDATA)>
<!ELEMENT username (#PCDATA)>
=20
=20
=20
=20 =20
------=_Part_15690_602608926.1614957625651--