What do you want the world to know?

TextMarks Blog

News, Updates, Discussion
[ main site: www.textmarks.com ]

 

New API Method: Messaging/sendText()

The TextMarks XML-RPC API now has a new method to send an SMS to a single user.

The Messaging package now supports both the original 1) Messaging/postAlert() to broadcasts to all subscribers of a specific TextMark, as well as 2) the new Messaging/sendText() method to send to a single subscriber.

The PHP Client Library has been updated to provide easy access to this new call.

Example code:

<?php
require "TextMarksAPIClient.class.php";

// Authenticate to TextMarks API:
$sMyApiKey = 'MyAPIKEY_12345678';
$sMyTextMarksUser = 'mytmuser';
$sMyTextMarksPass = 'mytmp@$$word';
$sKeyword = 'MYKEYWORD';

// Send an SMS to a single TextMark subscriber:
$sTo = '415-555-1212';
$sMessage = "Order 534 ready for pickup! --EnviroClean 800-555-1212";
$tmapi = new TextMarksAPIClient_Messaging( $sMyApiKey, $sMyTextMarksUser, $sMyTextMarksPass );
$tmapi->sendText($sKeyword, $sTo, $sMessage);
?>

Full documentation is available at the following resources:

Developer Center:
http://www.textmarks.com/dev/

XML-RPC API Overview:
http://www.textmarks.com/dev/docs/api/

XML-RPC API Method Reference:
http://www.textmarks.com/dev/docs/api/ref/

New sendText() Method:
http://www.textmarks.com/dev/docs/api/ref/Messaging/sendText/

2 Responses to “New API Method: Messaging/sendText()”

  1. Tobin Says:

    The original postAlert XML-RPC call also allowed sending to individual subscribers, has this been deprecated?

  2. dkamins Says:

    The vast majority of use cases were either sending to everybody or sending to a single user. So we’ve split off this new method to simplify the API.

    The old “to” param (CSL of phone#s/usernames) of Messaging/postAlert is deprecated and no longer documented, but will will still supported for sending “MicroAlerts” to one or more subscribers until further notice.

    If you can, please shift to the new sendText() method for single-user messaging. It has an almost identical call signature, so should be an easy change. It is also directly supported by the PHP Client Library, whereas the “to” param required hacking the library for support.

Leave a Reply


Service available on the following wireless networks: AT&T, Verizon Wireless, Sprint, T-Mobile, Virgin, Cricket, Alltel.
Copyright © 2008 TextMarks Inc. All rights reserved.