Textlocal Logo

API Documentation

Create User

A Reseller only serviceThis command can be used to create a new sub account under a dual brand or white label provider account.

Resource URL

https://api.txtlocal.com/create_user/

Sample Request

<?php

$data = [
    'apiKey' => 'Your API Key',
    'user_email' => 'example@example.com',
    'user_password' => 'hunter2',
    'sender' => 'example',
];

// Send the POST request with cURL
$ch = curl_init('https://api.txtlocal.com/create_user/');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);

// Process your response here
echo $response;
<?php

	$data = [
	    'apiKey' => 'Your API Key',
	    'user_email' => 'example@example.com',
	    'user_password' => 'hunter2',
	    'sender' => 'example',
	];

	$data = http_build_query($data);

	// Send the GET request with cURL
	$ch = curl_init('https://api.txtlocal.com/create_user/?' . $data);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	$response = curl_exec($ch);
	curl_close($ch);

	// Process your response here
	echo $response;

Parameters

name The full name of the user account to add. E.g. "John Doe".
user_email The email address of the user account.
user_password The password the user will use to login with in conjunction with their email address. Must be between 6 and 20 characters inclusive.
sender The default sender name used for messages sent. Must be between 3 and 11 alphanumeric characters inclusive.
Login Parameters (Additional Information)
apiKey You can create these in your Messenger Control Panel (click here) for each application, and limit the usage of them by host IP Address.
Optional Parameters
send_activation_email If set to true, the user will be sent an activation email containing their login details.
address The first lines postal address of the customer. E.g. "Company, Unit 35, Business Park, Long Road".
postcode The new user's postcode.
town The new user's town.
county The new user's county.
country The new user's country in ISO 3166-1 alpha-2 format.
telephone The new user's telephone number.
company The new user's company.

Sample Response

{
    "shortcode": {
        "number": "60777",
        "keyword": "ABC12"
    },
    "email_sent": true,
    "user": {
        "id": 123456
    },
    "status": "success"
}
{
    "shortcode": {
        "number": "60777",
        "keyword": "ABC12"
    },
    "email_sent": true,
    "user": {
        "id": 123456
    },
    "status": "success"
}

Errors

Error Codes
200 No customer name specified.
201 No customer email address specified.
202 Invalid password.
203 No sender name specified.
204 Invalid password.
205 There is already an account with that email address.
206 There are not enough credits available on the master account to transfer the initial balance to the new sub account.
207 Reseller not authorised to create sub accounts
172 No reseller account found