Big Summer


REST SMS Gateway API – keywords resource

  • Why not share:
  • Social sharing button for Facebook
  • Social sharing button for Linkedin
  • Social sharing button for Twitter
  • Social sharing button for Googleplus
  • Social sharing button for Pinterest

This blog post has been superseded with our website documentation


This document is referred to by the REST SMS Gateway API – Specification Document.

Resource URI:

Actions on the ShortCode keywords (see Short Code SMS Service).

  • GET method – get the availability of a given keyword

GET method

Test whether the specified keyword is available on our ShortCode number.

RESOURCE_ID: the keyword of which to test the availability, e.g. ‘mykeyword’ in the example above

Example usage

will test whether ‘buyit’ is an available keyword.

Example GET response

<response processed_date="2010-05-06T13:43:18+02:00">

The <available> tag shows whether the keyword is available (true/false) and the <recycle> tag shows whether the keyword is available through ‘recycling’ a disused keyword, i.e. one that was in use previously.

Read the advanced specification of this response.

Specific error codes


Example PHP code

 * GET request on the 'keywords' resource
$url = ''; // CHANGE THIS!!!
$username = 'myAPIusername'; // CHANGE THIS!!!
$password = 'myAPIpassword'; // CHANGE THIS!!!
$url = "$url?username=$username&password=$password";

// we're using the curl library to make the request
$curlHandle = curl_init();
curl_setopt($curlHandle, CURLOPT_URL, $url);
curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true);
$responseBody = curl_exec($curlHandle);
$responseInfo  = curl_getinfo($curlHandle);

// deal with the response
if ($responseInfo['http_code']==200)
	$xml_obj = simplexml_load_string($responseBody);
	$available =  $xml_obj->available == 'true';
	$recycled =  $xml_obj->recycle == 'true';
	// do something with the result
	if ($available)
		echo "Available ";
		echo "Unavailable ";

	if ($recycled)
		echo "(recycled)";

} else {
	// handle the error

No related posts.