Call: 01244 573240   Support: 0845 0093182
Follow Us:
Sign Up Free
Full Access - Free Credits
Takes 60 Seconds

Our price promise

We will match or beat any similar price offer.

Find out more

Our Lastest Reviews

View all

View our Tutorials

See our latest Messenger video tutorials for help and advice on how to get started

Watch Now

Success stories

Testimonials from clients in your sector

View Testimonials

Send Text Messages via our SMS API Gateway

Very simple scripts to send SMS texts from your own systems and software

Our SMS API Gateway enables you to integrate the power of SMS into any application quickly and easily using any development language (PHP, ASP, .NET, Java etc). In a just a few simple lines of code you can easily build your SMS text and deliver to (almost) every mobile phone on the planet!

Thousands of clients connect to our SMS gateway every day - from blue chip organisations to bedroom hobbyists - its easy, low cost and you will be amazed how quicky you can integrate.

Accounts are 100% free, simply purchase text bundles as required. Should you find a lower price, call our Customer Care Team on 01244 573240 and we'll match or beat it.

Or see our international prices.

Message Bundle
Per bundle
Per message
10 MessagesFREE TRIALFREE TRIAL
100 Messages£4.904.9p
200 Messages£9.804.9p
500 Messages£24.504.9p
1000 Messages£49.004.9p
2000 Messages£98.004.9p
5000 Messages£245.004.9p
10000 Messages£450.004.5p
25000 Messages£1,050.004.2p

Code Examples

http://www.txtlocal.com/sendsmspost.php

We have a number of code examples available, however if you see a language that we don't have, please contact us and we'll create one for you.

Please note: You can send unique content to multiple numbers in one API call with the XML API.

						    <?php
						    // Configuration variables
						    $info = "1";
						    $test = "0";
						
						    // Data for text message
						    $from = "Jims Autos";
						    $selectednums = "447123456789";
						    $message = "Test with an ampersand (&) and a £5 note";
						    $message = urlencode($message);
						
						    // Prepare data for POST request
						    $data = "uname=".$uname."&pword=".$pword."&message=".$message
						    ."&from=". $from."&selectednums=".$selectednums."&info=".$info."&test=".$test; 
						
						    // Send the POST request with cURL
						    $ch = curl_init('https://www.txtlocal.com/sendsmspost.php'); //note https for SSL
						    curl_setopt($ch, CURLOPT_POST, true);
						    curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
						    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
						    $result = curl_exec($ch); //This is the result from Textlocal
						    curl_close($ch);
						    ?>
						    

API Parameter Details

The following is a list of variables that can be defined: (* indicates optional)

uname Your Textlocal username (login email address. Sign up for a free test account)
pword * Your Textlocal password. * Either pword or hash is required.
info * Set to '1' to receive information about the request back to your application.
json * Set to '1' to receive a JSON structured response about your request back to your application. The variable info must be set to 0 to receive JSON.
hash * Your Textlocal hash (instead of password above). You can retrieve this from the Messenger->Documentation-All page. * Either pword or hash is required.
from The Sender Name. This can be a word (up to 11 characters) or a number (up to 14 digits). If you set to 'xreplyx' then we will allocate a reply path number to the message, and any replies will arrive in your Simple Reply Service inbox within Messenger. You can then choose to forward these replies to email or your webserver via the Simple Reply Service settings page.
message The text message body. This parameter will need to be URI-encoded.
selectednums A comma-delimited list of mobile numbers in international format. Each number must be purely numeric, so no '+' symbols, hyphens or spaces.
The numbers must be prefixed with their international dialling codes. For example, United Kingdom numbers would look like 447123456789.
group * Contact group ID. If set, you can send your message to an entire Textlocal contact group. You can view a full list of group IDs in the Reports section of Messenger.
custom * If set, this value will be recorded against the message batch and will passed back in the delivery receipts. This allows you to match delivery receipts to their corresponding messages.
rcpurl * Receipt notification URL. If set, all delivery receipts for this message will be sent to the specified URL, instead of the one specified in your Textlocal Account Settings.
sched * Message schedule time. If set, the message will be sent at the specified date and time. This parameter needs to be in the format YYYY-MM-DD-HH-MM-SS (e.g. 2012-01-20-11-30-00 for 11:30am on the 20th January 2012). Scheduled messages can be viewed, modified and deleted via the Messenger.
validity * Message validity datetime. If set, this is the GMT time at which you wish the message to expire if has not yet been received by the phone. This parameter needs to be in the format MMDDHHmm and cannot be more than 48 hours into the future.
test * Sets 'test mode'. Messages will not actually be transmitted, but will appear in the Reports->API Test area of messenger.

Debugging/Error Information

You can get two types of response from our Send SMS API - generic text or JSON. The following table shows the different outputs and responses accordingly.

Info (generic text)

TestMode 0 for live, 1 for testing
MessageReceived The received message
ScheduledDate The received scheduled SMS time
Custom The received custom ID to be passed back in receipt
From The FROM address used. If an invalid address has been passed (say, alphanumeric > 11 characters), it will default to the main account default address.
CreditsAvailable Number of credits at start
MessageLength Length of the message in characters
MessageCount Number of messages (break at 160, 306, 459, 612)
NumberContacts The number of comma separated numbers
CreditsRequired Credits required for job
CreditsRemaining Credits remaining after the job

Errors

Invalid Login Incorrect username and password/hash
Invalid IP If defined, you are coming from the wrong IP address
Invalid validity datetime (MMDDHHmm) Validity time incorrectly formatted
Message Expired Validity time is in the past
No content Message Length zero
Invalid scheduled date format Validity time incorrectly formatted
No mobile number(s) No numbers defined
Message Too Long (<765 characters) Message too long
No credit No SMS credits
Not enough credit Not enough credits for message
testmode - nothing sent You entered test=1, therefore nothing has been sent, however the format of the request you sent was valid

JSON

Below is an example JSON response. If there is an error, Error will exist, and the text will be as above.

						{
							TestMode: 0,
							MessageReceived: "This is a test message",
							MessageCount: 1,
							From: "Textlocal:default",
							CreditsAvailable: 134,
							MessageLength: 5,
							NumberContacts: 1,
							CreditsRequired: 1,
							CreditsRemaining: 133
						}
						

Create Your Free Account - 60 Second Signup - Free Expert Support

"Highly recommend the service from Txtlocal, easy to set up and easy to use. A great product which our club uses to keep members updated. Very useful for contacting a large group of people instantly. Good for passing on urgent messages. Alo allows you to group contacts together so that you can select individul groups from your full contact list for more personnal messages."

Read more reviews >

Our website uses cookies, mmm.... These are small files that make our website work better. If you're unhappy with this you will need to change your cookie settings.
Click here to view our privacy policy Or Click the x button to close.