API Services - Telephone SMS
Sends a SMS text to the number provided that contains a PIN number. The API will return a reference ID.


URL

https://api.proxstop.com/telephonesms.format


Formats

json, xml


HTTP Methods

GET, POST


Request Data

Required Variable Example Info
Yes key 098f6bcd4621d373cade4e832627b4f6 Your unique API key
Yes country 1 Country code associated with the phone number being sent an SMS. 1, 2, or 3 digits. Click here for a list of country phone codes.
Yes phone 5555555555 Phone number, including area code, to be sent an SMS. Numeric only; remove spaces, hyphens, parenthesis, etc.
Yes code 16322 Verification code to be given to your end-user in the SMS. Numeric 3 to 5 digit code; value should be between 100 and 99999.
No message Custom SMS message to send your user. Up to 160 characters
No ref A personal note / comment


Example Request

https://api.proxstop.com/telephonesms.xml?key=098f6bcd4621d373cade4e832627b4f6&country=1&phone=5555555555&code=16322&message=&ref=


Response Data

Variable Example Info
ref 97A677DD3E0A42B8EA58D93D05BAC89F Reference ID generated by ProxStop that references this SMS request. Use when requesting a Status. 32-character string.


Good Response Example

<?xml version="1.0" encoding="UTF-8"?>
<response>
	<ref>97A677DD3E0A42B8EA58D93D05BAC89F</ref>
</response>		
{
	"version": "1.0",
	"encoding": "UTF-8",
	"response": {
		"ref": 97A677DD3E0A42B8EA58D93D05BAC89F
	}
}		


Bad Response Example

<?xml version="1.0" encoding="UTF-8"?>
<failed>
	<error_code>INVALID_TELEPHONE</error_code>
	<error_msg>The telephone number provided is not valid.</error_msg>
</failed>		
{
	"version": "1.0",
	"encoding": "UTF-8",
	"failed": {
		"error_code": "INVALID_TELEPHONE",
		"error_msg": "The telephone number provided is not valid."
	}
}		


Simple Programming Example

This uses our PHP5 class which can be downloaded by clicking here. The downloadable zip archive will also contain more detailed examples with forms.

// Load config & main class
require_once('config.ProxStop.php');

// Perform Lookup
$country = '1'; // Country code associated with the phone number being sent an SMS. 1, 2, or 3 digits.  
$phone = '5555555555'; // Phone number, including area code, to be sent an SMS. Numeric only; remove spaces, hyphens, parenthesis, etc.
$code = '16322'; // Verification code to be given to your end-user in the SMS. Numeric 3 to 5 digit code; value should be between 100 and 99999.
$message = ''; // Custom SMS message to send your user. Up to 160 characters
$ref = ''; // A personal note / comment
$result = $ProxStop->telephoneSMS($country,$phone,$code,$message,$ref);

// The lookup failed, print the error message.
if($result===false)
{
	echo 'The lookup failed with the error "'.$ProxStop->errors['code'].': '.$ProxStop->errors['msg'].'"';
}

// The result was good and the text should be sent shortly
else
{
	echo 'Please wait while we text the phone number provided.';
}		
$apiUrl = 'https://api.proxstop.com/telephonesms.xml';
$apiKey = '098f6bcd4621d373cade4e832627b4f6'; // Replace with your API key
$country = '1'; // Country code associated with the phone number being sent an SMS. 1, 2, or 3 digits.  
$phone = '5555555555'; // Phone number, including area code, to be sent an SMS. Numeric only; remove spaces, hyphens, parenthesis, etc.
$code = '16322'; // Verification code to be given to your end-user in the SMS. Numeric 3 to 5 digit code; value should be between 100 and 99999.
$message = ''; // Custom SMS message to send your user. Up to 160 characters
$ref = ''; // A personal note / comment

$result = file_get_contents($apiUrl.'?key='.$apiKey.'&country='.$country.'&phone='.$phone.'&code='.$code.'&message='.$message.'&ref='.$ref);
$result = simplexml_load_string($result);

if(isset($result->error_code))
{
	echo 'The lookup failed with the error "'.$result->error_code.': '.$result->error_msg.'"';
}
else if(!isset($result->ref))
{
	echo 'The service seems to be temporarily unavailable.';
}
else
{
	// Do what you need here
}		
string apiUrl = "https://api.proxstop.com/telephonesms.xml";
string apiKey = "098f6bcd4621d373cade4e832627b4f6"; // Replace with your API key
string varCountry = "1"; // Country code associated with the phone number being sent an SMS. 1, 2, or 3 digits.  
string varPhone = "5555555555"; // Phone number, including area code, to be sent an SMS. Numeric only; remove spaces, hyphens, parenthesis, etc.
string varCode = "16322"; // Verification code to be given to your end-user in the SMS. Numeric 3 to 5 digit code; value should be between 100 and 99999.
string varMessage = ""; // Custom SMS message to send your user. Up to 160 characters
string varRef = ""; // A personal note / comment

string results = new System.Net.WebClient().DownloadString(apiUrl+"?key="+apiKey+"&country="+varCountry+"&phone="+varPhone+"&code="+varCode+"&message="+varMessage+"&ref="+varRef);
System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
doc.LoadXml(results);

if(doc.SelectSingleNode("//failed/error_code")!=null)
{
	Response.Write("The lookup failed with the error \""+doc.SelectSingleNode("//failed/error_code/text()").Value+": "+doc.SelectSingleNode("//failed/error_msg/text()").Value+"\"");
}
else if(doc.SelectSingleNode("//response/ref")==null)
{
	Response.Write("The service seems to be temporarily unavailable.");
}
else
{
	// Do what you need here
}		
require 'net/http'
require 'rexml/document'

