DEPRECATED - Bulk SMS Database Management

Add contact numbers to your group via API

Choose an API

Overview

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

You can inject contact details directly to a group on your Messenger account sending a GET or POST request to the URL below. For added security, connect to our API via SSL by replacing 'http' with 'https'.

Code Examples

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.

						<?php
					    // Authorisation details
					    $uname = "youremailaddress";
					    $pword = "yourpassword";
					    
					    // Contact details
					    $group = "5";
					    $numbers = "44777000000";
					    
					    // Prepare data for POST request
					    $data = "uname=".$uname."&pword=".$pword."&group=".$group."&numbers=".$numbers; 
					    
					    // Send the POST request with cURL
					    $ch = curl_init('http://www.txtlocal.com/tl_inject.php');
					    curl_setopt($ch, CURLOPT_POST, true);
					    curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
					    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
					    $result = curl_exec($ch); //Our API reply
					    curl_close($ch);
					    ?>
						

API Parameter Details

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

uname Your Textlocal username.
pword Your Textlocal password.
group ID of the group you'd like to inject into. You can view a full list of group IDs in the Reports section of Messenger.
numbers Comma-delimited list of numbers to inject into the group. Each number must be purely numeric, so no '+' symbols, hyphens or spaces.
The numbers must be prefixed with their international dialling codes. For example, {var_s:form_country_name} numbers would look like {var_s:example_number}.
firstname * A comma-delimited list of first names to correspond with each number.
lastname * A comma-delimited list of last names to correspond with each number.
custom1 * A comma-delimited list of Custom 1 fields to correspond with each number. Each field can be up to 50 characters in length.
custom2 * A comma-delimited list of Custom 2 fields to correspond with each number. Each field can be up to 50 characters in length.
custom3 * A comma-delimited list of Custom 3 fields to correspond with each number. Each field can be up to 160 characters in length.

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)

All new numbers added to your txtlocal list. Successfully added number(s) to your group.

Errors

Invalid credentials Incorrect username and password/hash
No numbers to add You have not defined any valid numbers
Invalid group ID Incorrect group, or not group provided
Not enough first names Compared to the count of numbers, there are not enough first names
Not enough last names Compared to the count of numbers, there are not enough last names
You are uploading more than 20,000 contacts. It would be wise to split your contacts into smaller groups, or email the list to support@txtlocal.com and we will process it for you within the hour!
Top