Transfer credits from the source/master account to the target/sub account.

POST arguments

The following POST parameters should be used in a POST request.

You can use either:

ParameterValue
quantity

The number of credits to transfer from the source account to the target account. Must be a positive integer.

target The account number of the account to transfer the credits to.
username 

The username of the source/master account, for authentication. Not required if you use HTTP Basic Authentication instead.

password

The password of the source/master account, for authentication. Not required if you use HTTP Basic Authentication instead.

Your account number can be found in the web interface
https://messagebox.textmarketer.co.uk

On page footer.

OR you can use (diference highlighted in grey/blue):

ParameterValue
quantity 

The number of credits to transfer from the source account to the target account. Must be a positive integer.

target_username

The username of the account to transfer the credits to.

target_password

The password of the account to transfer the credits to.

username 

The username of the source/master account, for authentication. Not required if you use HTTP Basic Authentication instead.

password 

The password of the source/master account, for authentication. Not required if you use HTTP Basic Authentication instead.

Example successful response body XML:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE response PUBLIC
"-//textmarketer.co.uk//DTD Web Services REST 1.6//EN"
"http://api.textmarketer.co.uk/services/rest/DTD/credits_post.dtd">
<response processed_date="2011-04-14T11:16:06+01:00">
<source_credits_before>442</source_credits_before>
<source_credits_after>441</source_credits_after>
<target_credits_before>121</target_credits_before>
<target_credits_after>122</target_credits_after>
</response>

Response meanings:

XML tag/attributeMeaning
source_credits_before 

The number of credits on the source account before the transfer was made.

source_credits_after

The number of credits on the source account after the transfer was made.

target_credits_before

The number of credits on the target account before the transfer was made.

target_credits_after 

The number of credits on the target account after the transfer was made.

Specific errors:

Code 

Meaning

0

There are insufcient credits available to transfer the specified quantity, or the specified quantity is not a positive number

1

The target account number specified is not a valid number or username/password combination does not refer to any known account

Example error response body XML:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE response PUBLIC
"-//textmarketer.co.uk//DTD Web Services REST 1.6//EN"
"http://api.textmarketer.co.uk/services/rest/DTD/errors.dtd">
<response processed_date="2011-04-14T11:33:56+01:00">
<errors>
	<error code="0">Invalid number of credits specified: -1</error>
	<error code="1">Invalid destination account number</error>
</errors>
</response>

DTD for credits POST:

<?xml version="1.0" encoding="UTF-8"?>
<!--
 	PUBLIC ID : -//textmarketer.co.uk//DTD Web Services REST 1.6//EN
 	SYSTEM ID : http://api.textmarketer.co.uk/services/rest/DTD/credits_post.dtd
-->
<!ELEMENT response (source_credits_before, source_credits_after, 
target_credits_before, target_credits_after)>
<!ATTLIST response
	 processed_date CDATA #REQUIRED
>
<!ELEMENT source_credits_before (#PCDATA)>
<!ELEMENT source_credits_after (#PCDATA)>
<!ELEMENT target_credits_before (#PCDATA)>
<!ELEMENT target_credits_after (#PCDATA)>