Kerry Buckley What’s the simplest thing that could possibly go wrong?

17 February 2007

BT’s Java SDK

Filed under: BT,Java,Web21C — Kerry Buckley @ 5:01 pm

As I mentioned recently, I now work in the Web21C SDK team. The SDK provides a simple API for programmatically accessing various web services that BT provides, including SMS, conference calls and location services.

The SDK is in public beta, and is currently free (with daily usage limits). Up to now it’s only been available for those crazy .NET folks, but the next release (on Monday, all being well) will extend that to Java, PHP and Python. Rumour has it that Ruby’s in the works too.

I’ve been having a play with the Java version – here’s a sneak preview…

There are a few steps to get set up. First you need to create an account on the website. You then need to download and run a Java application to register your application and create a certificate to identify you to the underlying services. Then there are a few JARs to put in your classpath, a properties file to update with your username, password and certificate filename, and you’re ready to go.

For example, this is all you need to write to send a text message:

package com.kerrybuckley.sdkdemo;

import com.bt.sdk.sms.Messaging;
import com.bt.sdk.sms.SmsMessage;

public class SmsDemo {
    public static void main(String[] args) {
        Messaging smsService = new Messaging();
        SmsMessage message = new SmsMessage();
        message.addRecipient("tel:+447700900123");
        message.setSubject("Testing...");
        message.setMessageText("Hello world, from the Web21C SDK");
        smsService.send(message);
    }
}

Pretty self-explanatory, and just to prove it works:

SMS Message

[tags]web21c, bt, sdk[/tags]

4 Comments »

  1. I hope smsService.send() has overloads!

    Comment by DE — 19 February 2007 @ 12:44 am

  2. Yes, Messaging#send() is overloaded.

    What DE is getting at is that instead of this:

    Messaging smsService = new Messaging();
    SmsMessage message = new SmsMessage();
    message.addRecipient("tel:+447700900123");
    message.setSubject("Testing...");
    message.setMessageText("Hello world, from the Web21C SDK");
    smsService.send(message);
    

    I could have just used a convenience method:

    Messaging smsService = new Messaging();
    smsService.send("tel:+447700900123",
            "Hello world, from the Web21C SDK",
            "Testing...");
    

    Comment by Kerry — 19 February 2007 @ 12:42 pm

  3. Holy Crap!! BT announce Web API…

    British Telecom have announced an API, called Web21C (catchy!) that grants you access to some of their network services, SMS, VOICE CALLS!! and, well pretty much every service BT offer. If they don’t get it all tangled in the usual BT beurocracy,…

    Trackback by Stubblog — 9 March 2007 @ 12:31 am

  4. BT are always proposing excellent services, if these ever actualy get realised they usually fail to live up to their potential

    Comment by Zac — 8 December 2008 @ 1:25 pm

RSS feed for comments on this post. TrackBack URL

Leave a comment

You must be logged in to post a comment.

Powered by WordPress