Compare the Market: Nobody’s lower priced for quality SMS Lowest Bulk SMS Prices Free Bulk SMS Software
text marketer reviews Text Marketer RSS feeds

REST SMS Gateway API – keywords resource

Posted on June 16th, 2010 by Jay.


Categories: All SMS Gateway Documentation, Business SMS, Documentation, Technical

This blog post has been superseded with our website documentation

keywords

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

Resource URI:

http://www.textmarketer.biz/services/rest/keywords/mykeyword

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

http://www.textmarketer.biz/services/rest/keywords/buyit

will test whether ‘buyit’ is an available keyword.

Example GET response

<response processed_date="2010-05-06T13:43:18+02:00">
<available>true</available>
<recycle>false</recycle>
</response>

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

N/A

Example PHP code

<?php
/**
 * GET request on the 'keywords' resource
 */
$url = 'http://www.textmarketer.biz/services/rest/keywords/mykeywordtest'; // 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);
curl_close($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 ";
	else
		echo "Unavailable ";

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

} else {
	// handle the error
	var_dump($responseBody);
}
?>

Popularity: 9%






Related posts:

  1. REST SMS Gateway API – credits resource
    This blog post has been superseded with our website documentation credits This document is referred to by the REST SMS Gateway API –...
  2. REST SMS Gateway API – deliveryReports resource
    This blog post has been superseded with our website documentation deliveryReports This document is referred to by the REST SMS Gateway API – Specification...
  3. REST SMS API Code Examples
    This blog post has been superseded with our website documentation In our REST API specification document we saw, in general terms, how to...
  4. REST SMS Gateway API – sms resource
    This blog post has been superseded with our website documentation sms This resource deals with sending SMS to customer. This document is referred...
  5. REST SMS Gateway API – deliveryReport resource
    This blog post has been superseded with our website documentation deliveryReport This document is referred to by the REST SMS Gateway API – Specification...
  6. REST SMS Gateway API – Specification Document
    This blog post has been superseded with our website documentation For an overview of what REST and our RESTful SMS API is all...
  7. RESTful Web Services SMS Gateway API Overview
    This blog post has been superseded with our website documentation In addition to our simple HTTP SMS Gateway API, explained here, we also...
  8. PHP 5 Simple SMS send Class
    This blog post has been superseded with our website documentation 2 classes available in php 5, SendSMS and SendSMSXML (recommended) Class Name: SendSMS...
  9. Using our short code and gateway APIs to create a game
    The Concept To create an interactive game using Text Messaging and to show how easy it is to create interactive...
  10. Using the SMS Gateway API, Automating Delivery Report Collection
    This blog post has been superseded with our website documentation Introduction If you are using the API / Gateway to send bulk SMS...

Comments are closed.