Simple Connectivity with Wrappers (PHP)

Wonderfully easy, our API wrappers offer you simplicity with the greatest flexibility. As with all our developer solutions, we offer expert support if you have any integration questions.

PHP wrapper    

 

A few Simple Uses

Send

<?php
//Send an SMS
include_once('TMRestClient.php');
$tmClient = new TMRestClient('MyUser', 'MyPass', 'production');
$tmClient->sendSMS('Hello SMS World!', '447000000000', 'SenderName');
?>

Check Balance

<?php
//Get credits available
include_once('TMRestClient.php');
$tmClient = new TMRestClient('MyUser', 'MyPass', 'production');
$creditsAvailable = $tmClient->getCredits();
?>

Delivery Reports

<?php
//Get a delivery report of all messages sent
include_once('TMRestClient.php');
$tmClient = new TMRestClient('MyUser', 'MyPass', 'production');
$result = $tmClient->getDeliveryReport('all');
foreach ($result as $key => $report) {
	foreach ($report['reportrow'] as $key => $reportrow) {
		echo "Msg ID: {$reportrow['message_id']}, to: {$reportrow['mobile_number']}, is: {$reportrow['status']}<br/>\n";
	}
}
?>

 

Some Text Marketer Account functions

Create Accounts

<?php
//Create a sub-account
include_once('TMRestClient.php');
$tmClient = new TMRestClient('MyUser', 'MyPass', 'production');
$tmClient->createSubAccount('My client', '447000000000');
?>

Credit Transfers

<?php
//Transfer 5000 credits to another account
include_once('TMRestClient.php');
$tmClient = new TMRestClient('MyUser', 'MyPass', 'production');
$tmClient->transferCreditsToUser(5000, 'targetAPIusername', 'targetAPIpassword');
?>

 

Refine and error capture

To complete your code you should add some error handing, to catch exceptions. All you need to do is put the wrapper function calls in a try-catch block as follows.

<?php
include_once('TMRestClient.php');
$tmClient = new TMRestClient('MyUser', 'MyPass', 'production');
try {
	$success = false;
	$tmClient->sendSMS('Hello SMS World!', '447000000000', 'SenderName');
	// if the send fails, execution jumps to the start of the catch-block
	$success = true; 
	$creditsAvailable = $tmClient->getCredits();
} catch (Exception $exception) {
	$errors = $tmClient->getLastErrors();
	foreach($errors as $errorcode => $errormsg)
		echo "Code $errorcode: $errormsg";
}
if (!$success)
	echo "There was a problem sending the message";
else
	echo "There are $creditsAvailable credits left";
?>

It is up to you to decide how to handle the errors. We also recommend that you log them for debugging purposes. A list of the possible error codes is available in the full documentation below.

Our example code is an illustration of how you might integrate with our systems and is not certified for production environments. You are responsible for testing and QA.

 

More Information

For a fuller explanation, including all the operations available and how to handle errors please download the PDF documents

Full Wrapper Documentation

 

Have you read through our Basic SMS Gateway API documents.

Check out our Developer Zone for everything you will need to know

 

button to developer zone

SMS API Prices

Text Credits Purchased
Price per Credit
1 -  9,999     5c
10,000 -  24,999     4.8c
25,000 -  49,999     4.6c
50,000 -  99,999     4.5c
100,000 -  249,999     4.4c
250,000 -  499,999     4.2c
500,000 -  999,999     4c
1 million +     Call us

No monthly fees or contracts / Credits don't expire on live accounts* / Texts sent outside the IE use 2 credits

“Integration was quick and hassle-free and support fast and effective.”

Joe Pothecary

brittany

Click to see more testimonials

What to do now...?

conecctivivty

Take a look at
sending sms

 wrappers

Look at our ready made
simple wrappers

 email

Investigate our
Email to SMS gateway

 receive sms

Find out how to
receive SMS

What our clients say...

 “Excellent Product, Support, Documentation and Price”

Really impressed with the whole package, after looking at a few alternatives for integrating SMS to web projects, I found this by the documented API and was up and running very quickly. The customer service has been first class too. Real value for money.

 “5 Star value for money”

Simple as anything to sign up, great current promotion on, and the cheapest I found for this service. Can access from anywhere as your account is through the web. It also has the functionality to schedule messages, so you can have them all set up and sent whenever you want them to.

 “Suits our needs perfectly”

Text Marketer certainly live up to their tag line of them delivering and us saving. As well as this, they also deliver first class customer service to their clients. I highly recommend them.

 5 star service by Text Marketer

 5 star service by Text Marketer

 5 star service by Text Marketer

Click to see more ReviewCentre reviews

 

Get Started today and you'll have your first message sent in minutes.

Use promo code DEV6 and get 50 free credits!

 

button start

SMS Gateway

We have tried to make integration with our SMS Gateway as easy as possible so we have numerous comprehensive documents in our Developer Zone to help you. You can even leave the code writing to us and use our SMS API wrappers - sit back and relax.

The Text Marketer SMS Gateway is not just about sending SMS, our fantastic system comes jam packed with features and functions from receiving text messages to delivery reports - our API SMS system really does go the extra mile.

For our system sending very high multi threaded requests is no problem as our HTTP requests are balanced. Our API and SMS Gateways are designed to allow for complete server failures on a fault tolerant infrastructure meaning that our SMS system and API’s continue sending SMS’s without any disruption.

Don’t worry, in the words of the late great Michael Jackson “You are not alone”. We have a dedicated developer integration team to help you with any SMS API questions you might have.

Contacts

Tel: 01 536 30 18

Email: This email address is being protected from spambots. You need JavaScript enabled to view it.

 

 

Follow Us

For all the latest news, follow us:

Bulk SMS RSS FeedFollow TextMarketer on TwitterFollow TextMarketer on Facebook

Follow TextMarketer on SlideshareFind Text Marketer on Google PlusFind Text Marketer on Google PlusLinkedIn

Text Marketer
The Chase, Level 1, Carmanhall Road, Sandyford Industrial Estate
Dublin, Dublin 18
Ireland 779 5559 54