apiUrl = 'https://api.proxstop.com/telephonesms.xml'
apiKey = '098f6bcd4621d373cade4e832627b4f6' #Replace with your API key
country = '1' #Country code associated with the phone number being sent an SMS. 1, 2, or 3 digits.  
phone = '5555555555' #Phone number, including area code, to be sent an SMS. Numeric only; remove spaces, hyphens, parenthesis, etc.
code = '16322' #Verification code to be given to your end-user in the SMS. Numeric 3 to 5 digit code; value should be between 100 and 99999.
message = '' #Custom SMS message to send your user. Up to 160 characters
ref = '' #A personal note / comment

xml_data = Net::HTTP.get_response(URI.parse(apiUrl+'?key='+apiKey+'&country='+country+'&phone='+phone+'&code='+code+'&message='+message+'&ref='+ref)).body
doc = REXML::Document.new(xml_data)

if doc.elements['failed/error_code']
	print 'The lookup failed with the error '+doc.elements['failed/error_code'].text+': '+doc.elements['failed/error_msg'].text

elsif !doc.elements['response/ref']
	print 'The service seems to be temporarily unavailable.'

else
	#Do what you need here

end		
from urllib.request import urlopen
from xml.dom import minidom

apiUrl = 'https://api.proxstop.com/telephonesms.xml'
apiKey = '098f6bcd4621d373cade4e832627b4f6' #Replace with your API key
country = '1' #Country code associated with the phone number being sent an SMS. 1, 2, or 3 digits.  
phone = '5555555555' #Phone number, including area code, to be sent an SMS. Numeric only; remove spaces, hyphens, parenthesis, etc.
code = '16322' #Verification code to be given to your end-user in the SMS. Numeric 3 to 5 digit code; value should be between 100 and 99999.
message = '' #Custom SMS message to send your user. Up to 160 characters
ref = '' #A personal note / comment

dom = minidom.parse(urlopen(apiUrl+'?key='+apiKey+'&country='+country+'&phone='+phone+'&code='+code+'&message='+message+'&ref='+ref))

if (dom.getElementsByTagName('error_code')):
	print (dom.getElementsByTagName('error_code')[0].firstChild.data+': '+dom.getElementsByTagName('error_msg')[0].firstChild.data)

elif not (dom.getElementsByTagName('response')):
	print ('The service seems to be temporarily unavailable.')

else:
	#Do what you need here
	print ('Success')		
const http = require('http');

var apiHost = 'api.proxstop.com';
var apiPath = '/telephonesms.json';
var apiKey = '098f6bcd4621d373cade4e832627b4f6'; //Replace with your API key
var varCountry = '1'; //Country code associated with the phone number being sent an SMS. 1, 2, or 3 digits.  
var varPhone = '5555555555'; //Phone number, including area code, to be sent an SMS. Numeric only; remove spaces, hyphens, parenthesis, etc.
var varCode = '16322'; //Verification code to be given to your end-user in the SMS. Numeric 3 to 5 digit code; value should be between 100 and 99999.
var varMessage = ''; //Custom SMS message to send your user. Up to 160 characters
var varRef = ''; //A personal note / comment

http.get({host:apiHost,port:80,path:apiPath+'?key='+apiKey+'&country='+varCountry+'&phone='+varPhone+'&code='+varCode+'&message='+varMessage+'&ref='+varRef,agent:false},function(res){
	res.setEncoding('utf8');
	res.on('data',function(chunk){
		var json = JSON.parse(chunk);
		if(json.failed!=undefined) {
			console.log(json.failed.error_code+': '+json.failed.error_msg);
		} else if(json.response==undefined) {
			console.log('The service seems to be temporarily unavailable.');
		} else {
			//Do what you need here
			console.log('Success');
		}
	});
});		
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.DocumentBuilder;
import org.w3c.dom.Document;
import org.w3c.dom.*;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
import java.io.File;

public class ProxStop {
	public static void main(String[] args) {

		String apiUrl = "https://api.proxstop.com/telephonesms.xml";
		String apiKey = "098f6bcd4621d373cade4e832627b4f6"; //Replace with your API key
		String varCountry = "1"; //Country code associated with the phone number being sent an SMS. 1, 2, or 3 digits.  
		String varPhone = "5555555555"; //Phone number, including area code, to be sent an SMS. Numeric only; remove spaces, hyphens, parenthesis, etc.
		String varCode = "16322"; //Verification code to be given to your end-user in the SMS. Numeric 3 to 5 digit code; value should be between 100 and 99999.
		String varMessage = ""; //Custom SMS message to send your user. Up to 160 characters
		String varRef = ""; //A personal note / comment

		try {
			DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
			DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
			Element docEle = dBuilder.parse(apiUrl+"?key="+apiKey+"&country="+varCountry+"&phone="+varPhone+"&code="+varCode+"&message="+varMessage+"&ref="+varRef).getDocumentElement();

			if (docEle.getNodeName()=="failed") {
				System.out.println(docEle.getElementsByTagName("error_code").item(0).getChildNodes().item(0).getNodeValue()+": "+docEle.getElementsByTagName("error_msg").item(0).getChildNodes().item(0).getNodeValue());
			} else if (docEle.getNodeName()!="response") {
				System.out.println("The service seems to be temporarily unavailable.");
			} else {
				//Do what you need here
				System.out.println("Success.");
			}
		} catch (SAXParseException err) {
		} catch (SAXException e) {
		} catch (Throwable t) {
		}
	}
}		


Price

Please login to your account and navigate to the API page to view pricing.